{"version":3,"file":"sitejs-8ceb26734be00548b911.js","mappings":"yHAGA,IAEA,aAGI,WAAYA,EAAuBC,GAC/BC,KAAKD,aAAeA,EACpB,IAAME,EAAOD,KAEbF,EAAcI,OAAM,WACZC,UAAUC,aACVD,UAAUC,YAAYC,oBAClB,SAACC,GAAUL,EAAKM,QAAQD,MACxB,WAAQL,EAAKO,cA4BjC,OAvBI,YAAAD,QAAA,SAAQE,GACJ,IAAMR,EAAOD,KAETU,EAAS,CAAEC,IAAKF,EAASG,OAAOC,SAAUC,IAAKL,EAASG,OAAOG,YAClD,IAAIC,OAAOC,KAAKC,UAExBC,QAAQ,CAAE,SAAYT,IAAU,SAAUU,EAASC,GACzC,OAAXA,EACID,EAAQ,GACRnB,EAAKF,aAAauB,IAAIF,EAAQ,GAAGG,mBAEjCC,OAAOC,MAAM,oBAGjBD,OAAOC,MAAM,2BAA6BJ,OAMtD,YAAAb,MAAA,WACIgB,OAAOC,MAAM,2CAErB,EAvCA,GAAa,EAAAC,cAAAA,ICJTC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,IAOV,OAHAE,EAAoBL,GAAUI,EAAQA,EAAOD,QAASJ,GAG/CK,EAAOD,Q,+FCrBf,aAAQ,+EAAAN,kB","sources":["webpack://natpia/./assets/js/site/geocodebutton.ts","webpack://natpia/webpack/bootstrap","webpack://natpia/./assets/js/site.ts"],"sourcesContent":["import { } from \"googlemaps\";\r\nimport * as $ from 'jquery';\r\n\r\nconst mapsapikey = \"AIzaSyBA-3HMmiI5WK9o3k6jB1I5j7_jX1ZV-uY\";\r\n\r\nexport class GeocodeButton {\r\n $targetfield: JQuery;\r\n\r\n constructor($searchbutton: JQuery, $targetfield: JQuery) {\r\n this.$targetfield = $targetfield;\r\n const self = this;\r\n\r\n $searchbutton.click(function () {\r\n if (navigator.geolocation) {\r\n navigator.geolocation.getCurrentPosition(\r\n (pos) => { self.success(pos); },\r\n () => { self.error() });\r\n }\r\n })\r\n }\r\n\r\n success(position) {\r\n const self = this;\r\n //console.log(\"Got position\", position.coords);\r\n var latlng = { lat: position.coords.latitude, lng: position.coords.longitude };\r\n const geocoder = new google.maps.Geocoder();\r\n\r\n geocoder.geocode({ 'location': latlng }, function (results, status) {\r\n if (status === 'OK') {\r\n if (results[0]) {\r\n self.$targetfield.val(results[0].formatted_address);\r\n } else {\r\n window.alert('No results found');\r\n }\r\n } else {\r\n window.alert('Geocoder failed due to: ' + status);\r\n }\r\n });\r\n\r\n }\r\n\r\n error() {\r\n window.alert(\"We are unable to lookup your position.\");\r\n }\r\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","export {GeocodeButton} from \"./site/geocodebutton\";\r\n"],"names":["$searchbutton","$targetfield","this","self","click","navigator","geolocation","getCurrentPosition","pos","success","error","position","latlng","lat","coords","latitude","lng","longitude","google","maps","Geocoder","geocode","results","status","val","formatted_address","window","alert","GeocodeButton","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__"],"sourceRoot":""}