');
}
}
function chamadaAjax_118(field, parametros, limpar) {
// Show loading state
$moduleContainer.find('.results_search').html("");
$moduleContainer.find('.search-box-container.loading').show();
$.ajax({
url: '/pt/component/ajax/?module=search_ajax&format=json&limit=4',
type: 'GET',
dataType: 'json',
data: parametros,
})
.done(function(data) {
if (data.success) {
// Make sure we have all the data before calling popularesultados
if (data.data) {
// Wait for the next tick to ensure DOM is ready
setTimeout(function() {
popularesultados_118(field, data.data, limpar);
initOwl_118();
$moduleContainer.find(".search-box-container .loading").hide();
}, 0);
}
}
})
.fail(function(jqXHR, textStatus, errorThrown) {
console.error("Falha ao obter items:", textStatus, errorThrown);
})
.always(function() {
$(field).parents('.search-box-container').find('.search-button').show();
});
}
function popularesultados_118(field, resultados, limpar) {
if (!($(field).parents('.search-box-container').find('.search-box-left').hasClass('opened'))) {
$(field).parents('.search-box-container').find('.open-search-all').click();
}
let html = '';
if (!limpar) {
html = $(field).parents('.search-box-container').find('.results_search').html();
}
let layoutHeaders = {};
// cabecalho advogados
if (resultados.adv.length > 0) {
html += '
';
$.each(resultados.ij, function(index, resultado) {
html += populaResultado_118(resultado, field);
})
}
// cabecalho areas de atuacao
if (resultados.area.length > 0) {
html += '
";
$.each(resultados.area, function(index, resultado) {
html += populaResultado_118(resultado, field);
})
}
$moduleContainer.find('.results_search').html(html);
$moduleContainer.find('.search-box-container.marea').show();
// Adiciona link "Ver todos os resultados" se houver resultados em qualquer categoria
if (resultados.adv.length > 0 || resultados.ij.length > 0 || resultados.area.length > 0) {
let verTodosHtml = '
ESG e negócios de impacto / Contencioso societário / Papel e celulose / Varejo e consumo / Telecomunicações / Construção / Química e petroquímica / M&A e private equity / Planejamento patrimonial e sucessório / Mercado de capitais / Societário
Decreto do Gás para Empregar acelera reformas no setor, ampliando competências da ANP e criando plano nacional para gestão do recurso no país.
`;
$('.inteligence-news-module .item.item-left').before(htmlContent);
$('.inteligence-news-module .item.item-right:last-child').remove();
$('.inteligence-news-module .item-image').addClass('ratio ratio-16x9 overflow-hidden');
$('.inteligence-news-module .item-image').removeAttr('style');
}
});
jQuery(document).ready(function ($) {
// Verifica se a URL atual tem um hash (#)
var hash = window.location.hash;
if (hash) {
// Pega o texto depois do #
var hashText = hash.substring(1);
// Itera sobre cada link dentro do mod-languages
$('#resiliente-flags .mod-languages a').each(function () {
var currentHref = $(this).attr('href');
// Adiciona o hash ao final do link, preservando a URL existente
var newHref = currentHref + '#' + hashText;
$(this).attr('href', newHref);
});
}
});