{"version":3,"file":"places-search-HE3Ux_D9.js","sources":["../../../node_modules/@heroicons/react/16/solid/esm/MagnifyingGlassIcon.js","../../../app/frontend/entrypoints/admin/components/locations/components/google-maps/places-search.jsx"],"sourcesContent":["import * as React from \"react\";\nfunction MagnifyingGlassIcon({\n title,\n titleId,\n ...props\n}, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 16 16\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n \"data-slot\": \"icon\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n d: \"M9.965 11.026a5 5 0 1 1 1.06-1.06l2.755 2.754a.75.75 0 1 1-1.06 1.06l-2.755-2.754ZM10.5 7a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z\",\n clipRule: \"evenodd\"\n }));\n}\nconst ForwardRef = /*#__PURE__*/ React.forwardRef(MagnifyingGlassIcon);\nexport default ForwardRef;","import React, { useState, useEffect } from 'react';\nimport { MagnifyingGlassIcon } from '@heroicons/react/16/solid'\nimport { searchPlaces } from '../../../../modules/google-maps'\n\nconst PlacesSearch = ({ initSearch, location, updateField }) => {\n const [query, setQuery] = useState('')\n const [radius, setRadius] = useState(10);\n\n useEffect(() => {\n if(!initSearch) return;\n\n setQuery(initSearch)\n }, [initSearch])\n\n function handleSubmit(e) {\n e.preventDefault();\n searchPlaces(query, radius, location)\n .then((data) => {\n console.log(data);\n updateField('places_response', {\n places: data,\n place: location.places_response?.place\n })\n })\n }\n\n return (\n