(()=>{var e,t,n,o={78976(e,t,n){"use strict";const o=e=>{"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e())},r=(e,t)=>{const n=e.querySelector(`.${t.content}`);let o=[];n&&(o=[...n.children]);const r=e.querySelector(`.${t.list}`),c=e.querySelector(":scope > select, :scope > .newspack-ui__segmented-control__form-control > select");if(!r&&!c&&o.length)return void o[0].classList.add("selected");const a=r?[...r.children]:[c],s=r&&"tablist"===r.getAttribute("role"),i=t=>{if(0===o.length)return;const r=o[t];if(s)o.forEach((e,n)=>e.classList.toggle("selected",n===t));else{if(n._removedContents){for(let e=n._removedContents.length-1;e>=0;e--){const{content:t,nextSibling:o}=n._removedContents[e];o&&o.parentNode===n?n.insertBefore(t,o):n.appendChild(t)}delete n._removedContents}const e=[];o.forEach((n,o)=>{o!==t&&(e.push({content:n,nextSibling:n.nextSibling}),n.remove())}),e.length>0&&(n._removedContents=e),r.classList.add("selected")}const c=r.querySelectorAll('input[type="radio"]'),a=[...c].find(e=>e.checked);c.length&&!a&&c[0].click(),e.dispatchEvent(new CustomEvent("content-selected",{detail:r}))},l=e=>{s&&a.forEach((t,n)=>{const o=n===e;t.setAttribute("aria-selected",o?"true":"false"),t.setAttribute("tabindex",o?"0":"-1")})};a.forEach((e,t)=>{if(0!==o.length){if("SELECT"===e.tagName)return e.classList.add("selected"),i(parseInt(e.value,10)),void e.addEventListener("change",function(e){i(parseInt(e.target.value,10))});e.classList.contains("selected")&&(i(t),l(t)),e.addEventListener("click",function(){a.forEach(e=>e.classList.remove("selected")),this.classList.add("selected"),i(t),l(t)}),s&&e.addEventListener("keydown",function(e){const n=a.length-1;let o=-1;"ArrowRight"===e.key?o=t===n?0:t+1:"ArrowLeft"===e.key?o=0===t?n:t-1:"Home"===e.key?o=0:"End"===e.key&&(o=n),o<0||(e.preventDefault(),a[o].focus(),a[o].click())})}})};o(function(){[...document.querySelectorAll(".newspack-ui__segmented-control")].forEach(e=>r(e,{list:"newspack-ui__segmented-control__tabs",content:"newspack-ui__segmented-control__content"}))}),o(function(){[...document.querySelectorAll(".newspack-ui__tabs")].forEach(e=>r(e,{list:"newspack-ui__tabs__list",content:"newspack-ui__tabs__content"}))});var c=n(72397);function a(e,t){window.newspackRAS.push(n=>{"open"===t?(e._overlayId&&n.overlays.remove(e._overlayId),e._overlayId=n.overlays.add()):"closed"===t&&e._overlayId&&(n.overlays.remove(e._overlayId),e._overlayId=null)})}function s(){let e=document.querySelector(".newspack-ui");return e||(e=document.createElement("div"),e.classList.add("newspack-ui"),document.body.appendChild(e)),e}function i(e){const t=e?"newspack-ui__sr-live-assertive":"newspack-ui__sr-live-polite";let n=document.getElementById(t);return n||(n=document.createElement("div"),n.id=t,n.classList.add("screen-reader-text"),n.setAttribute("role",e?"alert":"status"),n.setAttribute("aria-live",e?"assertive":"polite"),s().appendChild(n)),n}function l(e,t=!0){e.classList.add("active");const n=e.querySelector(".newspack-ui__snackbar__content");!function(e,t){if(!e)return;const n=i(t),o=document.createElement("div");o.textContent=e,n.appendChild(o),setTimeout(()=>o.remove(),1e3)}(n?n.textContent.trim():"","error"===e.dataset.type),"false"!==e.dataset.autohide&&setTimeout(()=>{d(e,t)},8e3)}function d(e,t=!0){e.classList.remove("active"),t&&setTimeout(()=>{e.remove()},500),e.dataset.noticeId&&wp.ajax.send("newspack_ui_notice_dismissed",{data:{id:e.dataset.noticeId,nonce:e.dataset.nonce}})}window.newspackRAS=window.newspackRAS||[],(0,c.Qc)(function(){[...document.querySelectorAll(".newspack-ui__modal-container")].forEach(e=>{const t=e.querySelector(".newspack-ui__modal__content"),n=[...e.querySelectorAll(".newspack-ui__modal__close")];!function(e){"open"===e.dataset.state&&a(e,"open"),new MutationObserver(t=>{t.forEach(t=>{if("attributes"===t.type&&"data-state"===t.attributeName){const t=e.dataset.state;a(e,t),"closed"===t&&e.dispatchEvent(new CustomEvent("closeModal"))}})}).observe(e,{attributes:!0,attributeFilter:["data-state"]})}(e),n.forEach(t=>{t.addEventListener("click",t=>{t.preventDefault(),e.setAttribute("data-state","closed")})});const o=e.querySelector("form.newspack-ui__modal__content, .newspack-ui__modal__content form");o&&o.addEventListener("submit",()=>{const e=o.querySelector('button[type="submit"]');e&&(e.classList.add("newspack-ui__button--loading"),e.setAttribute("disabled","true"))}),[...e.querySelectorAll("[data-fetch]")].forEach(n=>{n.addEventListener("click",o=>{const r=JSON.parse(n.getAttribute("data-fetch"));if(r.url&&r.nonce){const c=t.querySelector(".newspack-ui__notice--error");c&&c.parentElement.removeChild(c),o.preventDefault(),n.setAttribute("disabled",!0),n.classList.add("newspack-ui__button--loading"),fetch(r.url,{method:r.method,body:JSON.stringify(r.body||{}),headers:{"X-WP-Nonce":r.nonce}}).then(async e=>{const t=await e.json();if(!e.ok||t.error)throw new Error(t.message||t.error||"An error occurred. Please try again.");return t}).then(()=>{if(r.next){const t=document.getElementById(`newspack-my-account__${r.next}`);t&&(e.setAttribute("data-state","closed"),t.setAttribute("data-state","open"))}}).catch(e=>{const n=document.createElement("div");n.textContent=e||"An error occurred.",n.classList.add("newspack-ui__notice","newspack-ui__notice--error"),n.setAttribute("role","alert"),t.insertBefore(n,t.firstChild)}).finally(()=>{n.removeAttribute("disabled"),n.classList.remove("newspack-ui__button--loading")})}})})})}),o(function(){i(!1),i(!0);const e=[...document.querySelectorAll(".newspack-ui__snackbar__item")];e.forEach(e=>{[...e.querySelectorAll("a, button")].forEach(t=>{t.addEventListener("click",()=>{d(e)})})}),requestAnimationFrame(()=>requestAnimationFrame(()=>{e.forEach(e=>{"true"===e.dataset.activeOnLoad&&l(e)})}))});const u={openNotice:l,closeNotice:d,createNotice:function(e,t="success"){let n=document.querySelector(".newspack-ui__snackbar");n||(n=document.createElement("div"),n.classList.add("newspack-ui__snackbar"),s().appendChild(n));const o=document.createElement("div");o.classList.add("newspack-ui__snackbar__item"),o.dataset.type=t,o.setAttribute("data-autohide","true");const r=window.newspackUIData?.icons?.[t];if(r){const e=document.createElement("span");e.classList.add("newspack-ui__snackbar__icon"),e.innerHTML=r,o.appendChild(e)}const c=document.createElement("div");c.classList.add("newspack-ui__snackbar__content"),c.textContent=e,o.appendChild(c),n.appendChild(o),o.offsetWidth,l(o,!0)}};n(61457),(0,c.Qc)(function(){[...document.querySelectorAll(".newspack-ui__accordion")].forEach(e=>{const t=[...e.querySelectorAll('li > input[type="radio"]')],n=()=>{t.forEach(e=>{const t=e.closest("li");e.checked?t.classList.add("active"):t.classList.remove("active")})};t.forEach(e=>{e.addEventListener("change",n)}),e.classList.contains("newspack-ui__accordion--open")&&t[0].click()})}),window.newspackUI=window.newspackUI||{},window.newspackUI.notices=u},61457(){document.addEventListener("click",e=>{const t=e.target.closest(".newspack-ui__dropdown__toggle");if(t){const e=t.closest(".newspack-ui__dropdown");if(!e)return;const n=e.querySelector(".newspack-ui__dropdown__content");if(!n)return;return document.querySelectorAll(".newspack-ui__dropdown.active").forEach(t=>{t!==e&&t.classList.remove("active")}),e.classList.toggle("active"),void(e.classList.contains("active")&&((e,t)=>{const n=e.getBoundingClientRect();n.right>window.innerWidth?(e.style.left="auto",e.style.right="0"):(e.style.removeProperty("left"),e.style.removeProperty("right"),0===e.style.length&&e.removeAttribute("style")),n.bottom>window.innerHeight?(e.style.top="auto",e.style.bottom=`${t.clientHeight+8}px`):(e.style.removeProperty("top"),e.style.removeProperty("bottom"),0===e.style.length&&e.removeAttribute("style"))})(n,t))}document.querySelectorAll(".newspack-ui__dropdown.active").forEach(t=>{t.contains(e.target)||t.classList.remove("active")})}),document.addEventListener("keydown",e=>{"Escape"===e.key&&[...document.querySelectorAll(".newspack-ui__dropdown.active")].forEach(e=>{e.classList.remove("active")})})}},r={};function c(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={id:e,loaded:!1,exports:{}};return o[e](n,n.exports,c),n.loaded=!0,n.exports}c.m=o,e=[],c.O=(t,n,o,r)=>{if(!n){var a=1/0;for(d=0;d=r)&&Object.keys(c.O).every(e=>c.O[e](n[i]))?n.splice(i--,1):(s=!1,r0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[n,o,r]},c.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return c.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,c.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var r=Object.create(null);c.r(r);var a={};t=t||[null,n({}),n([]),n(n)];for(var s=2&o&&e;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach(t=>a[t]=()=>e[t]);return a.default=()=>e,c.d(r,a),r},c.d=(e,t)=>{for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),c.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),c.j=5376,(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c.p=e})(),(()=>{var e={5376:0};c.O.j=t=>0===e[t];var t=(t,n)=>{var o,r,[a,s,i]=n,l=0;if(a.some(t=>0!==e[t])){for(o in s)c.o(s,o)&&(c.m[o]=s[o]);if(i)var d=i(c)}for(t&&t(n);lc(78976));a=c.O(a)})();