import { distanceQueryFixture , placeDetailsQueryFixture } from '../model/query.fixture' ; import type { DistanceDetailsInterface , DistanceQueryInterface , LocationInterface , PlaceDetailsQueryInterface , SuggestionInterface , } from '../../../src/interface' ; const providerRawLocationResponse = Object . freeze ( { results : [ { address_components : [ { long_name : '80' , short_name : '80' , types : [ 'street_number' ] , } , { long_name : 'Cranberry Street' , short_name : 'Cranberry St' , types : [ 'route' ] , } , { long_name : 'Brooklyn Heights' , short_name : 'Brooklyn Heights' , types : [ 'neighborhood' , 'political' ] , } , { long_name : 'Brooklyn' , short_name : 'Brooklyn' , types : [ 'political' , 'sublocality' , 'sublocality_level_1' ] , } , { long_name : 'Kings County' , short_name : 'Kings County' , types : [ 'administrative_area_level_2' , 'political' ] , } , { long_name : 'New York' , short_name : 'NY' , types : [ 'administrative_area_level_1' , 'political' ] , } , { long_name : 'United States' , short_name : 'US' , types : [ 'country' , 'political' ] , } , { long_name : '11201' , short_name : '11201' , types : [ 'postal_code' ] , } , { long_name : '1726' , short_name : '1726' , types : [ 'postal_code_suffix' ] , } , ] , formatted_address : '80 Cranberry St, Brooklyn, NY 11201, USA' , geometry : { location : { lat : 40.6993821 , lng : - 73.99252369999999 , } , location_type : 'ROOFTOP' , viewport : { northeast : { lat : 40.7007310802915 , lng : - 73.99117471970848 , } , southwest : { lat : 40.69803311970851 , lng : - 73.99387268029149 , } , } , } , place_id : 'ChIJoxUurzdawokRBdaMVnaoH5I' , plus_code : { compound_code : 'M2X4+QX New York, United States' , global_code : '87G8M2X4+QX' , } , types : [ 'street_address' ] , } , ] , status : 'OK' , } ) ; const providerParsedLocationResponse = Object . freeze < LocationInterface > ( [ { formattedAddress : '80 Cranberry St, Brooklyn, NY 11201, USA' , latitude : 40.6993821 , longitude : - 73.99252369999999 , country : 'United States' , countryCode : 'US' , state : 'New York' , stateCode : 'NY' , city : 'Brooklyn' , postalCode : '11201' , streetName : 'Cranberry Street' , houseNumber : '80' , provider : 'GoogleMapsProvider' , placeId : providerRawLocationResponse . results [ 0 ] . place_id , raw : providerRawLocationResponse . results [ 0 ] , } , ] ) ; export const providerRawGeocodeResponse = providerRawLocationResponse ; export const providerParsedGeocodeResponse = providerParsedLocationResponse ; export const providerRawReverseResponse = providerRawLocationResponse ; export const providerParsedReverseResponse = providerParsedLocationResponse ; export const providerRawSuggestResponse = Object . freeze ( { predictions : [ { description : '1158 East 89th Street, Chicago, IL, USA' , id : 'e0a391cdbe024898ee821d3de48d13600934bed4' , matched_substrings : [ { length : 21 , offset : 0 , } , ] , place_id : 'EicxMTU4IEVhc3QgODl0aCBTdHJlZXQsIENoaWNhZ28sIElMLCBVU0EiMRIvChQKEgmfSpDiICYOiBGJDfMooYwZwBCGCSoUChIJCQJVUComDogR4NP62uoauTA' , reference : 'EicxMTU4IEVhc3QgODl0aCBTdHJlZXQsIENoaWNhZ28sIElMLCBVU0EiMRIvChQKEgmfSpDiICYOiBGJDfMooYwZwBCGCSoUChIJCQJVUComDogR4NP62uoauTA' , structured_formatting : { main_text : '1158 East 89th Street' , main_text_matched_substrings : [ { length : 21 , offset : 0 , } , ] , secondary_text : 'Chicago, IL, USA' , } , terms : [ { offset : 0 , value : '1158 East 89th Street' , } , { offset : 23 , value : 'Chicago' , } , { offset : 32 , value : 'IL' , } , { offset : 36 , value : 'USA' , } , ] , types : [ 'route' , 'geocode' ] , } , ] , status : 'OK' , } ) ; export const providerParsedSuggestResponse = Object . freeze < SuggestionInterface > ( [ { formattedAddress : providerRawSuggestResponse . predictions [ 0 ] . description , placeId : providerRawSuggestResponse . predictions [ 0 ] . place_id , provider : 'GoogleMapsProvider' , raw : providerRawSuggestResponse . predictions [ 0 ] , } , ] ) ; export const providerPlaceDetailsQueryFixture = Object . freeze < PlaceDetailsQueryInterface > ( { ... placeDetailsQueryFixture , ... { placeId : providerParsedSuggestResponse [ 0 ] . placeId , } , } ) ; export const providerDistanceQueryFixture = Object . freeze < DistanceQueryInterface > ( { ... distanceQueryFixture , } ) ; export const providerRawPlaceDetailsResponse = Object . freeze ( { html_attributions : [ ] , result : { address_components : [ { long_name : '1158' , short_name : '1158' , types : [ 'street_number' ] , } , { long_name : 'East 89th Street' , short_name : 'E 89th St' , types : [ 'route' ] , } , { long_name : 'Burnside' , short_name : 'Burnside' , types : [ 'neighborhood' , 'political' ] , } , { long_name : 'Chicago' , short_name : 'Chicago' , types : [ 'locality' , 'political' ] , } , { long_name : 'Cook County' , short_name : 'Cook County' , types : [ 'administrative_area_level_2' , 'political' ] , } , { long_name : 'Illinois' , short_name : 'IL' , types : [ 'administrative_area_level_1' , 'political' ] , } , { long_name : 'United States' , short_name : 'US' , types : [ 'country' , 'political' ] , } , { long_name : '60619' , short_name : '60619' , types : [ 'postal_code' ] , } , { long_name : '7017' , short_name : '7017' , types : [ 'postal_code_suffix' ] , } , ] , formatted_address : '1158 E 89th St, Chicago, IL 60619, USA' , geometry : { location : { lat : 41.7340226 , lng : - 87.5960578 , } , viewport : { northeast : { lat : 41.73492828029151 , lng : - 87.59470091970849 , } , southwest : { lat : 41.73223031970851 , lng : - 87.5973988802915 , } , } , } , place_id : 'EiYxMTU4IEUgODl0aCBTdCwgQ2hpY2FnbywgSUwgNjA2MTksIFVTQSIxEi8KFAoSCZ9KkOIgJg6IEYkN8yihjBnAEIYJKhQKEgkJAlVQKiYOiBHg0_ra6hq5MA' , types : [ 'street_address' ] , } , status : 'OK' , } ) ; export const providerRawDistanceResponse = Object . freeze ( { destination_addresses : [ '1084 US-46, Parsippany-Troy Hills, NJ 07054, USA' ] , origin_addresses : [ '3195 US-46, Parsippany-Troy Hills, NJ 07054, USA' ] , rows : [ { elements : [ { distance : { text : '6.1 km' , value : 6131 , } , duration : { text : '7 mins' , value : 401 , } , status : 'OK' , } , ] , } , ] , status : 'OK' , } ) ; export const providerParsedPlaceDetailsResponse = Object . freeze < LocationInterface > ( { formattedAddress : '1158 E 89th St, Chicago, IL 60619, USA' , latitude : 41.7340226 , longitude : - 87.5960578 , country : 'United States' , countryCode : 'US' , state : 'Illinois' , stateCode : 'IL' , city : 'Chicago' , postalCode : '60619' , streetName : 'East 89th Street' , houseNumber : '1158' , placeId : providerRawPlaceDetailsResponse . result . place_id , provider : 'GoogleMapsProvider' , raw : providerRawPlaceDetailsResponse . result , } ) ; export const providerParsedDistanceResponse = Object . freeze < DistanceDetailsInterface > ( { distance : 6131 , duration : 401 , provider : 'GoogleMapsProvider' , raw : providerRawDistanceResponse . rows [ 0 ] . elements [ 0 ] , } ) ;