(function(){"use strict";function n(n,t){function f(n){var t=JSON.stringify(n.geometry.viewport),i,r;t||(i=n.geometry.location.lat(),r=n.geometry.location.lng(),t=JSON.stringify({north:i,south:i,east:r,west:r}));window.location.href=$("#hiddenlocationsearchurl").val()+"#?bounds="+encodeURIComponent(t)}var i=this,r,u={componentRestrictions:{country:"US"}};$(function(){$("input.phSearch").each(function(n,i){var f=mapModule.createAutocomplete(i,u);r=new google.maps.Geocoder;google.maps.event.addListener(f,"place_changed",t.searchLocation)})});t.searchLocation=function(){var n=this.getPlace&&this.getPlace();n&&n.geometry?f(n):i.response&&r.geocode($.extend({},u,{address:i.response}),function(n,t){if(t==google.maps.GeocoderStatus.OK){if(n.length===1&&n[0].formatted_address==="United States")return;f(n[0])}})}}angular.module("app.components").controller("PHQuickSearchController",n);n.$inject=["apiService","$scope"]})()