Artículos
Todos los artículos
(function () {
'use strict';
var normalizedPath = window.location.pathname.replace(/\/+$/, '') || '/';
var isLanding = normalizedPath === '/psicanalise';
var isCheckout = normalizedPath === '/checkout-psicanalise';
if (!isLanding && !isCheckout) return;
var TOUCH_DAYS = 90;
var TOUCH_MAX_AGE = TOUCH_DAYS * 24 * 60 * 60;
var PARAMS = ['gclid','gbraid','wbraid','utm_source','utm_medium','utm_campaign','utm_term','utm_content','keyword','campaign'];
var query = new URLSearchParams(window.location.search);
var marketing = {};
PARAMS.forEach(function (key) {
var value = query.get(key);
if (value) marketing[key] = value.slice(0, 500);
});
var touch = {
timestamp: new Date().toISOString(),
landing_page: window.location.href.slice(0, 1500),
referrer: (document.referrer || '').slice(0, 1500),
marketing: marketing,
consent: (window.__tcfapi || window.google_tag_data) ? 'signal_available' : 'not_detected'
};
function setCookie(name, value) {
document.cookie = name + '=' + encodeURIComponent(JSON.stringify(value)) + '; Path=/; Max-Age=' + TOUCH_MAX_AGE + '; SameSite=Lax; Secure';
}
if (!document.cookie.split('; ').some(function (item) { return item.indexOf('fa_first_touch=') === 0; })) {
setCookie('fa_first_touch', touch);
}
setCookie('fa_last_touch', touch);
if (!document.getElementById('fa-nonbrand-hardening-style')) {
var style = document.createElement('style');
style.id = 'fa-nonbrand-hardening-style';
style.textContent = [
'.fa-trust-box{max-width:1120px;margin:24px auto;padding:18px 20px;border:1px solid #d7dde5;border-radius:12px;background:#f7f9fc;color:#202124;font-size:15px;line-height:1.55}',
'.fa-trust-box strong{color:#101828}',
'.fa-trust-links{display:flex;flex-wrap:wrap;gap:12px;margin-top:10px}',
'.fa-trust-links a{color:#155eef;text-decoration:underline}',
'.fa-repeat-cta{text-align:center;margin:24px auto 32px}',
'.fa-repeat-cta a,.fa-mobile-cta a{display:inline-block;background:#155eef;color:#fff!important;text-decoration:none;font-weight:700;border-radius:8px;padding:14px 24px}',
'.fa-offer-total{display:block;font-weight:700;margin-top:6px}',
'.fa-mobile-cta{display:none}',
'@media(max-width:767px){body{padding-bottom:78px}.fa-mobile-cta{display:block;position:fixed;z-index:99999;left:0;right:0;bottom:0;padding:10px 14px;background:#fff;border-top:1px solid #d0d5dd;box-shadow:0 -4px 16px rgba(16,24,40,.12);text-align:center}.fa-mobile-cta a{width:100%;box-sizing:border-box}}'
].join('');
document.head.appendChild(style);
}
function leafElements() {
return Array.prototype.slice.call(document.querySelectorAll('h1,h2,h3,h4,h5,h6,p,span,strong,div,a'));
}
function replaceLeafText(pattern, replacement) {
leafElements().forEach(function (el) {
if (el.children.length === 0 && pattern.test(el.textContent || '')) {
pattern.lastIndex = 0;
el.textContent = (el.textContent || '').replace(pattern, replacement);
}
pattern.lastIndex = 0;
});
}
function anchorSection(id, pattern) {
if (document.getElementById(id)) return document.getElementById(id);
var heading = leafElements().find(function (el) {
return /^H[1-6]$/.test(el.tagName) && pattern.test((el.textContent || '').trim());
});
if (!heading) return null;
var section = heading.closest('section,.e-con,.elementor-element') || heading;
section.id = id;
return section;
}
function legalLinks() {
return '';
}
function trustHtml() {
return '' +
'Informação importante: este é um curso livre online. Não equivale a graduação, pós-graduação, diploma reconhecido pelo MEC ou licença profissional. ' +
'A Freud Academy oferece o curso; o certificado de curso livre é emitido pela American Society, organização sediada nos Estados Unidos.' +
'6x de R$89,90 — total R$539,40' +
legalLinks() +
'
';
}
function ctaHtml() {
return '';
}
function enhanceLanding() {
replaceLeafText(/certificado(?: dos EUA)? válido no Brasil/gi, 'certificado de curso livre emitido por organização sediada nos EUA');
var anchors = {
grade: anchorSection('grade', /grade|conteúdo programático|matriz curricular/i),
metodologia: anchorSection('metodologia', /metodologia|como funciona/i),
certificado: anchorSection('certificado', /certificado|certificação/i),
investimento: anchorSection('investimento', /investimento|valor|preço|inscriç/i),
faq: anchorSection('faq', /perguntas frequentes|dúvidas frequentes|faq/i)
};
leafElements().forEach(function (el) {
if (el.children.length === 0 && /6\s*x\s*(?:de\s*)?R\$?\s*89[,.]90/i.test(el.textContent || '') && !/539[,.]40/.test(el.textContent || '')) {
el.insertAdjacentHTML('afterend', 'Total R$539,40');
}
});
if (!document.querySelector('[data-fa-trust="1"]')) {
var certificateTarget = anchors.certificado || anchors.investimento || document.querySelector('main');
if (certificateTarget) certificateTarget.insertAdjacentHTML('beforeend', trustHtml());
}
['grade','metodologia','faq','investimento'].forEach(function (id) {
var section = anchors[id];
if (section && !section.querySelector('[data-fa-cta="1"]')) {
section.insertAdjacentHTML('beforeend', ctaHtml());
}
});
if (!document.querySelector('.fa-mobile-cta')) {
document.body.insertAdjacentHTML('beforeend', '');
}
}
function enhanceCheckout() {
var failureIsReal = /(?:payment|checkout|status)=(?:failed|failure|cancelled|canceled|error)/i.test(window.location.search);
leafElements().forEach(function (el) {
if (el.children.length === 0 && /pagamento não concluído/i.test(el.textContent || '') && !failureIsReal) {
el.style.display = 'none';
el.setAttribute('aria-hidden', 'true');
}
});
leafElements().forEach(function (el) {
if (el.children.length === 0 && /6\s*x\s*(?:de\s*)?R\$?\s*89[,.]90/i.test(el.textContent || '') && !/539[,.]40/.test(el.textContent || '')) {
el.insertAdjacentHTML('afterend', 'Total R$539,40');
}
});
if (!document.querySelector('[data-fa-checkout-trust="1"]')) {
var paymentLink = document.querySelector('a[href*="stripe"],a[href*="hotmart"],button[id*="stripe"],button[class*="stripe"]');
var box = document.createElement('div');
box.className = 'fa-trust-box';
box.setAttribute('data-fa-checkout-trust', '1');
box.innerHTML = 'Antes de pagar: 6x de R$89,90 — total R$539,40. Curso libre, sem equivalência a graduação, pós-graduação, diploma MEC ou licença profissional. O certificado de curso livre é emitido pela American Society, organização sediada nos EUA.' + legalLinks();
if (paymentLink && paymentLink.parentNode) paymentLink.parentNode.insertBefore(box, paymentLink);
else (document.querySelector('main') || document.body).insertBefore(box, (document.querySelector('main') || document.body).firstChild);
}
}
function enhance() {
if (isLanding) enhanceLanding();
if (isCheckout) enhanceCheckout();
}
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', enhance, { once: true });
else enhance();
// The landing page is server-rendered and only needs one enhancement pass.
// Keep a short, debounced observer exclusively for the dynamic checkout.
if (isCheckout) {
var observerTimer = 0;
var observer = new MutationObserver(function () {
window.clearTimeout(observerTimer);
observerTimer = window.setTimeout(enhance, 120);
});
observer.observe(document.documentElement, { childList: true, subtree: true });
window.setTimeout(function () {
observer.disconnect();
window.clearTimeout(observerTimer);
}, 15000);
}
})();