Carregando...
function loadJS(url, location) {
var scriptTag = document.createElement('script')
scriptTag.src = url
scriptTag.crossOrigin = 'anonymous'
scriptTag.defer = true
scriptTag.async = true
location.appendChild(scriptTag)
}
function initOtabuilderWidget(storefrontId, elementId, ga4MeasurementId) {
var niaraNavVar = '_OTABUILDER_EMBEDDED_SEARCH_INIT_'
var loaded = false
var initFunction = function (initSearchForm) {
if (!loaded) {
loaded = true
initSearchForm(document.getElementById(elementId), {
storefrontId: storefrontId,
ga4MeasurementId: ga4MeasurementId,
})
}
}
if (window[niaraNavVar]) {
initFunction(window[niaraNavVar])
} else {
const listener = function (e) {
initFunction(e.detail.initSearchForm)
}
document.addEventListener('otabuilder-search-ready', listener)
}
}
initOtabuilderWidget(
'f0eb82a2-7f3f-42d8-bb7e-0a9f5b7c5b5b',
'otabuilder-widget',
null
)
loadJS(
'https://app.otabuilder.com/static/js/widget.js',
document.body
)








