PageSourceSearch

https://www.visitbatonrouge.com/dist/AddressSearch-C_8WTpsV.js

js visitbatonrouge.com collected 2026-10-02 02:57:12 UTC 3,079 bytes, 1 lines download raw bytes

1var n=Object.defineProperty;var c=(l,t,e)=>t in l?n(l,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[t]=e;var s=(l,t,e)=>c(l,typeof t!="symbol"?t+"":t,e);import{G as h}from"./GoogleMapsLoader-BItwxU3D.js";import{u as p}from"./updateStateOptions-_zvLNdKB.js";class y{constructor(){s(this,"autocomplete");s(this,"parts",{street_number:"short_name",route:"long_name",locality:"long_name",administrative_area_level_1:"short_name",country:"short_name",postal_code:"short_name"});s(this,"searchInput",document.querySelector("[data-address-search]"));s(this,"form",this.searchInput.closest("form"));s(this,"manualCheckbox",this.form.querySelector("[data-manual-address]"));s(this,"lookupGroup",this.form.querySelector("[data-lookup-group]"));s(this,"streetField",this.form.querySelector("[data-lookup-street]"));s(this,"cityField",this.form.querySelector("[data-lookup-city]"));s(this,"postcodeField",this.form.querySelector("[data-lookup-postcode]"));s(this,"stateField",this.form.querySelector("[data-lookup-state]"));s(this,"countryField",this.form.querySelector("[data-lookup-country]"));s(this,"toggleLookupFields",t=>{const e=!this.searchInput.value.length;this.form.querySelectorAll("[data-lookup-group] input, [data-lookup-group] select").forEach(o=>{o.setAttribute("tabIndex",t?"0":"-1"),o.setAttribute("aria-hidden",t?"false":"true"),e&&(o.value="")}),t?this.lookupGroup.classList.remove("is-hidden"):this.lookupGroup.classList.add("is-hidden")});s(this,"fillInAddress",()=>{const t=this.autocomplete.getPlace();if(!t||!t.address_components)return;const e={street_number:"",route:"",locality:"",administrative_area_level_1:"",country:"",postal_code:""};let a=!1;for(let o=0;o<t.address_components.length;o++){const i=t.address_components[o].types[0];if(i in this.parts){const r=i,d=t.address_components[o],u=this.parts[r];e[r]=d[u]}}if(this.streetField&&(e.street_number.length+e.route.length?this.streetField.value=e.street_number+" "+e.route:a=!0),this.cityField&&(e.locality.length?this.cityField.value=e.locality:a=!0),this.postcodeField&&(e.postal_code.length?this.postcodeField.value=e.postal_code:a=!0),this.stateField)if(e.administrative_area_level_1.length){const o=e.administrative_area_level_1=="England"?"GB":e.administrative_area_level_1;this.stateField.value=o,this.stateField.dataset.autoFilled=o}else a=!0;this.countryField&&(e.country.length?(this.countryField.value=e.country=="GB"?"UK":e.country,p(this.stateField,this.countryField.selectedOptions[0]?.dataset.id||"")):a=!0),a&&(this.manualCheckbox.checked=!0,this.toggleLookupFields(!0))});new h(t=>{this.autocomplete=new t.maps.places.Autocomplete(this.searchInput,{types:["geocode"]}),this.autocomplete.setFields(["address_component"]),this.autocomplete.addListener("place_changed",this.fillInAddress),this.searchInput.addEventListener("focus",()=>{this.searchInput.setAttribute("autocomplete","nope")}),this.manualCheckbox.checked=!1,this.toggleLookupFields(!1),this.manualCheckbox.addEventListener("change",()=>{this.toggleLookupFields(this.manualCheckbox.checked)})})}}export{y as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.