1document.addEventListener("DOMContentLoaded",function(){var widgetContainers=document.querySelectorAll(".affiliate-signup");function showError(shadow){var initialViewElement=shadow.querySelector("#initial-view"),initialViewElement=(initialViewElement&&(initialViewElement.style.display="none"),shadow.querySelector("#error-view"));initialViewElement&&(initialViewElement.style.display="block")}function handleShadowReady(){widgetContainers.forEach(function(widgetContainer){widgetContainer.shadowRoot&&!widgetContainer.shadowReadyDispatched&&(widgetContainer.shadowReadyDispatched=!0)})}widgetContainers.forEach(function(widgetContainer){widgetContainer.shadowReadyDispatched=!1,(widgetContainer=>{widgetContainer.shadowRoot||((shadow,widgetContainer)=>{fetch(affiliateWidgetParams.cssUrl).then(function(res){return res.text()}).then(function(css){var style=document.createElement("style"),css=(style.textContent=css,shadow.appendChild(style),document.createElement("div"));css.innerHTML=affiliateWidgetParams.widgetHtml,shadow.appendChild(css),(shadow=>{var formInsideShadow=shadow.querySelector("form");formInsideShadow&&formInsideShadow.addEventListener("submit",function(e){e.preventDefault();e=shadow.querySelector("#signup-affiliate");e&&((ctaButtonInsideShadow=>{var svgSpinner=ctaButtonInsideShadow.querySelector("svg"),originalButtonText=ctaButtonInsideShadow.querySelector("#originalButtonText"),processingText=ctaButtonInsideShadow.querySelector("#processingText");svgSpinner&&svgSpinner.removeAttribute("hidden"),processingText&&processingText.removeAttribute("hidden"),originalButtonText&&originalButtonText.setAttribute("hidden",!0),ctaButtonInsideShadow.disabled=!0,ctaButtonInsideShadow.classList.add("cursor-not-allowed")})(e),(shadow=>{var formInsideShadow=shadow.querySelector("form"),formInsideShadow=new FormData(formInsideShadow),orderKey=new URLSearchParams(window.location.search).get("key");formInsideShadow.append("action","affiliate_signup"),formInsideShadow.append("order_key",orderKey),fetch(affiliateWidgetParams.ajaxUrl,{method:"POST",body:formInsideShadow}).then(function(response){if(response.ok)return response.json();throw showError(shadow),new Error("Network response was not ok.")}).then(function(data){data.success?((response,shadowRoot)=>{var confirmationView,shadow,copyLinkButton;shadowRoot?(response&&response.data&&response.data.affiliate_link?((confirmationView=shadowRoot.querySelector("#confirmation-view"))&&(confirmationView.innerHTML=confirmationView.innerHTML.replace("{affiliateLink}",response.data.affiliate_link),confirmationView.style.display="block"),(confirmationView=shadowRoot.querySelector("#initial-view"))&&(confirmationView.style.display="none")):console.error("The affiliate_link is not available in the response data:",response),(copyLinkButton=(shadow=shadowRoot).querySelector("#copyLinkButton"))&©LinkButton.addEventListener("click",function(){(affiliateLinkInput=shadow.querySelector("#affiliateLink"))&&(affiliateLink=affiliateLinkInput.value,navigator.clipboard.writeText(affiliateLink).then(function(){affiliateLinkInput.select()}).catch(function(error){console.error("Copy failed",error)}));var affiliateLink,affiliateLinkInput,originalText=copyLinkButton.textContent;copyLinkButton.textContent=affiliateWidgetParams.data.button_copied_text,setTimeout(function(){copyLinkButton.textContent=originalText},3e3)})):console.error("shadowRoot is undefined in showConfirmation")})(data,shadow):showError(shadow)}).catch(function(error){console.error("Error during registration:",error),showError(shadow)})})(shadow))})})(shadow)}).then(function(){widgetContainer.shadowReadyDispatched||(window.dispatchEvent(new Event("shadowReady")),widgetContainer.shadowReadyDispatched=!0)})})(widgetContainer.attachShadow({mode:"open"}),widgetContainer)})(widgetContainer)}),widgetContainers.forEach(function(widgetContainer){widgetContainer.shadowReadyDispatched?handleShadowReady():window.addEventListener("shadowReady",handleShadowReady)})});
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.