An error has occurred

{{terminalError}}

UMA PERGUNTA PARA VOCÊ: Como seria o Brasil hoje sem o jornalismo independente que denuncia, investiga e publica a verdade porque não tem compromisso com patrocinadores e governos? O Intercept está passando por mudanças profundas — perdeu fontes de recursos, mas continua fazendo jornalismo com coragem porque é apoiado por milhares de cidadãos. Continuamos reportando com qualidade e ousadia porque somos feitos por jornalistas com foco em interesse público, não por empresários. R$ 20 ou R$ 50 não parecem suficientes para mudar o país, certo? Errado! Você tem a oportunidade de fazer algo concreto hoje e nos apoiar para que o trabalho do Intercept não pare.

Faça acontecer o jornalismo que você acredita.
(function(src) { window.FLMPiano = window.FLMPiano || {}; window.FLMPiano.onLoad = function(handler) { window.FLMPiano.loadHandlers = window.FLMPiano.loadHandlers || []; window.FLMPiano.loadHandlers.push(handler); }; var script = document.createElement('script'); script.setAttribute('defer', ''); script.setAttribute('src', src); script.setAttribute('type', 'text/javascript'); document.head.appendChild(script); })('https://theintercept.com/wp-content/themes/intercept/js/flmpiano-v4.js'); (function(src) { window.TI = window.TI || {}; window.TI.onLoad = function(handler) { window.TI.loadHandlers = window.TI.loadHandlers || []; window.TI.loadHandlers.push(handler); }; var script = document.createElement('script'); script.setAttribute('data-ti-js', ''); script.setAttribute('defer', ''); script.setAttribute('src', src); script.setAttribute('type', 'text/javascript'); document.head.appendChild(script); })('https://theintercept.com/wp-content/themes/intercept/js/ti-external-v2.js'); $(function() { function parseAmount(input) { var amount; if (typeof input !== 'string' || input.length === 0) { return null; } amount = Number(input); if (isNaN(amount)) { console.error('Unable to parse amount: ' + JSON.stringify(input)); return null; } return amount; } function parseOptions(input, parseItem) { var options; if (typeof input !== 'string' || input.length === 0) { return null; } options = input .split(',') .map(function(option) { return option.trim(); }) .map(parseItem) .filter(function(item) { return item !== null; }); if (options.length === 0) { console.error('Unable to parse options: ' + JSON.stringify(input)); return null; } return options; } function parseRecurringPeriod(input) { if (typeof input !== 'string' || input.length === 0) { return null; } switch (input) { case 'one-time': return 'one-time'; case 'months': return 'months'; case 'years': return 'years'; default: console.error('Unable to parse recurring period: ' + JSON.stringify(input)); return null; } } // config var amountOptions = parseOptions('', parseAmount); var experiencePrefix = '2019_article_footer_donation_ask'; var realmSpeakingId = 'theintercept-brasil'; var source = 'web_tib_20220922_end-of-article_A'; var originatingReferrer, referrerPostId, referrerUrl; var initialRecurringPeriod = parseRecurringPeriod('months'); var recurringPeriodLabels = { 'one-time': 'One-time', 'months': 'Monthly', 'years': 'Yearly' }; var recurringPeriodOptions = parseOptions('one-time,months', parseRecurringPeriod); var amountFrequencyOrder = 'amount-frequency'; var initialMonthlyAmount = parseAmount('50'); var initialOneTimeAmount = parseAmount('200'); var monthlyAmountOptions = parseOptions('25,50,100,200', parseAmount); var oneTimeAmountOptions = parseOptions('25, 50, 100, 200', parseAmount); var locale = 'pt-BR'; var initialAmount = (initialRecurringPeriod === 'months') ? initialMonthlyAmount : initialOneTimeAmount; var bodyElement = document.querySelector('body'); var $body = $(bodyElement); var htmlElement = document.querySelector('html'); var $html = $(htmlElement); var donateButton = document.getElementById('donate'); var formElement = document.getElementById('form'); var formFieldsContainer = document.getElementById('form-fields-container'); switch (realmSpeakingId) { case 'theintercept': currency = 'USD'; break; case 'theintercept-brasil': currency = 'BRL'; break; default: throw new Error(JSON.stringify(realmSpeakingId) + ' is not a valid realm speakingId'); } function handleDonateClick() { FLMPiano.dispatchEventToParent('experience:convert', { experiencePrefix: experiencePrefix }); FLMPiano.trackGAEvent({ eventLabel: 'end-of-article ask: click' }); piano.logConversion(realmSpeakingId, 'Donate Click', 1); var amountGroups = document.getElementsByClassName('amount-button-group') for (amountGroup of amountGroups) { if (amountGroup.classList.contains('selected')) { var selectedInput = amountGroup.querySelector('input[checked="checked"]'); updateDonateUrlParams({ amount: selectedInput.value }); } } } function handleLoad() { renderFormFields(); FLMPiano.setUpResponsiveContainer('#Piano', { onResize: handleParentResize }); donateButton.addEventListener('click', handleDonateClick); formElement.addEventListener('submit', handleDonateClick); FLMPiano.waitForParams({ requirements: { customVariables: true } }).then(function(params) { originatingReferrer = params.customVariables.originatingReferrer; referrerUrl = params.url; if (typeof params.customVariables.referrer_post_id === 'string') { referrerPostId = Number(params.customVariables.referrer_post_id); if (isNaN(referrerPostId)) { referrerPostId = undefined; } } updateDonateUrlParams({ amount: initialAmount, originating_referrer: originatingReferrer, recurring_period: initialRecurringPeriod, referrer_post_id: referrerPostId, referrer_url: referrerUrl, source: source }); if (params.preview) { $html.addClass('extraSmall'); $html.addClass('sized'); } $html.addClass('loaded'); }); TI.tracking.parsely.insert(); } function handleParentResize() { $html.addClass('sized'); } function renderGroupAmount(amount, amountOptions, groupLabel, recurringPeriod) { var amountGroup = FLMPiano.dom.renderElement('div', { className: 'button-group amount-button-group ' + groupLabel + (groupLabel === recurringPeriod ? ' selected' : ''), role: 'group', 'aria-label': 'Select donation amount' }); for (amountOption of amountOptions) { var amountInput = FLMPiano.dom.renderElement('input', { name: 'amount', type: 'radio', value: String(amountOption) }); var amountButton = FLMPiano.dom.renderElement( 'label', { className: 'button' }, amountInput, locale === 'pt-BR' ? 'R$ ' + String(amountOption) : '$' + String(amountOption) ); if (amount === amountOption) { amountInput.setAttribute('checked', 'checked'); amountButton.setAttribute('class', 'button selected'); } amountButton.addEventListener('click', function(event) { var amountButtons = amountGroup.querySelectorAll('.amount-button-group .button'); var selectedInput = event.target; var selectedAmount = Number(selectedInput.value); var amountButton, amountInput, index; for (index = 0; index < amountButtons.length; index ++) { amountButton = amountButtons.item(index); amountInput = amountButton.querySelector('input'); if (Number(amountInput.value) === selectedAmount) { amountInput.setAttribute('checked', 'checked'); amountButton.setAttribute('class', 'button selected'); updateDonateUrlParams({ amount: selectedAmount }); } else { amountInput.setAttribute('checked', undefined); amountButton.setAttribute('class', 'button'); } } }); amountGroup.appendChild(amountButton); } return amountGroup; } function renderRecurringPeriodsGroup(recurringPeriodsOptions) { var index; var recurringPeriodsGroup = FLMPiano.dom.renderElement('div', { className: 'button-group recurring-period-button-group', role: 'group', 'aria-label': 'Select recurring period' }); for (index = 0; index < recurringPeriodOptions.length; index ++) { var recurringPeriodInput = FLMPiano.dom.renderElement('input', { name: 'recurring_period', type: 'radio', value: recurringPeriodOptions[index] }); var recurringPeriodOption = recurringPeriodOptions[index] var recurringPeriodLabel = recurringPeriodLabels[recurringPeriodOption] if (locale === 'pt-BR') { if (recurringPeriodOption === 'one-time') { recurringPeriodLabel = 'Única' } if (recurringPeriodOption === 'months') { recurringPeriodLabel = 'Mensal' } } var recurringPeriodButton = FLMPiano.dom.renderElement( 'label', { className: 'button' }, recurringPeriodInput, recurringPeriodLabel ); if (initialRecurringPeriod === recurringPeriodOptions[index]) { recurringPeriodInput.setAttribute('checked', 'checked'); recurringPeriodButton.setAttribute('class', 'button selected'); } recurringPeriodButton.addEventListener('change', function(event) { var recurringPeriodButtons = recurringPeriodsGroup.querySelectorAll('.recurring-period-button-group .button'); var selectedInput = event.target; var selectedRecurringPeriod = selectedInput.value; var index, recurringPeriodButton, recurringPeriodInput, selectedAmount; var amountGroups = document.getElementsByClassName('amount-button-group'); for (amountGroup of amountGroups) { amountGroup.classList.remove('selected'); if (amountGroup.classList.contains(selectedInput.value)) { amountGroup.classList.add('selected'); selectedAmount = Number(amountGroup.querySelector('.button.selected input').value); } } for (index = 0; index < recurringPeriodButtons.length; index ++) { recurringPeriodButton = recurringPeriodButtons.item(index); recurringPeriodInput = recurringPeriodButton.querySelector('input'); if (recurringPeriodInput.value === selectedRecurringPeriod) { recurringPeriodInput.setAttribute('checked', 'checked'); recurringPeriodButton.setAttribute('class', 'button selected'); } else { recurringPeriodInput.setAttribute('checked', undefined); recurringPeriodButton.setAttribute('class', 'button'); } } updateDonateUrlParams({ amount: selectedAmount, recurring_period: selectedRecurringPeriod }); }); recurringPeriodsGroup.appendChild(recurringPeriodButton); } return recurringPeriodsGroup; } function renderFormFields() { if ( !initialOneTimeAmount || !oneTimeAmountOptions || !initialMonthlyAmount || !monthlyAmountOptions || !initialRecurringPeriod || !recurringPeriodOptions ) { return; } if (!oneTimeAmountOptions.indexOf(initialOneTimeAmount) < 0) { console.error('"' + initialOneTimeAmount + '" is not a valid one-time-amount-selection value, it must be included in the configured amount-options to work'); initialOneTimeAmount = null; return; } if (!monthlyAmountOptions.indexOf(initialMonthlyAmount) < 0) { console.error('"' + initialMonthlyAmount + '" is not a valid monthly-amount-selection value, it must be included in the configured amount-options to work'); initialMonthlyAmount = null; return; } if (recurringPeriodOptions.indexOf(initialRecurringPeriod) < 0) { console.error('"' + initialRecurringPeriod + '" is not a valid recurring-period-selection value, it must be included in the configured recurring-period-options to work'); initialRecurringPeriod = null; return; } var amountsGroup = FLMPiano.dom.renderElement('div', { className: 'amount-button-group-items' }); amountsGroup.appendChild(renderGroupAmount( initialOneTimeAmount, oneTimeAmountOptions, 'one-time', initialRecurringPeriod )); amountsGroup.appendChild(renderGroupAmount( initialMonthlyAmount, monthlyAmountOptions, 'months', initialRecurringPeriod )); var recurringPeriodsGroup = renderRecurringPeriodsGroup(recurringPeriodOptions); var amountFrequencyGroup = [ amountsGroup, recurringPeriodsGroup ]; if (amountFrequencyOrder === 'frequency-amount') { amountFrequencyGroup = [ recurringPeriodsGroup, amountsGroup ]; } FLMPiano.dom.appendChildrenToElement(formFieldsContainer, amountFrequencyGroup); } function updateDonateUrlParams(params) { var newUrl = FLMPiano.buildUrl(donateButton.href, params); donateButton.setAttribute('href', newUrl); formElement.setAttribute('action', newUrl); } FLMPiano.onLoad(function() { TI.onLoad(function() { handleLoad(); }); }); });