(()=>{"use strict";const e=function(e){let t=[];class n extends HTMLElement{connectedCallback(){this.blockId&&t.push(this)}get blockId(){return this.getAttribute("variations-block-id")}}return window.customElements.define("pwp-content-variations",n),e.ready=function(){!async function(){const{getBlocks:e}=PersonalizeWP,{nodeScriptReplace:n}=PersonalizeWP.utils;let o=[];for(let e of t)o.push(e.blockId);0!==o.length&&e(o,"v1/variation-blocks").then(e=>{if(!Array.isArray(e))throw"No replacements to parse";const o=[];for(let n of e){const e=t.shift();n?o.push([e,n]):e.replaceWith(...e.childNodes)}if(o.length){for(let e of o){const t=e[0].parentNode;let o=document.createElement("div");o.innerHTML=e[1],o=n(o),e[0].replaceWith(...o.childNodes);const c=new CustomEvent("PWP:parsePlaceholder",{bubbles:!0,cancelable:!0,detail:{container:t}});t.dispatchEvent(c)}document.dispatchEvent(new CustomEvent("DOMContentLoaded"));const e=new CustomEvent("PWP:parsedPlaceholders",{bubbles:!0,cancelable:!0});document.dispatchEvent(e)}}).catch(e=>{console.log(e)})}()},e.readyInit=function(){window.PersonalizeWP&&PersonalizeWP.module("content-variations",this)},e}({});var t;t=e,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{t.readyInit()},{once:!0}):t.readyInit()})();