The variant ${selectString} is a preorder and is ${preOrderNote.innerText.replace("*","")}
`:atc.classList.contains("bis-cta")&&(announcement+=`The variant ${selectString} isn't in stock, but you can sign up for the waitlist.
`),announcement.length>0&&(document.getElementById("screen-announcements").innerHTML=announcement);const priceContainer=document.getElementById("product-price");if(comparePrice=Number(comparePrice),price=Number(price),document.querySelector(".personalization-fieldset-container")&&!document.querySelector(".size-dropdown")?.getAttribute("value")){const selectedPersonalization=getVariantOptionValue(".personalization-input",!0),selectedColor=getVariantOptionValue(".standard-color-radios input",!1),firstVariant=document.querySelector(`.variant-select [data-title*="${selectedColor} / ${selectedPersonalization}"]`);firstVariant&&(comparePrice=Number(firstVariant.dataset.compareprice),price=Number(firstVariant.dataset.price))}if(price)if(price>comparePrice&&comparePrice>0){const originalPrice=price%100>0?(price/100).toFixed(2):price/100,salePrice=comparePrice%100>0?(comparePrice/100).toFixed(2):comparePrice/100;priceContainer.innerHTML=` $${originalPrice} $${salePrice} `}else{if(radio&&radio.dataset.handle=="swatch"&&setSwatchPricePDP(price,priceContainer,"swatch"),radio&&radio.dataset.handle==="digital-gift-card"){const newPriceElement=priceContainer.cloneNode(!0),formatPrice=priceToFormat=>`$${(priceToFormat/100).toFixed(priceToFormat%100>0?2:0)}`;newPriceElement.innerHTML=formatPrice(price),priceContainer.replaceWith(newPriceElement)}personalizationSelectors?.length&&status!=="unavailable"&&(priceContainer.innerHTML=`$${price%100>0?(price/100).toFixed(2):price/100}`)}const personalizationModal=document.getElementById("personalizer-container");setSelectedSizeImage(),updateCTAs(status,null,radio),resetProductGalleryImages(status);const adminPreviewBtn=document.querySelector(".preview-modal-btn.admin-only");if(adminPreviewBtn&&adminPreviewBtn.addEventListener("click",window.renderPersonalizationModal),personalizationModal&&status!=="unavailable"&&status!=="waitlist")if(selectionArray.includes("PERSONALIZED")||selectionArray.includes("FREE PERSONALIZATION")){personalizationModal.style.display="block",document.querySelectorAll(".personalization-radio").forEach(radio2=>{radio2.disabled=!1});const openPersonalizationModal=()=>{addToCartButton.innerText="PERSONALIZE IT",addToCartButton.removeEventListener("click",atcClick),addToCartButton.addEventListener("click",window.renderPersonalizationModal)};sizeRadios.length?isSizeSelected&&openPersonalizationModal():openPersonalizationModal()}else personalizationModal.style.display="none",document.querySelectorAll(".personalization-radio").forEach(radio2=>{radio2.disabled=!0}),addToCartButton.removeEventListener("click",window.renderPersonalizationModal),addToCartButton.removeEventListener("click",atcClick),addToCartButton.addEventListener("click",atcClick);else personalizationModal&&addToCartButton.removeEventListener("click",window.renderPersonalizationModal),addToCartButton.removeEventListener("click",atcClick),addToCartButton.addEventListener("click",atcClick);document.getElementById("bis-confirmation-message").style.display="none",document.getElementById("bis-form-area").style.display="block",document.getElementById("bis-email").value="",document.getElementById("bis-email").classList.remove("invalid-input"),sizeRadios.length&&(radio.value&&radio.value==="PERSONALIZED"||radio.value&&radio.value==="FREE PERSONALIZATION")&&(isSizeSelected&&(status==="unavailable"?(addToCartButton.innerText="OUT OF STOCK",personalizationSelectors&&personalizationSelectors.forEach(selector=>{selector.disabled=!0})):status==="waitlist"?addToCartButton.innerText="ADD ME TO THE WAITLIST":addToCartButton.innerText="PERSONALIZE IT"),changeCtaTextForMtoAndPreorder(),swapHex());const selectedVariant=getSelectedVariantElement();selectedVariant&&generateBackInStockModalData(selectedVariant)},getSwatchUpsells=(tags,title)=>{let name=title.split("-")[1];const[rawFabric,rawColor]=name.split(" in "),fabric=rawFabric.trim(),color=rawColor.trim(),host=window.location.hostname,searchString=`product_type:"Bridesmaid Dress"+AND+tag:"${fabric}"+AND+tag:"${color}"`;fetch(`https://${host}/search?view=dictionary&type=product&q=${searchString}`).then(res=>res.text()).then(response=>{let upsells=[];try{const match=response.match(/let products = (.*)<\/script>/s);if(!match||!match[1])throw new Error("Not found 'let products ='");const rawJson=match[1].trim().replace(/[\u0000-\u001F\u007F]/g,"");upsells=JSON.parse(rawJson)}catch(err){console.error("Upsells error:",err),console.log("Partial content:",response.slice(0,300));return}const picked=shuffle(upsells.filter(u=>u.tags.includes(fabric)&&u.tags.includes(color))),upsellWrapper=document.getElementById("cross-sell-upsell-wrapper");let upsellContainer="";picked.length?(picked.forEach(upsell=>{if(upsell.available==="true"){const nameParts=upsell.title.split("-");let title2=`