PageSourceSearch

https://www.dailykos.com/wp-content/themes/daily-kos-theme/build/b…/frontend.js?ver=99b329d38c06bc7a1339

js dailykos.com collected 2026-09-24 08:04:37 UTC 7,671 bytes, 5 lines download raw bytes

1(()=>{"use strict";const t=window.wp.i18n;function e(t){return{actblue_url:t.dataset.actblueUrl||"",paypal_button_id:t.dataset.paypalButtonId||"",paypal_button_image:t.dataset.paypalButtonImage||"",environment:t.dataset.environment||"sandbox",story_id:t.dataset.storyId?parseInt(t.dataset.storyId,10):null}}function n(t){const e=t.closest(".donation-ask__form");return e?e.dataset.location:"unknown"}function o(t){const e=t.querySelector('input[type="radio"]:checked');if(!e)return"5";if("other"===e.value){const e=t.querySelector(".donation-ask__other-input"),n=e?Number(e.value):0;return!Number.isFinite(n)||n<1||n>5e4?"0":Math.floor(n).toString()}return e.value}function a(t){const e=t.querySelector(".donation-ask__recurring-button.active");return e&&"true"===e.dataset.recurring?"monthly":"one-time"}function r(t){const e=parseFloat(t);return Number.isFinite(e)?Math.round(100*e):0}function i(t,e){window.dataLayer=window.dataLayer||[],window.dataLayer.push(Object.assign({event:t},e))}function d(t){const e={p_url:window.location.pathname.substring(0,80),r_url:document.referrer.substring(0,60),rf:(t.dataset.refcode||"").substring(0,60),var:t.dataset.location||"",amount:o(t),recurring:a(t)};return JSON.stringify(e).substring(0,256)}function c(n){const r=n.querySelector(".donation-button-inner"),i=o(n);r&&r.setAttribute("data-ab-amount",i);const d=n.querySelector(".donation-ask__donate-link");if(!d)return;const c=a(n),u=i&&"0"!==i?`$${i}`:"";let s;
2/* translators: %s: dollar amount, e.g. "$15" */
3s=u&&"monthly"===c?(0,t.sprintf)((0,t.__)("Donate %s monthly","daily-kos-theme"),u):u?(0,t.sprintf)((0,t.__)("Donate %s","daily-kos-theme"),u):(0,t.__)("Donate","daily-kos-theme"),d.textContent=s,
4/* translators: %s: button text, e.g. "Donate $15" */
5d.setAttribute("aria-label",(0,t.sprintf)((0,t.__)("%s via ActBlue","daily-kos-theme"),s));const l=e(n);if(l.actblue_url)try{const t=new URL(l.actblue_url);i&&"0"!==i&&t.searchParams.set("amount",i);const e=n.dataset.refcode;e&&t.searchParams.set("refcode",e),d.href=t.toString()}catch(t){"production"!==n.dataset.environment&&console.error("Donation Ask: Invalid ActBlue URL:",t)}}function u(){"undefined"!=typeof PayPal&&PayPal.Donation&&document.querySelectorAll(".paypal-donate-button-container").forEach((c,u)=>{const s=c.querySelector(".paypal-donate-button");if(!s||s.hasChildNodes())return;const l=c.closest(".donation-ask__form"),_=l?e(l):{},y=`donation-ask-paypal-${u}`;s.id=y;const f=document.createElement("input");if(f.type="hidden",f.className="donation-ask__paypal-tracking",f.value=l?d(l):"{}",c.appendChild(f),PayPal.Donation.Button({env:"production"===_.environment?"production":"sandbox",hosted_button_id:c.dataset.buttonId||_.paypal_button_id,custom:f.value,image:{src:_.paypal_button_image,alt:(0,t.__)("Donate with PayPal button","daily-kos-theme"),title:(0,t.__)("Donate with PayPal","daily-kos-theme")},onComplete(t){let o={};try{o=JSON.parse(f.value||"{}")}catch(t){}!function(t,o,a){const d=t.tx?.startsWith("I-")||!!t.subscr_id,c=a?e(a):{};i("donation_given",{donation_variant:o.var||n(a),donation_payment_method:"PayPal",donation_transaction_id:t.tx||"",donation_amount:r(t.amt),donation_currency:t.cc||"",donation_status:t.st||"",donation_recurring:d?"monthly":"one-time",donation_refcode:o.rf||"",story_id:c.story_id||null,page_url:window.location.href})}(t,o,l)}}).render(`#${y}`),s.addEventListener("click",()=>{i("donation_request_clicked",{donation_variant:n(c),donation_payment_method:"PayPal",donation_amount:r(l?o(l):0),donation_recurring:l?a(l):"",story_id:_.story_id||null,page_url:window.location.href})}),s.addEventListener("keydown",t=>{if("Enter"===t.key){t.preventDefault();const e=s.querySelector("img");e&&e.click()}}),l){const t=()=>{f.value=d(l)};l.querySelectorAll('input[type="radio"]').forEach(e=>{e.addEventListener("change",t)});const e=l.querySelector(".donation-ask__other-input");e&&e.addEventListener("input",t),l.querySelectorAll(".donation-ask__recurring-button").forEach(e=>{e.addEventListener("click",t)})}})}function s(){let t=null;window.addEventListener("blur",()=>{const e=document.activeElement;if(!e||"IFRAME"!==e.tagName)return;if(!e.src||!e.src.includes("actblue.com"))return;const n=e.closest(".donation-ask__form");n&&(t=n)}),function(t){if(window.actblue)return void t();const e=document.querySelector("script[data-ab-source]");e&&e.addEventListener("load",t,{once:!0})}(()=>{window.actblue&&window.actblue.configure({onClose(){t=null},onLanded(){const n=t,d=n?e(n):{};i("donation_request_clicked",{donation_variant:n?n.dataset.location:"unknown",donation_payment_method:"ActBlue",donation_amount:r(n?o(n):0),donation_recurring:n?a(n):"",story_id:d.story_id||null,page_url:window.location.href})},onContribute(n){const o=t,a=o?e(o):{};i("donation_given",{donation_variant:o?o.dataset.location:"unknown",donation_payment_method:"ActBlue",donation_amount:n&&n.amount||0,donation_recurring:n&&n.recurring?"monthly":"one-time",donation_order_number:n&&n.order_number||"",donation_refcode:n&&n.refcode||"",donation_email:n&&n.email||"",story_id:a.story_id||null,page_url:window.location.href})}})})}function l(){const t=document.querySelectorAll(".donation-ask__form");t.length&&(t.forEach(t=>{!function(t){const e=t.querySelectorAll(".donation-ask__recurring-button");e.forEach(n=>
5{n.addEventListener("click",()=>{e.forEach(t=>t.classList.remove("active")),n.classList.add("active");const o="true"===n.dataset.recurring,a=t.querySelector(".donation-button-inner");a&&a.setAttribute("data-ab-recurring",o.toString()),c(t)})})}(t),function(t){const e=t.querySelectorAll('input[type="radio"]'),n=t.querySelector(".donation-ask__other-input"),o=t.querySelector(".donation-ask__amounts");e.forEach(t=>{t.addEventListener("click",()=>{"other"===t.value&&n?n.focus():n&&(n.value="")})}),o&&o.addEventListener("click",()=>{requestAnimationFrame(()=>c(t))}),n&&(n.addEventListener("keydown",t=>{["e","E","+","-","."].includes(t.key)&&t.preventDefault()}),n.addEventListener("input",()=>{const e=t.querySelector('input[type="radio"][value="other"]');e&&(e.checked=!0),c(t)}),n.addEventListener("focus",()=>{const e=t.querySelector('input[type="radio"][value="other"]');e&&(e.checked=!0)}))}(t)}),function(t){if(!("IntersectionObserver"in window))return void s();let e=!1;const n=[];function o(t){t.hasAttribute("data-ab-deferred")&&(t.setAttribute("data-ab-button",""),t.removeAttribute("data-ab-deferred"))}function a(){e||(e=!0,s())}const r=new IntersectionObserver(t=>{t.forEach(t=>{if(!t.isIntersecting)return;const e=t.target,n=e.querySelector("[data-ab-deferred]");n&&o(n),a(),r.unobserve(e)})},{rootMargin:"200px"});let i=!1;t.forEach(t=>{const e=t.querySelector("[data-ab-button]");e&&(t.getBoundingClientRect().top<window.innerHeight+200?i=!0:(e.setAttribute("data-ab-deferred",""),e.removeAttribute("data-ab-button"),n.push(e),r.observe(t)))}),(i||!n.length)&&a(),window.addEventListener("load",function(){n.forEach(o),a()})}(t),function(t){if("undefined"!=typeof PayPal&&PayPal.Donation)return void t();const e=document.querySelector('script[src*="paypalobjects.com/donate/sdk"]');e&&e.addEventListener("load",t)}(u),function(){const t=document.querySelectorAll(".donation-ask__form");if(!t.length||!("IntersectionObserver"in window))return;const n=new IntersectionObserver(t=>{t.forEach(t=>{if(!t.isIntersecting)return;const o=e(t.target);i("donation_request_viewed",{donation_variant:t.target.dataset.location||"unknown",story_id:o.story_id||null,page_url:window.location.href}),n.unobserve(t.target)})},{threshold:.5});t.forEach(t=>n.observe(t))}())}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",l):l()})();

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.