{"ast":null,"code":"import React from 'react';\nimport Card from '../../../UIView/Antd/Card/Card';\nexport const MapDataHelper = infoValue => {\n  const tempMapObj = {};\n  const tempMapArray = [];\n\n  if (infoValue && infoValue.length !== 0) {\n    infoValue.map(({\n      place_id,\n      address_components,\n      formatted_address,\n      geometry: {\n        location\n      }\n    }) => {\n      let id = '';\n      let lat = '';\n      let lng = '';\n      let formattedAddress = '';\n      let city = '';\n      let state_long = '';\n      let state_short = '';\n      let zipcode = '';\n      let country_long = '';\n      let country_short = '';\n      id = place_id;\n      lat = location.lat();\n      lng = location.lng();\n      formattedAddress = formatted_address;\n\n      if (address_components) {\n        for (let i = 0; i < address_components.length; i++) {\n          if (address_components[i].types.length) {\n            switch (address_components[i].types[0]) {\n              case 'locality':\n                city = address_components[i].long_name;\n                break;\n\n              case 'administrative_area_level_1':\n                state_long = address_components[i].long_name;\n                state_short = address_components[i].short_name;\n                break;\n\n              case 'country':\n                country_long = address_components[i].long_name;\n                country_short = address_components[i].short_name;\n                break;\n\n              case 'postal_code':\n                zipcode = address_components[i].long_name;\n                break;\n\n              default:\n                break;\n            }\n          }\n        }\n      }\n\n      tempMapObj.id = place_id;\n      tempMapObj.lat = lat;\n      tempMapObj.lng = lng;\n      tempMapObj.formattedAddress = formattedAddress;\n      tempMapObj.city = city;\n      tempMapObj.state_short = state_short;\n      tempMapObj.state_long = state_long;\n      tempMapObj.zipcode = zipcode;\n      tempMapObj.country_short = country_short;\n      tempMapObj.country_long = country_long;\n      tempMapArray.push(tempMapObj);\n    });\n  }\n\n  return tempMapArray;\n};\n\nconst MapLocationBox = props => {\n  const {\n    infoValue\n  } = props;\n  const tempMapArray = MapDataHelper(infoValue);\n  return React.createElement(\"div\", {\n    className: \"hotel-form-location\"\n  }, tempMapArray && tempMapArray.length !== 0 && tempMapArray.map((single, id) => {\n    return React.createElement(\"div\", {\n      key: id\n    }, React.createElement(Card, {\n      title: \"Hotel Location\",\n      bordered: false\n    }, React.createElement(\"p\", null, React.createElement(\"strong\", null, \"Formatted Address :\"), React.createElement(\"span\", null, single && single.formattedAddress)), React.createElement(\"p\", null, React.createElement(\"strong\", null, \"ZipCode :\"), React.createElement(\"span\", null, single && single.zipcode)), React.createElement(\"p\", null, React.createElement(\"strong\", null, \"City :\"), React.createElement(\"span\", null, single && single.city)), React.createElement(\"p\", null, React.createElement(\"strong\", null, \"State Long :\"), React.createElement(\"span\", null, single && single.state_long)), React.createElement(\"p\", null, React.createElement(\"strong\", null, \"State Short:\"), React.createElement(\"span\", null, single && single.state_short)), React.createElement(\"p\", null, React.createElement(\"strong\", null, \"Country Long :\"), React.createElement(\"span\", null, single && single.country_long)), React.createElement(\"p\", null, React.createElement(\"strong\", null, \"Country Short:\"), React.createElement(\"span\", null, single && single.country_short)), React.createElement(\"p\", null, React.createElement(\"strong\", null, \"Lattitude :\"), React.createElement(\"span\", null, single && single.lat)), React.createElement(\"p\", null, React.createElement(\"strong\", null, \"Longitude :\"), React.createElement(\"span\", null, single && single.lng))));\n  }));\n};\n\nexport default MapLocationBox;","map":null,"metadata":{},"sourceType":"module"}