UNPKG

react-native-google-autocomplete

Version:

Using render props to make google autocomplete work nicely with any design.

1 lines 40.6 kB
{"version":3,"file":"GoogleAutoComplete.umd.js","sources":["../node_modules/tslib/tslib.es6.js","../node_modules/strict-uri-encode/index.js","../node_modules/query-string/index.js","../lib/services/Google.service.ts","../lib/utils.ts","../lib/GoogleAutocomplete.tsx"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","'use strict';\nmodule.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.charCodeAt(0).toString(16).toUpperCase()}`);\n","'use strict';\nconst strictUriEncode = require('strict-uri-encode');\nconst decodeComponent = require('decode-uri-component');\nconst splitOnFirst = require('split-on-first');\n\nfunction encoderForArrayFormat(options) {\n\tswitch (options.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn key => (result, value) => {\n\t\t\t\tconst index = result.length;\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn [...result, [encode(key, options), '[', index, ']'].join('')];\n\t\t\t\t}\n\n\t\t\t\treturn [\n\t\t\t\t\t...result,\n\t\t\t\t\t[encode(key, options), '[', encode(index, options), ']=', encode(value, options)].join('')\n\t\t\t\t];\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn key => (result, value) => {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn [...result, [encode(key, options), '[]'].join('')];\n\t\t\t\t}\n\n\t\t\t\treturn [...result, [encode(key, options), '[]=', encode(value, options)].join('')];\n\t\t\t};\n\n\t\tcase 'comma':\n\t\t\treturn key => (result, value, index) => {\n\t\t\t\tif (value === null || value === undefined || value.length === 0) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (index === 0) {\n\t\t\t\t\treturn [[encode(key, options), '=', encode(value, options)].join('')];\n\t\t\t\t}\n\n\t\t\t\treturn [[result, encode(value, options)].join(',')];\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn key => (result, value) => {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tif (value === null) {\n\t\t\t\t\treturn [...result, encode(key, options)];\n\t\t\t\t}\n\n\t\t\t\treturn [...result, [encode(key, options), '=', encode(value, options)].join('')];\n\t\t\t};\n\t}\n}\n\nfunction parserForArrayFormat(options) {\n\tlet result;\n\n\tswitch (options.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tresult = /\\[(\\d*)\\]$/.exec(key);\n\n\t\t\t\tkey = key.replace(/\\[\\d*\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = {};\n\t\t\t\t}\n\n\t\t\t\taccumulator[key][result[1]] = value;\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tresult = /(\\[\\])$/.exec(key);\n\t\t\t\tkey = key.replace(/\\[\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = [value];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\n\t\tcase 'comma':\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tconst isArray = typeof value === 'string' && value.split('').indexOf(',') > -1;\n\t\t\t\tconst newValue = isArray ? value.split(',') : value;\n\t\t\t\taccumulator[key] = newValue;\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn (key, value, accumulator) => {\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\t}\n}\n\nfunction encode(value, options) {\n\tif (options.encode) {\n\t\treturn options.strict ? strictUriEncode(value) : encodeURIComponent(value);\n\t}\n\n\treturn value;\n}\n\nfunction decode(value, options) {\n\tif (options.decode) {\n\t\treturn decodeComponent(value);\n\t}\n\n\treturn value;\n}\n\nfunction keysSorter(input) {\n\tif (Array.isArray(input)) {\n\t\treturn input.sort();\n\t}\n\n\tif (typeof input === 'object') {\n\t\treturn keysSorter(Object.keys(input))\n\t\t\t.sort((a, b) => Number(a) - Number(b))\n\t\t\t.map(key => input[key]);\n\t}\n\n\treturn input;\n}\n\nfunction removeHash(input) {\n\tconst hashStart = input.indexOf('#');\n\tif (hashStart !== -1) {\n\t\tinput = input.slice(0, hashStart);\n\t}\n\n\treturn input;\n}\n\nfunction extract(input) {\n\tinput = removeHash(input);\n\tconst queryStart = input.indexOf('?');\n\tif (queryStart === -1) {\n\t\treturn '';\n\t}\n\n\treturn input.slice(queryStart + 1);\n}\n\nfunction parse(input, options) {\n\toptions = Object.assign({\n\t\tdecode: true,\n\t\tsort: true,\n\t\tarrayFormat: 'none',\n\t\tparseNumbers: false,\n\t\tparseBooleans: false\n\t}, options);\n\n\tconst formatter = parserForArrayFormat(options);\n\n\t// Create an object with no prototype\n\tconst ret = Object.create(null);\n\n\tif (typeof input !== 'string') {\n\t\treturn ret;\n\t}\n\n\tinput = input.trim().replace(/^[?#&]/, '');\n\n\tif (!input) {\n\t\treturn ret;\n\t}\n\n\tfor (const param of input.split('&')) {\n\t\tlet [key, value] = splitOnFirst(param.replace(/\\+/g, ' '), '=');\n\n\t\t// Missing `=` should be `null`:\n\t\t// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n\t\tvalue = value === undefined ? null : decode(value, options);\n\n\t\tif (options.parseNumbers && !Number.isNaN(Number(value))) {\n\t\t\tvalue = Number(value);\n\t\t} else if (options.parseBooleans && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) {\n\t\t\tvalue = value.toLowerCase() === 'true';\n\t\t}\n\n\t\tformatter(decode(key, options), value, ret);\n\t}\n\n\tif (options.sort === false) {\n\t\treturn ret;\n\t}\n\n\treturn (options.sort === true ? Object.keys(ret).sort() : Object.keys(ret).sort(options.sort)).reduce((result, key) => {\n\t\tconst value = ret[key];\n\t\tif (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {\n\t\t\t// Sort object keys, not values\n\t\t\tresult[key] = keysSorter(value);\n\t\t} else {\n\t\t\tresult[key] = value;\n\t\t}\n\n\t\treturn result;\n\t}, Object.create(null));\n}\n\nexports.extract = extract;\nexports.parse = parse;\n\nexports.stringify = (object, options) => {\n\tif (!object) {\n\t\treturn '';\n\t}\n\n\toptions = Object.assign({\n\t\tencode: true,\n\t\tstrict: true,\n\t\tarrayFormat: 'none'\n\t}, options);\n\n\tconst formatter = encoderForArrayFormat(options);\n\tconst keys = Object.keys(object);\n\n\tif (options.sort !== false) {\n\t\tkeys.sort(options.sort);\n\t}\n\n\treturn keys.map(key => {\n\t\tconst value = object[key];\n\n\t\tif (value === undefined) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (value === null) {\n\t\t\treturn encode(key, options);\n\t\t}\n\n\t\tif (Array.isArray(value)) {\n\t\t\treturn value\n\t\t\t\t.reduce(formatter(key), [])\n\t\t\t\t.join('&');\n\t\t}\n\n\t\treturn encode(key, options) + '=' + encode(value, options);\n\t}).filter(x => x.length > 0).join('&');\n};\n\nexports.parseUrl = (input, options) => {\n\treturn {\n\t\turl: removeHash(input).split('?')[0] || '',\n\t\tquery: parse(extract(input), options)\n\t};\n};\n","import * as queryString from 'query-string';\n\nconst BASE_URL = 'https://maps.googleapis.com/maps/api/place';\n\nexport interface Query {\n language: string;\n key: string;\n types:\n | 'address'\n | 'geocode'\n | '(cities)'\n | 'establishment'\n | 'geocode|establishment';\n components?: string;\n radius?: string;\n lat?: number;\n lng?: number;\n strictBounds?: boolean;\n}\n\nexport interface GoogleLocationDetailResult {\n adr_address: string;\n formatted_address: string;\n icon: string;\n id: string;\n name: string;\n place_id: string;\n scope: string;\n reference: string;\n url: string;\n utc_offset: number;\n vicinity: string;\n types: string[];\n geometry: {\n location: {\n lat: number;\n lng: number;\n };\n viewport: {\n [type: string]: {\n lat: number;\n lng: number;\n };\n };\n };\n address_components: Array<{\n long_name: string;\n short_name: string;\n types: string[];\n }>;\n}\n\nexport interface GoogleLocationResult {\n description: string;\n id: string;\n matched_substrings: Array<{\n length: number;\n offset: number;\n }>;\n place_id: string;\n reference: string;\n structured_formatting: {\n main_text: string;\n secondary_text: string;\n main_text_matched_substrings: Array<{\n length: number;\n }>;\n };\n terms: Array<{\n offset: number;\n value: string;\n }>;\n types: string[];\n}\n\ninterface NormalizeQuery {\n language: string;\n key: string;\n types:\n | 'address'\n | 'geocode'\n | '(cities)'\n | 'establishment'\n | 'geocode|establishment';\n components?: string;\n radius?: string;\n location?: string;\n strictBounds?: boolean;\n}\n\nconst normalizeQuery = (query: Query): NormalizeQuery => {\n const { lat, lng, ...rest } = query;\n\n // The latitude/longitude around which to retrieve place information. This must be specified as latitude,longitude.\n let location;\n\n // If one of the value is provide lat/lng both must be there\n if ((lat && !lng) || (lng && !lat)) {\n throw new Error('Query: Location must have both lat & lng');\n }\n\n if (lat && lng) {\n location = `${lat},${lng}`;\n }\n\n return {\n ...rest,\n location,\n };\n};\n\nexport class GoogleService {\n public static async _search(\n term: string,\n query: Query,\n ): Promise<{\n predictions: GoogleLocationResult[];\n status: string;\n }> {\n const url = `${BASE_URL}/autocomplete/json?&input=${encodeURIComponent(\n term,\n )}&${queryString.stringify({ ...normalizeQuery(query) })}${\n query.strictBounds ? '&strictbounds' : ''\n }`;\n\n const res = await fetch(url);\n\n if (!res.ok) {\n throw new Error(res.statusText);\n }\n\n return res.json();\n }\n\n public static async _searchDetails(\n placeid: string,\n query: Query,\n ): Promise<GoogleLocationDetailResult> {\n const url = `${BASE_URL}/details/json?${queryString.stringify({\n ...normalizeQuery(query),\n placeid,\n })}`;\n\n const res = await fetch(url);\n\n const resJson: {\n status: string;\n result: GoogleLocationDetailResult;\n } = await res.json();\n\n if (!resJson.status) {\n throw new Error(res.statusText);\n }\n\n return Promise.resolve(resJson.result);\n }\n}\n","export const isFunction = <T extends Function>(value: any): value is T =>\n typeof value === 'function';\n","import * as React from 'react';\nimport * as PropTypes from 'prop-types';\nimport { debounce } from 'lodash';\n\nimport {\n GoogleLocationResult,\n GoogleService,\n GoogleLocationDetailResult,\n} from './services/Google.service';\nimport { isFunction } from './utils';\n\nexport const initialState = {\n inputValue: '',\n locationResults: [],\n isSearching: false,\n};\n\nconst defaultProps: DefaultProps = {\n /**\n * Minimun length of the input before start fetching - default: 2\n */\n minLength: 2,\n /**\n * Debounce request time in ms - default: 300\n */\n debounce: 300,\n /**\n * Language for Google query - default: en\n */\n language: 'en',\n\n /**\n * See https://developers.google.com/places/web-service/autocomplete#place_types = default: address\n */\n queryTypes: 'address',\n};\n\nexport interface DefaultProps {\n minLength: number;\n debounce: number;\n language: string;\n queryTypes:\n | 'address'\n | 'geocode'\n | '(cities)'\n | 'establishment'\n | 'geocode|establishment';\n}\n\nexport type P = Partial<\n {\n children: RenderCallback;\n render: RenderCallback;\n components: string;\n radius: string;\n lat: number;\n lng: number;\n strictBounds: boolean;\n } & DefaultProps\n> & {\n /**\n * Api Key provided by google\n */\n apiKey: string;\n};\n\nexport type RenderCallback = (args: GoogleAutoCompleteProps) => JSX.Element;\n\nexport type GoogleAutoCompleteProps = {\n inputValue: S['inputValue'];\n locationResults: S['locationResults'];\n handleTextChange: (value: string) => void;\n handleEventChange: (e: React.ChangeEvent<HTMLInputElement>) => void;\n fetchDetails: (placeId: string) => Promise<GoogleLocationDetailResult>;\n clearSearch: () => void;\n isSearching: boolean;\n};\n\nexport type S = Readonly<{\n inputValue: string;\n locationResults: GoogleLocationResult[];\n isSearching: boolean;\n}>;\n\nexport class GoogleAutoComplete extends React.PureComponent<P, S> {\n public static readonly defaultProps: DefaultProps = defaultProps;\n\n static propTypes = {\n /**\n * Minimun length before sending a search request default 2\n */\n minLength: PropTypes.number,\n /**\n * Time for debouncing the search default 300\n */\n debounce: PropTypes.number,\n /**\n * Your api key\n */\n apiKey: PropTypes.string.isRequired,\n /**\n * The language code, indicating in which language the results should be returned, if possible.\n * Searches are also biased to the selected language;\n * results in the selected language may be given a higher ranking.\n */\n language: PropTypes.string,\n /**\n * A grouping of places to which you would like to restrict your results\n */\n components: PropTypes.string,\n /**\n * The distance (in meters) within which to return place results.\n * Note that setting a radius biases results to the indicated area,\n * but may not fully restrict results to the specified area.\n */\n radius: PropTypes.string,\n\n /**\n * The latitude to retrieve place information\n */\n lat: PropTypes.number,\n\n /**\n * The longitude to retrieve place information\n */\n lng: PropTypes.number,\n\n /**\n * Enable strict mode to return search result only in the area defined by radius, lat and lng\n */\n strictBounds: PropTypes.bool,\n };\n\n readonly state: S = initialState;\n\n /**\n * Keep track if the component isMounted or not\n */\n private _isMounted: boolean;\n\n /**\n * Search to google automplete service\n */\n private _search = debounce(async (term: string) => {\n if (this._isMounted) {\n this.setState({ isSearching: true });\n\n const searchOpts = {\n key: this.props.apiKey,\n language: this.props.language!,\n types: this.props.queryTypes!,\n components: this.props.components,\n radius: this.props.radius,\n lat: this.props.lat,\n lng: this.props.lng,\n strictBounds: this.props.strictBounds,\n };\n\n try {\n const results = await GoogleService._search(term, searchOpts);\n\n this.setState({\n locationResults: results.predictions,\n isSearching: false,\n });\n } catch (error) {\n throw error;\n }\n }\n }, this.props.debounce);\n\n componentDidMount() {\n this._isMounted = true;\n }\n\n componentWillUnmount() {\n this._isMounted = false;\n }\n\n render() {\n const renderProps = {\n inputValue: this.state.inputValue,\n locationResults: this.state.locationResults,\n handleTextChange: this._handleTextChange,\n handleEventChange: this._handleEventChange,\n fetchDetails: this._searchDetails,\n isSearching: this.state.isSearching,\n clearSearch: this._clearSearch,\n };\n\n if (this.props.render) {\n return this.props.render(renderProps);\n }\n\n return isFunction(this.props.children)\n ? this.props.children(renderProps)\n : null;\n }\n\n private _clearSearch = () => {\n if (this._isMounted) {\n this.setState({\n locationResults: [],\n });\n }\n };\n\n /**\n * Handle the input change for react-native\n */\n private _handleTextChange = (inputValue: string) => {\n if (this.props.apiKey == null) {\n throw new Error('Api Key is required');\n }\n\n this.setState({\n inputValue,\n });\n\n if (inputValue.length >= this.props.minLength!) {\n this._search(inputValue);\n }\n };\n\n /**\n * Handle the input change for react web\n */\n private _handleEventChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const { value } = e.target;\n\n this.setState({\n inputValue: value,\n });\n\n if (value.length >= this.props.minLength!) {\n this._search(value);\n }\n };\n\n /**\n * Handle the search details when provide the place_id\n */\n private _searchDetails = async (\n placeId: string,\n ): Promise<GoogleLocationDetailResult> => {\n const searchOpts = {\n key: this.props.apiKey,\n language: this.props.language!,\n types: this.props.queryTypes!,\n components: this.props.components,\n };\n\n try {\n return GoogleService._searchDetails(placeId, searchOpts);\n } catch (error) {\n throw error;\n }\n };\n}\n"],"names":["queryString.stringify","tslib_1.__extends","debounce","PropTypes.number","PropTypes.string","PropTypes.bool","React.PureComponent"],"mappings":";;;;;;IAAA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,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