1function initProductDetailAccordions(t=[]){!function(e){if(e(".product-detail-accordions").length){e(".product-detail-accordions").removeClass("loading"),e(".accordion-loading-overlay").remove(),e(".product-detail-accordion .product-detail-accordion__header").off("click"),e(".product-detail-accordion .product-detail-accordion__header").on("click",(function(){e(this).toggleClass("active"),e(this).parent().find(".product-detail-accordion__body").first().slideToggle()})),t&&t.length>0&&e(".product-detail-accordion").each((function(o){if(t.includes(o)){const t=e(this).find(".product-detail-accordion__header"),o=e(this).find(".product-detail-accordion__body");t.addClass("active"),o.show()}}));const n=e("#add_installation"),i=e("#add_installation_only");e("#add_recycling"),e("#no_service");if(n.length){const a=e(".product-detail-accordion").first();e(".installation-message").remove();const r=e('<p class="installation-message" style="display: none;">We will contact you to arrange an installation date.</p>');function o(){n.is(":checked")||i.is(":checked")?(a.fadeOut(800),Swal.fire({title:"Thank you for selecting an installation service.",text:"An installation date will be confirmed by our team upon receipt of your order. Any previous selected delivery date may not be achievable; our logistics team will be in touch to arrange your installation and delivery date.",icon:"info",confirmButtonColor:"#a50034",iconColor:"#a50034",confirmButtonText:"I Understand"})):a.fadeIn()}n.closest(".product-detail-accordion__body").prepend(r),o(),e('input[name="service_option"]').off("change"),e('input[name="service_option"]').on("change",o)}}}(jQuery)}!function(t){t(document).ready((function(){let e;const o=t(".search-field"),n=t("#ajax-search-results-wrapper");n.hide(),o.on("input",(function(){const o=t(this).val().trim();clearTimeout(e),o.length<2?n.hide().empty():e=setTimeout((function(){!function(e){n.html('<div class="ajax-search-loading">Searching...</div>').show(),t.ajax({url:ajax_search_params.ajax_url,type:"POST",data:{action:"custom_ajax_search",search_term:e,nonce:ajax_search_params.nonce},success:function(t){t.success?(n.html(t.data.html),""===t.data.html.trim()&&n.html('<div class="ajax-search-no-results">No results found.</div>'),n.show()):n.html('<div class="ajax-search-error">Search error occurred.</div>').show()},error:function(){n.html('<div class="ajax-search-error">Search error occurred.</div>').show()}})}(o)}),300)})),t(".search-form").on("submit",(function(t){if(o.val().trim().length<2)return t.preventDefault(),!1})),t(document).on("click",(function(e){t(e.target).closest(".search-wrapper").length||n.hide()})),o.on("focus",(function(){n.children().length>0&&n.show()}))}))}(jQuery),jQuery(document).ready((function(t){const e={steps:{"#cfw-postcode":{contentId:"checkout-postcode-process",ajaxAction:"reload_postcode_step_content",initFunction:function(){jQuery(document.body).trigger("update_checkout"),t("#submit-checkout-postcode").on("click",(function(){const e=t("#checkout-postcode").val().trim(),o=t(".postcode-error");e?(t(this).prop("disabled",!0).text("Processing..."),o.hide(),t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"set_postcode_session",postcode:e},success:function(e){e.success?(window.location.href=window.location.href.split("#")[0]+"#cfw-delivery-date",window.location.reload()):(o.text("Failed to save postcode. Please try again.").show(),t("#submit-checkout-postcode").prop("disabled",!1).text("Continue"))},error:function(){o.text("An error occurred. Please try again.").show(),t("#submit-checkout-postcode").prop("disabled",!1).text("Continue")}})):o.text("Please enter a postcode.").show()})),t("#checkout-postcode").on("keypress",(function(e){13===e.which&&(e.preventDefault(),t("#submit-checkout-postcode").click())})),t("#checkout-postcode").on("blur change",(function(){const e=t(this).val().trim();e&&e.length>=3&&(clearTimeout(window.postcodeUpdateTimeout),window.postcodeUpdateTimeout=setTimeout((function(){t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"set_postcode_session",postcode:e},success:function(e){e.success&&e.totals_updated&&e.cart_total&&(t(".cart-subtotal .amount, .cart-subtotal .woocommerce-Price-amount").html(e.cart_subtotal),t(".order-total .amount, .order-total .woocommerce-Price-amount, .checkout-total .amount").html(e.cart_total),t(".shipping .amount, .shipping .woocommerce-Price-amount").html(e.shipping_total),t(".cfw-order-total .amount, .cfw-cart-total .amount").html(e.cart_total),t(".cfw-shipping .amount").html(e.shipping_total),console.log("Updated totals from real-time postcode input:",{subtotal:e.cart_subtotal,total:e.cart_total,shipping:e.shipping_total})),jQuery(document.body).trigger("update_checkout"),t(document.body).trigger("wc_fragment_refresh")},error:function(){jQuery(document.body).trigger("update_checkout"),t(document.body).trigger("wc_fragment_refresh")}})}),1e3))}))}},"#cfw-delivery-date":{contentId:"delivery-step-content",ajaxAction:"reload_delivery_step_content",initFunction:function(){function e(){var e=t("#selected-delivery-date").val(),o=t('a[data-tab="#cfw-product-options"]'),n=t("#selected-floor").val();if("contact-customer"===e)return o.removeClass("disabled"),void o.css({opacity:"1",cursor:"pointer","pointer-events":"auto"});e&&""!==e&&"ground"===n?(o.removeClass("disabled"),o.css({opacity:"1",cursor:"pointer","pointer-events":"auto"})):(o.addClass("disabled"),o.css({opacity:"0.5",cursor:"not-allowed","pointer-events":"none"}))}function o(){let o=t(".floor-selector-section");if(0!==o.length){var n=t("#selected-delivery-date").val();n&&""!==n&&"contact-customer"!==n&&o.length>0?o.show():o.hide(),e()}}o(),t(document).on("click",".delivery-date-option",(function(e){if(e.target===this||0===t(e.target).closest("label").length&&t.contains(this,e.target)){var n=t(this).find('input[type="radio"]');n.prop("checked",!0),t(".delivery-date-option").removeClass("selected"),t(this).addClass("selected");var i=n.val();t("#selected-delivery-date").val(i),t(".delivery-date-error").remove(),o(),t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"store_selected_delivery_date",delivery_date:i},success:function(t){},error:function(t,e,o){console.error("Error saving delivery date:",o)}})}})),t('input[name="delivery-floor"]').on("change",(function(){var o=t(this).val();
1t("#selected-floor").val(o),"other"===o?s?t(".floor-warning").html('<p style="color: #92400e; font-weight: bold;">✓ Delivery details saved. Please complete the enquiry form below to submit your order.</p>').show():t(".floor-warning").html('<p>If your delivery isn\'t to the ground floor, that\'s no problem! Please provide a few details so we can arrange the most suitable delivery option for you.</p><button type="button" class="button dark open-complex-delivery-modal" style="margin-top: 10px;">Provide Delivery Details</button>').show():t(".floor-warning").hide(),e(),t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"store_selected_floor",floor:o},success:function(t){},error:function(t,e,o){console.error("Error saving floor selection:",o)}})})),t(document).on("click",".open-complex-delivery-modal",(function(e){e.preventDefault(),t("#complex-delivery-modal").addClass("is-open")})),t(document).on("click",'a[data-tab="#cfw-product-options"]',(function(e){if(t(this).hasClass("disabled"))return e.preventDefault(),e.stopPropagation(),""===t("#selected-delivery-date").val()?0===t(".delivery-date-error").length&&t(".delivery-date-options").append('<div class="delivery-date-error" style="color: red; margin-top: 10px; font-weight: bold; padding: 10px; background-color: #ffeeee; border-radius: 5px;">Please select a delivery date before proceeding.</div>'):"other"!==t("#selected-floor").val()||s||t("#complex-delivery-modal").addClass("is-open"),!1})),function(t){const e=document.querySelector(t);if(!e)return;let o,n,i=!1;e.addEventListener("mousedown",(t=>{i=!0,e.classList.add("dragging"),o=t.pageX-e.offsetLeft,n=e.scrollLeft})),e.addEventListener("mouseleave",(()=>{i=!1,e.classList.remove("dragging")})),e.addEventListener("mouseup",(()=>{i=!1,e.classList.remove("dragging")})),e.addEventListener("mousemove",(t=>{if(!i)return;t.preventDefault();const a=1.5*(t.pageX-e.offsetLeft-o);e.scrollLeft=n-a})),e.addEventListener("touchstart",(t=>{o=t.touches[0].pageX,n=e.scrollLeft})),e.addEventListener("touchmove",(t=>{const i=1.5*(t.touches[0].pageX-o);e.scrollLeft=n-i}))}(".delivery-dates-slider");const n=document.querySelector(".delivery-dates-slider");n&&d(n)}},"#cfw-product-options":{contentId:"checkout-product-options-process",ajaxAction:"reload_product_options_step_content",initFunction:function(){function e(){t(".product-option-item").each((function(){const e=t(this).data("cart-key"),n=t('input[name="service_option['+e+']"]');n.length&&n.off("change.service-update").on("change.service-update",(function(){o()}))}))}function o(){n=!1;const e=t(".update-message");e.text("Updating options...").css("color","blue").show();const o={};t(".product-option-item").each((function(){const e=t(this).data("cart-key"),n=t('input[name="service_option['+e+']"]:checked').val();o[e]={installation:"installation"===n,installation_only:"installation_only"===n,recycling:"recycling"===n}})),t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"update_cart_services",services:o},success:function(o){if(o.success){e.text("Options updated successfully!").css("color","green").show(),o.cart_total&&(t(".cart-subtotal .amount").html(o.cart_subtotal),t(".order-total .amount").html(o.cart_total)),t(document.body).trigger("update_checkout"),t(document.body).trigger("wc_fragment_refresh");c()?(t("#installation-message").fadeIn(),t("#installation-tc-wrapper").fadeIn()):(t("#installation-message").fadeOut(),t("#installation-tc-wrapper").fadeOut()),setTimeout((function(){e.fadeOut()}),3e3)}else e.text("Failed to update options. Please try again.").css("color","red").show()},error:function(){e.text("An error occurred. Please try again.").css("color","red").show()}})}e(),t(".auto-update-service").on("change",(function(){e(),o()}))}}},spinnerHtml:'<div class="checkout-step-loading"><div class="spinner"></div><p>Loading...</p></div>'};t("head").append("\n <style>\n .checkout-step-loading {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 30px;\n text-align: center;\n }\n .checkout-step-loading .spinner {\n border: 4px solid rgba(0, 0, 0, 0.1);\n border-radius: 50%;
1\n border-top: 4px solid #3498db;\n width: 40px;\n height: 40px;\n animation: spin 1s linear infinite;\n margin-bottom: 15px;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n </style>\n "),function(){t("a[data-tab]").on("click",(function(a){const s=t(this).data("tab");return i()?(console.log("Tab clicked:",s),e.steps[s]&&(console.log("Tab clicked:",s),r(s),o=s,"#cfw-delivery-date"===s&&setTimeout((function(){const t=document.querySelector(".delivery-dates-slider");t&&(console.log("Scrolling to selected date after tab click"),d(t))}),500),t(document).trigger("checkout-step-changed",[s])),"#cfw-customer-info"===s&&!n&&c()?(a.stopPropagation(),a.stopImmediatePropagation(),"undefined"!=typeof Swal?Swal.fire({title:"Thank you for selecting an installation service.",text:"An installation date will be confirmed by our team upon receipt of your order. Any previous selected delivery date may not be achievable; our logistics team will be in touch to arrange your installation and delivery date.",confirmButtonColor:"#a50034",iconColor:"#a50034",confirmButtonText:"I Understand",icon:"question",showCancelButton:!0,cancelButtonText:"Cancel"}).then((e=>{e.isConfirmed&&(n=!0,t("a[data-tab='#cfw-customer-info']").click())})):confirm("Do you want to approve the delivery date?")&&(n=!0),!1):void 0):(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation(),!1)})),t(document).on("cfw-before-tab-change",(function(t,e){if(!i())return t.preventDefault(),!1})),t(document).on("cfw-after-tab-change",(function(t,n){e.steps[n]&&(console.log("cfw-after-tab-change event:",n),r(n),o=n,"#cfw-delivery-date"===n&&setTimeout((function(){const t=document.querySelector(".delivery-dates-slider");t&&(console.log("Scrolling to selected date after tab change event"),d(t))}),500))}));const s=a();if(s&&e.steps[s])console.log("Loading initial step:",s),r(s),o=s,"#cfw-delivery-date"===s&&setTimeout((function(){const t=document.querySelector(".delivery-dates-slider");t&&(console.log("Scrolling to selected date on initial page load"),d(t))}),800);else{console.log("No active step found, looking for visible tabs");for(const n in e.steps){const e=t(n);if(e.length&&(console.log("Found tab:",n),e.is(":visible")||"none"!==e.css("display"))){console.log("Tab is visible, loading content:",n),r(n),o=n,"#cfw-delivery-date"===n&&setTimeout((function(){const t=document.querySelector(".delivery-dates-slider");t&&(console.log("Scrolling to selected date on first visible tab"),d(t))}),800);break}}}t(document).on("click","a[data-tab]",(function(n){const a=t(this).data("tab");if(!i())return n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),!1;e.steps[a]&&(console.log("Global tab click handler:",a),r(a),o=a,"#cfw-delivery-date"===a&&setTimeout((function(){const t=document.querySelector(".delivery-dates-slider");t&&(console.log("Scrolling to selected date after global tab click"),d(t))}),500))}))}();var o=null,n=!1;function i(){const e=t("#installation-tc-wrapper"),o=t("#accept_installation_tc");if(e.length&&e.is(":visible")&&!o.is(":checked")){let o="Please accept the Installation Terms & Conditions to continue.",n="Terms & Conditions";return window.kaboodle_settings&&(o=window.kaboodle_settings.unchecked_content||o,n=window.kaboodle_settings.unchecked_title||n),"undefined"!=typeof Swal?Swal.fire({title:n,text:o,icon:"warning",confirmButtonColor:"#a50034"}):alert(o),t("html, body").animate({scrollTop:e.offset().top-100},500),!1}return!0}function a(){for(const o in e.steps)if(t(o).hasClass("active")||t(o).hasClass("cfw-active"))return o;for(const o in e.steps)if(t(o).is(":visible"))return o;const o=window.location.hash;return o&&e.steps[o]?o:null}function r(n,i=0){const a=e.steps[n],s=t(`#${a.contentId}`);if(s.hasClass("loading"))return;const c=s.html().trim();if(c&&!c.includes("Error loading content")&&!c.includes("\x3c!-- Content will be loaded via AJAX --\x3e")&&0===i)return console.log("Content already loaded for",n),void("#cfw-delivery-date"===n&&"#cfw-postcode"===o?(console.log("Reinitializing delivery step after postcode entry"),"function"==typeof a.initFunction&&(a.initFunction(),s.addClass("initialized"),setTimeout((function(){const t=document.querySelector(".delivery-dates-slider");t&&(console.log("Scrolling to selected date after postcode change"),d(t))}),300))):"function"!=typeof a.initFunction||s.hasClass("initialized")||(a.initFunction(),s.addClass("initialized")));s.addClass("loading"),s.html(e.spinnerHtml);const l=(new Date).getTime();t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:a.ajaxAction},success:function(t){if(t.success&&t.data&&t.data.html){const e=(new Date).getTime()-l,i=1e3,r=Math.max(0,i-e);setTimeout((function(){s.html(t.data.html),s.removeClass("loading"),s.addClass("initialized"),"function"==typeof a.initFunction&&a.initFunction(),"#cfw-delivery-date"===n&&setTimeout((function(){const t=document.querySelector(".delivery-dates-slider");t&&(console.log("Scrolling to selected date after content load"),d(t))}),300),o=n,console.log("Successfully loaded content for",n)}),r)}else{const e=(new Date).getTime()-l,o=Math.max(0,1e3-e);setTimeout((function(){console.error("Error loading step content:",t),s.html('<p>Error loading content. <a href="javascript:void(0)" class="reload-step-content">Click here to try again</a>.</p>'),s.removeClass("loading"),s.find(".reload-step-content").on("click",(function(){r(n,0)}))}),o)}},error:function(t,e,o){console.error("AJAX error:",o,"Status:",e);const a=(new Date).getTime()-l,c=Math.max(0,1e3-a);i<3?(console.log(`Retrying (${i+1}/3) in ${1e3*(i+1)}ms...`),setTimeout((function(){r(n,i+1)}),Math.max(1e3*(i+1),c))):setTimeout((function(){s.html('<p>Error loading content. <a href="javascript:void(0)" class="reload-step-content">Click here to try again</a>.</p>'),s.removeClass("loading"),s.find(".reload-step-content").on("click",(function(){r(n,0)}))}),c)}})}setInterval((function(){const t=a();t&&t!==o&&e.steps[t]&&(console.log("Active step changed to:",t),r(t),o=t)}),500);var s=!1;function c(){let e=!1;return t(".product-option-item").each((function(){const o=t(this).data("cart-key"),n=t('input[name="service_option['+o+']"]:checked').val();if("installation"===n||"installation_only"===n)return e=!0,!1})),e}function d(t){if(!t)return;const e=t.querySelector(".delivery-date-option.selected");if(e){const o=t.offsetWidth,n=e.offsetLeft,i=e.offsetWidth,a=n-o/2+i/2-i;t.scrollTo({left:a,behavior:"smooth"})}}t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"check_complex_delivery_status"},success:function(t){t.success&&t.data.submitted&&(s=!0)}}),function(){var e=t("#complex-delivery-modal");e.on("click",".cd-modal__close, .cd-modal__overlay",(function(){e.removeClass("is-open")}));var o=[];function n(){var n=e.find(".cd-file-upload__preview");n.empty();for(var i=0;i<o.length;i++){var a=o[i],r=t('<div class="cd-file-preview-item"></div>');if(a.type.startsWith("image/")){var s=new FileReader;!function(t){s.onload=function(e){t.prepend('<img src="'+e.target.result+'" alt="Preview">')}}(r),s.readAsDataURL(a)}else a.type.startsWith("video/")&&r.prepend('<span class="cd-file-preview-icon">🎥</span>');var c=t('<button type="button" class="cd-file-preview-remove" data-index="'+i+'">×</button>');r.append('<span class="cd-file-preview-name">'+a.name+"</span>"),r.append(c),n.append(r)}}e.on("change","#cd_delivery_media",(function(){var t=Array.from(this.files);if(o.length+t.length>5)return(a=e.find(".cd-file-upload__preview")).find(".cd-file-error").remove(),a.append('<p class="cd-file-error">Maximum 5 files allowed. You already have '+o.length+" selected.</p>"),void(this.value="");for(var i=0;i<t.length;i++){var a;if(t[i].size>52428800)return(a=e.find(".cd-file-upload__preview")).find(".cd-file-error").remove(),a.append('<p class="cd-file-error">Each file must be under 50MB. "'+t[i].name+'" is too large.</p>'),void(this.value="");o.push(t[i])}this.value="",n()})),e.on("click",".cd-file-preview-remove",(function(){var e=parseInt(t(this).data("index"),10);o.splice(e,1),n()})),e.on("submit",".cd-modal__form",(function(n){n.preventDefault();var i=t(this),a=e.find(".cd-modal__response"),r=i.find(".cd-submit-btn");r.prop("disabled",!0).text("Submitting..."),a.hide().removeClass("success error").html("");var c=new FormData(this);c.delete("delivery_media[]");for(var d=0;d<o.length;d++)c.append("delivery_media[]",o[d]);t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:c,processData:!1,contentType:!1,success:function(e){if(e.success){if(s=!0,e.data.redirect_url)return r.text("Submitted"),void(window.location.href=e.data.redirect_url);i.fadeOut((function(){a.addClass("success").html("<p>"+e.data.message+"</p>").fadeIn()})),t(".floor-warning").html('<p style="color: #92400e; font-weight: bold;">✓ Delivery details saved. Please complete the enquiry form below to submit your order.</p>');var o=t('a[data-tab="#cfw-product-options"]');o.addClass("disabled"),o.css({opacity:"0.5",cursor:"not-allowed","pointer-events":"none"})}else a.addClass("error").html("<p>"+e.data.message+"</p>").fadeIn(),r.prop("disabled",!1).text("Submit Delivery Details")},error:function(){a.addClass("error").html("<p>An error occurred. Please try again.</p>").fadeIn(),r.prop("disabled",!1).text("Submit Delivery Details")}})})),e.on("click",".cd-continue-btn",(function(){e.removeClass("is-open"),t('a[data-tab="#cfw-product-options"]').trigger("click")}))}()})),jQuery(document).ready((function(t){if(t("#delivery-date-picker").length&&void 0!==window.leadTime&&void 0!==window.days){let e=7*window.leadTime;t("#delivery-date-picker")[0]._flatpickr&&t("#delivery-date-picker")[0]._flatpickr.destroy();let o=t("#delivery-date-picker").flatpickr({inline:!0,minDate:(new Date).fp_incr(e),altFormat:"F j, Y",dateFormat:"d-m-Y",disable:[function(t){return!window.days.includes(t.getDay())}],locale:{firstDayOfWeek:1},onChange:function(e,o,n){t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"store_selected_delivery_date",delivery_date:o},success:function(t){console.log("Delivery date stored:",o)},error:function(){console.error("Failed to store delivery date")}})}});if(void 0!==window.selectedDate&&window.selectedDate){const t=window.selectedDate.split("-"),e=new Date(t[2],t[1]-1,t[0]);o.setDate(e)}}})),function(t){t(document).ready((function(){t(".wp-block-gallery.is-style-slider").each((function(){var e=t('<div class="slider-wrapper"></div>');
1t(this).children("figure").each((function(){var o=t("<div>").html(t(this).html()).attr("class",t(this).attr("class"));e.append(o),t(this).remove()})),t(this).append(e)})),t(".wp-block-gallery.is-style-slider .slider-wrapper").slick({dots:!0,centerMode:!0,centerPadding:"60px",slidesToShow:3,arrows:!0})}))}(jQuery),function(t){"use strict";let e=null,o=null,n=null,i=!1,a=null;function r(){o=t(".frequently-bought-together.desktop-only"),n=t(".product-detail-accordion__body.fbt"),0===o.length&&0===n.length||(t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"get_frequently_bought_together",product_id:AddToQuoteAjax.product_id},success:function(t){if("object"!=typeof t||null===t||void 0===t.success){if("string"==typeof t)try{var a=JSON.parse(t);return void(a.success&&a.data&&a.data.has_items&&(e=a.data.content,i=!0,c()))}catch(o){console.warn("FBT: Response was not JSON, treating as markup"),e=t,i=!0,c()}}else t.success&&(t.data.has_items?(e=t.data.content,i=!0,c()):(o.length>0&&o.remove(),n.length>0&&n.parent().remove()))},error:function(t,e,i){console.error("FBT: Error loading content:",i),o.remove(),n.remove()}}),t(window).on("resize",s))}function s(){i&&c()}function c(){const i=window.innerWidth<992?n:o;a!==i&&(a&&a.empty(),i.length>0&&(i.html(e),a=i,function(e){if("function"!=typeof woobt_init)return;e.find(".woobt-wrap").each((function(){var e=t(this);"function"==typeof woobt_check_position&&woobt_check_position(e),woobt_init(e),e.find(".woobt_variations_form").each((function(){t(this).wc_variation_form()}))})),function(){var e=t("form.variations_form");if(!e.length)return;if(parseInt(e.find("input.variation_id").val()||0)<=0)return;var o=d();if(!o)return;var n=o.find(".woobt-product-this .woobt_variations_form");if(!n.length)return;var i=!1;e.find('select[name^="attribute_"]').each((function(){var e=t(this).attr("name"),o=t(this).val(),a=n.find('select[name="'+e+'"]');a.length&&o&&(a.val(o),i=!0)})),i&&n.find('select[name^="attribute_"]').last().trigger("change")}()}(i)))}function d(){var e=AddToQuoteAjax.product_id,o=t(".woobt-wrap-"+e);return o.length?o:null}function l(e){var o=d();if(o){var n=o.find(".woobt-product-this").find(".woobt_variations_form");if(n.length){var i=t("form.variations_form");if(i.length){i.find('select[name^="attribute_"]').each((function(){var e=t(this).attr("name"),o=t(this).val(),i=n.find('select[name="'+e+'"]');i.length&&i.val(o)}));var a=n.find('select[name^="attribute_"]');a.length&&a.last().trigger("change")}}else!function(t,e){var o=e.find(".woobt-products"),n=o.find(".woobt-product-this");if(!n.length)return;var i=t.is_purchasable&&t.is_in_stock;if(i){n.attr("data-id",t.variation_id),n.attr("data-price",t.display_price),n.attr("data-regular-price",t.display_regular_price),o.attr("data-product-id",t.variation_id),e.find("input.variation_id").val(t.variation_id),t.price_html&&(n.find(".woobt-price-ori").hide(),n.find(".woobt-price-new").html(t.price_html).show());var a=e.find(".woobt-img-order-0");a.length&&a.html(t.woobt_image||a.attr("data-img"))}else n.attr("data-id",0),n.attr("data-price",0),n.attr("data-regular-price",0),o.attr("data-product-id",0),e.find("input.variation_id").val(0),n.find(".woobt-price-new").hide(),n.find(".woobt-price-ori").show();"function"==typeof woobt_init&&woobt_init(e)}(e,o)}}function u(){t(document).on("click","form.cart .single_add_to_cart_button:not(.woobt-disabled, .wpcbn-btn)",(function(e){if(t(this).closest(".woobt-wrap").length)return;const o=d();if(!o)return;const n=o.find('input[name="woobt_ids"]');if(n.length&&""!==n.val()){const t=o.find(".woobt-actions .single_add_to_cart_button");t.length&&(e.preventDefault(),t.trigger("click"))}})),t(document).on("found_variation.fbt",(function(e,o){if(i){var n=t(e.target);(n.is("form.variations_form")||n.closest("form.variations_form").length)&&(n.closest(".woobt-wrap").length||(e.stopImmediatePropagation(),l(o)))}})),t(document).on("reset_data.fbt",(function(e){if(i){var o=t(e.target);(o.is("form.variations_form")||o.closest("form.variations_form").length)&&(o.closest(".woobt-wrap").length||(e.stopImmediatePropagation(),function(){var t=d();if(t){var e=t.find(".woobt-products"),o=e.find(".woobt-product-this");if(o.length){o.attr("data-id",0),o.attr("data-price",0),o.attr("data-regular-price",0),e.attr("data-product-id",0),t.find("input.variation_id").val(0),o.find(".woobt-price-new").hide(),o.find(".woobt-price-ori").show();var n=t.find(".woobt-img-order-0");n.length&&n.html(n.attr("data-img")),"function"==typeof woobt_init&&woobt_init(t)}}}()))}}))}t(document).ready((function(){u(),r()}))}(jQuery),function(t){t(document).ready((function(){t('a[href^="#"]').on("click",(function(e){if(""!==this.hash&&this.hash.length>1){e.preventDefault();var o=t(this.hash);o.length&&t("html, body").animate({scrollTop:o.offset().top},1e3)}}))}))}(jQuery),function(t){t(document).ready((function(){t("#toggle-search").on("click",(function(e){e.preventDefault();let o=t(this);if(t(window).width()<993)return o.hasClass("search-active")?(o.removeClass("search-active"),void t(".search-wrapper .search").removeClass("shown")):(t(this).addClass("search-active"),void t(".search-wrapper .search").addClass("shown"))}));let e=t(".top-nav").height();t(window).scroll((function(){t(window).scrollTop()>200?(t(".top-nav, .desktop-nav").addClass("scrolled"),t(window).width()<993&&(t("#app").css("padding-top",e+"px"),t(".top-nav").addClass("sticky-mob visible"))):(t("#app").css("padding-top","0px"),t(".top-nav, .desktop-nav").removeClass("scrolled"),t(window).width()<993&&t(".top-nav").removeClass("sticky-mob nav-hidden visible"))})),t(document).on("click",".nav-toggle",(function(){if(t(window).width()<993){let e=t(".desktop-nav");t(this).toggleClass("active"),t("body").toggleClass("no-scroll"),e.toggleClass("active");let o=t(window).innerHeight(),n=t(".top-nav").height(),i=o-n;e.css("height",i+"px"),e.css("top",n+"px")}})),t(document).on("click",".desktop-nav > .menu >
1 ul li.has_children",(function(){t(".desktop-nav > .menu > ul li.has_children").removeClass("active"),t(this).addClass("active")})),t(document).on("mouseleave",".desktop-nav, .desktop-nav > .menu > ul li.has_children .sub-menu",(function(){t(".desktop-nav > .menu > ul li.has_children").removeClass("active")})),t(document).on("mouseover",".second-level-item",(function(){t(this).parent().find(".second-level-item").removeClass("active"),t(this).addClass("active")})),t(window).width()<993?(t(".has_children .chevron").on("click",(function(){console.log("toggle click"),t(this).toggleClass("open"),t(this).parent().children(".sub-menu").slideToggle()})),t(".left .chevron").on("click",(function(){console.log("toggle click"),t(this).toggleClass("open"),t(this).parent().parent().children(".right").slideToggle()}))):t(".desktop-nav .menu ul .has_children .sub-menu").each((function(){let e=t(this),o=0;e.css({visibility:"hidden",display:"block"}),e.find(".second-level-item .right").each((function(){let e=0;t(this).find(".col").each((function(){let o=(t(this).find(".title").outerHeight(!0)||0)+(t(this).find("ul").outerHeight(!0)||0)+(t(this).find(".bot-links").outerHeight(!0)||0);o>e&&(e=o)})),e>o&&(o=e+60)})),e.css({visibility:"",display:""}),o>0&&e.height(o)})),t(document.body).on("wc_fragments_refreshed wc_cart_button_updated",(function(){(parseInt(t("#cart-item-indicator").text(),10)||0)>0?t("#cart-item-indicator").addClass("has-items").removeClass("no-items"):t("#cart-item-indicator").addClass("no-items").removeClass("has-items")})),t(document).ready((function(){var e=parseInt(t("#cart-item-indicator").text(),10)||0;t("#cart-item-indicator").toggleClass("has-items",e>0).toggleClass("no-items",0===e)}))}))}(jQuery),jQuery(document).ready((function(t){const e=t("#postcode-modal"),o=t(".close-modal"),n=t("#submit-postcode"),i=t("#postcode-input");function a(){e.hide()}t(document).on("click",".trigger-postcode-changer",(function(t){t.preventDefault(),e.show()})),o.on("click",a),n.on("click",(function(){const e=i.val().trim();e?t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"set_postcode_session",postcode:e},success:function(o){if(o.success){if(a(),t(".trigger-postcode-changer.on-reload").length>0)return void window.location.reload();const n=o.data.postcode||e.toUpperCase();if(t(".nowrap, .postcode-text").each((function(){t(this).text().trim().match(/^[A-Z0-9\s]+$/i)&&t(this).text(n)})),t(".product-detail-accordions p, .product-detail-accordions span").each((function(){const e=t(this).html();if(e&&e.toLowerCase().includes("based on your postcode")){const o=e.replace(/(postcode\s+)<span class="nowrap">[A-Z0-9\s]+<\/span>/i,'$1<span class="nowrap">'+n+"</span>");t(this).html(o)}})),t('.multibuy p:contains("Based on your Postcode"), .multibuy span:contains("Based on your Postcode")').each((function(){const e=t(this).html();if(e){const o=e.replace(/Postcode\s+[A-Z0-9\s]+\s+<span/,"Postcode "+n+" <span");t(this).html(o)}})),t('.delivery-step p:contains("based on your postcode")').each((function(){const e=t(this).html();if(e){const o=e.replace(/postcode\s+[A-Z0-9\s]+\s+<span/,"postcode "+n+" <span");t(this).html(o)}})),t("*:contains("+e+")").each((function(){if(0===t(this).children().length){const o=t(this).text();o&&o.trim()===e.trim()&&t(this).text(n)}})),t(".product-detail-accordions").length>0){const e="undefined"!=typeof AddToQuoteAjax&&AddToQuoteAjax.product_id?AddToQuoteAjax.product_id:t('input[name="add-to-cart"]').val()||t("button.single_add_to_cart_button").data("product_id");if(e){const o=[];t(".product-detail-accordion").each((function(e){t(this).find(".product-detail-accordion__header").hasClass("active")&&o.push(e)})),t(".product-detail-accordions").addClass("loading"),t(".product-detail-accordion__body").each((function(){const e=t(this),o=e.height();e.is(":visible")&&(e.css("min-height",o+"px"),0===e.find(".accordion-loading-overlay").length&&e.append('<div class="accordion-loading-overlay"><div class="spinner"></div></div>'))}));const n=(new Date).getTime();t(".trigger-postcode-changer").css("pointer-events","auto"),t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"reload_product_detail_accordions",product_id:e},success:function(e){if(e.success){const i=(new Date).getTime()-n,a=500,r=function(){const n=t(e.data.html);t(".product-detail-accordions").replaceWith(n),"function"==typeof initProductDetailAccordions&&initProductDetailAccordions(o),t(".trigger-postcode-changer").css("pointer-events","auto")};i<a?setTimeout(r,a-i):r()}else console.error("AJAX reload_product_detail_accordions returned success:false"),t(".product-detail-accordions").removeClass("loading"),t(".accordion-loading-overlay").remove()},error:function(e,o,n){console.error("Failed to reload product detail accordions:",n),t(".product-detail-accordions").removeClass("loading"),t(".accordion-loading-overlay").remove(),t(".trigger-postcode-changer").css("pointer-events","auto")}})}else console.error("Product ID not found for accordion reload")}else(t(".delivery-options").length>0||t(".delivery-dates").length>0)&&window.location.reload()}else alert("Failed to save postcode")},error:function(){alert("An error occurred while saving the postcode.")}}):alert("Please enter a valid postcode.")}))})),jQuery(document).ready((function(t){function e(){const e=t(".product-gallery");if(!e.length)return;if(e.find(".large-image-swiper, .thumbnails-swiper").length)return;const o=e.find(".woocommerce-product-gallery");if(!o.length)return;const n=o.find(".woocommerce-product-gallery__image");if(!n.length)return;const i=t("<div>",{class:"thumbnails-col"}
1),a=t("<div>",{class:"swiper thumbnails-swiper"}),r=t("<div>",{class:"thumbnails-button-prev thumbnail-mover-btn"}).append(t("<i>",{class:"fa-solid fa-chevron-up"})),s=t("<div>",{class:"thumbnails-button-next thumbnail-mover-btn"}).append(t("<i>",{class:"fa-solid fa-chevron-down"})),c=t("<div>",{class:"swiper-wrapper"}),d=t("<div>",{class:"swiper large-image-swiper"}),l=t("<div>",{class:"swiper-wrapper"});n.each((function(){const e=t(this),o=e.find("img").first(),n=o.attr("data-large_image")||o.attr("data-src")||o.attr("src");if(!n)return;const i=e.attr("data-thumb")||o.attr("data-thumb")||o.attr("src"),a=o.attr("alt")||"",r=e.attr("data-image_id")||o.attr("data-image_id")||e.attr("data-attachment-id")||o.attr("data-attachment-id")||"",s=t("<div>",{class:"swiper-slide","data-image_id":r});t("<img>",{src:i,"data-full":n,alt:a}).appendTo(s),s.appendTo(c);const d=t("<div>",{class:"swiper-slide slide-image","data-image_id":r}),u=t("<a>",{href:n,"data-fancybox":"product-gallery","data-thumb":i});t("<img>",{src:n,"data-full":n,alt:a}).appendTo(u),u.appendTo(d),d.appendTo(l)})),c.children().length&&l.children().length&&(a.append(r,s,c),i.append(a),d.append(l),e.empty().append(i,d))}function o(){var e=t(".product-gallery").width();e<768&&(e=768),t(window).width()>992&&(t(".large-image-swiper").height(e-150),t(".thumbnails-swiper").height(e-150)),r(),n()}function n(){let e=t(".product-main .content-col .inner .wp-block-tdwd-innerblocks");0===e.length&&(e=t(".product-main .content-col .inner > div"));let o=t(".product-main .content-mobile > div");t(window).width()<992?e.length>0&&e.detach().appendTo(t(".product-main .content-mobile")):o.length>0&&o.detach().appendTo(t(".product-main .content-col .inner"))}let i,a;function r(){if(0===t(".large-image-swiper").length||0===t(".thumbnails-swiper").length)return;if(i&&a)return i.update(),void a.update();const e=t(window).width()<992;a=new Swiper(".thumbnails-swiper",{spaceBetween:10,slidesPerView:3,direction:e?"horizontal":"vertical",watchSlidesProgress:!0,watchSlidesVisibility:!0,slideToClickedSlide:!0,allowTouchMove:!0,navigation:{nextEl:".thumbnails-button-next",prevEl:".thumbnails-button-prev"}}),i=new Swiper(".large-image-swiper",{spaceBetween:10,effect:"fade",fadeEffect:{crossFade:!0},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},thumbs:{swiper:a}})}e(),o(),window.onresize=o,n(),t(document).on("found_variation","form.variations_form",(function(n,s){if(t(".product-gallery").length&&!t(".large-image-swiper").length&&(e(),o()),i||r(),s&&i){let e=-1;if(s.image_id&&t(".large-image-swiper .swiper-slide").each((function(o){const n=t(this).attr("data-image_id");if(n&&n==s.image_id)return e=o,!1})),-1===e&&s.image&&(s.image.full_src||s.image.src)){const o=s.image.full_src||s.image.src,n=function(t){return t?t.replace(/^https?:\/\/[^\/]+/,"").split("?")[0]:""},i=n(o);t(".large-image-swiper .swiper-slide img").each((function(o){const a=t(this).attr("data-full"),r=t(this).attr("src");if(n(a)===i||n(r)===i)return e=o,!1}))}-1!==e&&i&&(i.slideTo(e,300),setTimeout((function(){i&&i.activeIndex!==e&&i.slideTo(e,0)}),100),i&&i.update(),a&&a.update())}})),t(document).on("reset_data","form.variations_form",(function(){i&&i.slideTo(0)})),t(".product-accordion .title").on("click",(function(){const e=t(this).closest(".product-accordion");e.hasClass("active")?(e.removeClass("active"),t(this).removeClass("open"),e.find(".body").removeClass("open").slideUp()):(e.addClass("active"),t(this).addClass("open"),e.find(".body").addClass("open").slideDown()),t(".group-details-wrapper").masonry({columnWidth:".group-details",gutter:20,itemSelector:".group-details"})}))})),jQuery(document).ready((function(){initProductDetailAccordions()})),function(t){t(document).ready((function(){if(t("section.trustpilot").length){var e=t(".trustpilot .trustpilot-slider");function o(){t(window).width()<992?e.hasClass("slick-initialized")||e.slick({slidesToShow:2,slidesToScroll:1,autoplay:!0,autoplaySpeed:1500,arrows:!1,dots:!1,responsive:[{breakpoint:768,settings:{slidesToShow:1}}]}):e.hasClass("slick-initialized")&&e.slick("unslick")}o(),t(window).on("resize",(function(){o()}))}t(window).width()<=992&&function(){const e=t(".product-sticky-bar-mobile"),o=t(".cart .single_add_to_cart_button:visible").first();e.length&&o.length&&(window.IntersectionObserver?new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting?(e.removeClass("is-visible"),setTimeout((()=>{e.hasClass("is-visible")||e.hide()}),300)):e.addClass("is-visible").show()}))}),{threshold:0}).observe(o[0]):t(window).on("scroll",(function(){t(window).scrollTop()>o.offset().top?e.addClass("is-visible").show():e.removeClass("is-visible").hide()})),t(".sticky-add-to-cart-btn").on("click",(function(e){e.preventDefault();const o=t(".variations_form");if(o.length){const e=o.find('input[name="variation_id"]').val();if(!e||"0"==e)return t("html, body").animate({scrollTop:o.offset().top-100},500),void Toastify({text:"Please select product options first.",duration:3e3,gravity:"bottom",position:"right",backgroundColor:"#f44336"}).showToast()}})))}()}))}(jQuery),document.addEventListener("DOMContentLoaded",(function(){const t=document.querySelector(".recently-viewed");if(!t)return;const e=t.dataset.currentProduct,o=t.dataset.nonce,n=t.dataset.ajaxUrl,i=t.querySelector(".rv-loading"),a=t.querySelector(".rv-content");t.querySelector(".rv-empty");setTimeout((function(){fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:"load_recently_viewed",nonce:o,current_product:e})}).then((t=>t.json())).then((e=>{i.style.display="none",e.success&&e.data.html&&""!==e.data.html.trim()?(a.innerHTML=e.data.html,a.style.display="block"):t.style.display="none"})).catch((e=>{console.error("Error loading recently viewed products:",e),i.style.display="none",t.style.display="none"}))}),1500)})),jQuery(document).ready((function(t){const e=t("#seen-it-cheaper-modal");t(".seen-it-cheaper-toggle").on("click",(function(){t("#sic_product_id").val(t(this).data("product_id")),t("#sic_variation_id").val(t(this).attr("data-variation_id")||""),e.addClass("is-open")})),t(".sic-modal__close, .sic-modal__overlay").on("click",(function(){e.removeClass("is-open"),t(".sic-modal__response").hide().html(""),t(".sic-modal__form").show(),t(".sic-modal__form")[0].reset(),t(".sic-file-upload__filename").text("")})),t("#sic_quote_pdf").on("change",(function(){const e=this.files[0],o=t(".sic-file-upload__filename");if(e)return"application/pdf"!==e.type?(o.text("Only PDF files are allowed.").addClass("error"),void(this.value="")):e.size>5242880?(o.text("File must be under 5MB.").addClass("error"),void(this.value="")):void o.text(e.name).removeClass("error");o.text("")})),t(".sic-modal__form").on("submit",(function(e){e.preventDefault();const o=t(this),n=t(".sic-modal__response"),i=o.find('button[type="submit"]');i.prop("disabled",!0).text("Sending..."),n.hide().removeClass("success error").html("");const a=new FormData(this),r=window.acTracking?window.acTracking.get():{referrer:document.referrer};Object.keys(r).forEach((function(t){a.append(t,r[t])})),t.ajax({url:"/wp-admin/admin-ajax.php",type:"POST",data:a,processData:!1,contentType:!1,success:function(t){t.success?o.fadeOut((function(){n.addClass("success").html(t.data.message).fadeIn()})):(n.addClass("error").html(t.data.message).fadeIn(),i.prop("disabled",!1).text("Submit"))},error:function(){n.addClass("error").html("An error occurred. Please try again.").fadeIn(),i.prop("disabled",!1).text("Submit")}})})),t("form.variations_form").on("found_variation",(function(e,o){t(".seen-it-cheaper-toggle").attr("data-variation_id",o.variation_id)})),t("form.variations_form").on("reset_data",(function(){t(".seen-it-cheaper-toggle").attr("data-variation_id","")}))})),jQuery(document).ready((function(t){function e(){let e=0;t.ajax({url:AddToQuoteAjax.ajax_url,method:"POST",data:{action:"get_multibuy_count"}
1,success:function(o){o.success&&(e=parseInt(o.data.value),console.log(e),e>0?(t("#multibuy-item-indicator").text(e).addClass("has-items").removeClass("no-items"),t("#multibuy-item-indicator-2").text(e).addClass("has-items").removeClass("no-items")):(t("#multibuy-item-indicator").text(0).addClass("no-items").removeClass("has-items"),t("#multibuy-item-indicator-2").text(0).addClass("no-items").removeClass("has-items")))}})}t(".add-to-quote").on("click",(function(o){o.preventDefault();const n=t(this).data("product-id");t.ajax({url:AddToQuoteAjax.ajax_url,method:"POST",data:{action:"add_to_quote",product_id:n},success:function(t){t.success?(Toastify({text:t.data.message,duration:3e3,destination:t.data.multibuy_url,newWindow:!0,close:!0,gravity:"bottom",position:"right",stopOnFocus:!0,style:{background:"#282E35"}}).showToast(),e()):Toastify({text:"There was an error adding the product to the multibuy quote.",duration:3e3,newWindow:!0,close:!0,gravity:"bottom",position:"right",stopOnFocus:!0,style:{background:"#8C181B"}}).showToast()}})})),t("#remove-all-btn").on("click",(function(e){e.preventDefault(),t.ajax({url:AddToQuoteAjax.ajax_url,method:"POST",data:{action:"empty_multibuy_quote"},success:function(t){t.success?window.location.reload():Toastify({text:"There was an error emptying your multibuy quote.",duration:3e3,newWindow:!0,close:!0,gravity:"bottom",position:"right",stopOnFocus:!0,style:{background:"#8C181B"}}).showToast()}})})),t(".remove-product-from-multibuy").on("click",(function(o){o.preventDefault();let n=t(this).data("product_id");t.ajax({url:AddToQuoteAjax.ajax_url,method:"POST",data:{action:"multibuy_remove_single_product",product_id:n},success:function(o){if(o.success){$number=t("#total-price-label").find("span"),$number.text("Calculating...."),t.ajax({url:AddToQuoteAjax.ajax_url,method:"POST",data:{action:"get_multibuy_price"},success:function(t){t.success?$number.text(t.data.value):$number.text("Unknown...")}}),e();let o=t(".single-multibuy-product").not(".titles");o.length>0&&o.last().fadeOut(1e3,(function(){if(t(this).remove(),0===t(".single-multibuy-product").not(".titles").length){t("#request-multibuy").fadeOut(500,(function(){t(this).remove()}));let e=5,o=document.createElement("div");o.innerText=`Redirecting in ${e} seconds...`,o.style.padding="10px",o.style.background="#282E35",o.style.color="#fff",o.style.borderRadius="5px",Toastify({node:o,duration:5e3,gravity:"bottom",position:"right",stopOnFocus:!0,style:{background:"#282E35"},close:!1}).showToast();let n=setInterval((()=>{e--,e>0?o.innerText=`Redirecting in ${e} seconds...`:(clearInterval(n),window.location.href="/shop")}),1e3)}})),Toastify({text:"This item was removed from your multibuy quote.",duration:3e3,close:!0,gravity:"bottom",position:"right",stopOnFocus:!0,style:{background:"#282E35"}}).showToast()}else Toastify({text:"There was an error removing this item from your multibuy quote.",duration:3e3,close:!0,gravity:"bottom",position:"right",stopOnFocus:!0,style:{background:"#8C181B"}}).showToast()}})})),t("#request-multibuy").on("submit",(function(e){e.preventDefault();var o=t(this).serializeArray();const n=window.acTracking?window.acTracking.get():{referrer:document.referrer};Object.keys(n).forEach((function(t){o.push({name:t,value:n[t]})}));let i={},a={};t(".single-multibuy-product").each((function(){const e=t(this).data("product"),o=t('input[name="service_option_'+e+'"]:checked').val();i[e]="installation"===o?1:0,a[e]="recycling"===o?1:0})),t.ajax({type:"POST",url:AddToQuoteAjax.ajax_url,data:{action:"submit_quote",form_data:t.param(o),installation_options:i,recycling_options:a},beforeSend:function(){},success:function(t){t.success?window.location.href=t.data.redirect_url:Swal.fire({icon:"error",title:"An Error Occurred",text:t.data.message})},error:function(t,e,o){console.error(t.responseText)}})})),t(document).on("click",".sidebar-toggle",(function(e){e.preventDefault(),t(this).toggleClass("open"),t(".sidebar").toggleClass("active")})),t(document).on("click",".close-filters",(function(e){e.preventDefault(),t(".sidebar-toggle").toggleClass("open"),t(".sidebar").toggleClass("active")})),document.addEventListener("copy",(function(t){const e=window.getSelection();if(!e.rangeCount)return;const o=e.getRangeAt(0).commonAncestorContainer.parentElement;o&&(o.classList.contains("product-sku")||o.classList.contains("product-title")||o.closest(".product-title h2")||o.closest(".woocommerce-loop-product__title a"))&&(console.log("Copied SKU:",e.toString()),Swal.fire({icon:"question",title:"Seen it cheaper?",text:"Contact us on 01636 672300 for our best price",showCancelButton:!0,confirmButtonText:"Contact us",cancelButtonText:"Close",reverseButtons:!0}).then((t=>{t.isConfirmed&&(window.location.href="/contact")})))}
1)),jQuery(document).ready((function(t){function e(e){const o=e.find(".add-to-cart-col .ajax_add_to_cart"),n=e.find("[data-one-off-select]");if(0===n.length)return void o.prop("disabled",!1).removeAttr("aria-disabled");const i=n.filter("[required]");if(0===i.length)return void o.prop("disabled",!1).removeAttr("aria-disabled");let a=!0;i.each((function(){t(this).val()||(a=!1)})),a?o.prop("disabled",!1).removeAttr("aria-disabled"):o.prop("disabled",!0).attr("aria-disabled","true")}function o(o){o.find(".multibuy-add-to-cart").each((function(){const o=t(this),n=o.find("form.cart");o.off("change.oneoff").on("change.oneoff","[data-one-off-select]",(function(){const i=t(this),a=(i.attr("id")||"").replace(/^one_off_/,"");a&&n.find('input[name="one_off_choices['+a+']"]').val(i.val()||""),e(o)})),o.find("[data-one-off-select]").each((function(){const e=t(this),o=(e.attr("id")||"").replace(/^one_off_/,"");o&&n.find('input[name="one_off_choices['+o+']"]').val(e.val()||"")})),e(o)}))}o(t(document)),t(document.body).on("wc_fragments_refreshed wc_fragment_refresh",(function(){o(t(document))})),t(".ajax_add_to_cart, .single_add_to_cart_button").on("click",(function(e){const o=t(this);e.preventDefault();const n=o.closest(".multibuy-add-to-cart"),i=n.length?n.find("form"):o.closest("form.cart");var a;if(o.hasClass("tdwd_add_to_cart"))a=o.data("product_id");else if(o.hasClass("sticky-add-to-cart-btn")||o.hasClass("single_add_to_cart_button")){const t=o.closest("form.cart"),e=t.find('input[name="variation_id"]').val();a=e&&"0"!=e?e:t.find('input[name="add-to-cart"]').val()||o.val()||o.data("product_id")}else a=i.find('input[name="add-to-cart"]').val();a||(a=t('input[name="add-to-cart"]').val());const r=t('input[name="service_option"]:checked').val(),s="installation"===r?1:0,c="installation_only"===r?1:0,d="recycling"===r?1:0,l=i.find('input[name="quantity"]').val()||1;o.prop("disabled",!0).text("Adding...");const u={},p=n.length?n:t(".one-off-options").first();p.find("[data-one-off-select]").each((function(){const e=(this.id||"").match(/^one_off_(.+)$/);e&&(u[e[1]]=t(this).val()||"")})),Object.keys(u).forEach((function(t){i.find('input[name="one_off_choices['+t+']"]').val(u[t])}));let f=!1;if(p.find("[data-one-off-select][required]").each((function(){t(this).val()||(f=!0)})),(o.hasClass("sticky-add-to-cart-btn")||o.hasClass("single_add_to_cart_button"))&&t(".variations_form").length){const e=t(".variations_form").find('input[name="variation_id"]').val();e&&"0"!=e||(f=!0)}if(f){if(o.prop("disabled",!1).text("Add to Basket"),window.Toastify){let e="Please select all required options before adding to basket.";t(".variations_form").length&&!t(".variations_form").find('input[name="variation_id"]').val()&&(e="Please select product options before adding to basket.",t("html, body").animate({scrollTop:t(".variations_form").offset().top-100},500)),Toastify({text:e,duration:3e3,gravity:"bottom",position:"right",backgroundColor:"#f44336"}).showToast()}}else t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"tdwd_custom_add_to_cart",product_id:a,quantity:l,add_installation:s,add_installation_only:c,add_recycling:d,one_off_choices:u},success:function(e){setTimeout((function(){e.success?(Toastify({text:"Added to basket.",duration:3e3,gravity:"bottom",position:"right",backgroundColor:"#4caf50",destination:e.data.basket_url}).showToast(),e.data.fragments?(t.each(e.data.fragments,(function(e,o){t(e).replaceWith(o)})),t(document.body).trigger("wc_fragments_refreshed")):t(document.body).trigger("wc_fragment_refresh")):Toastify({text:e.data.message||"Could not add product to basket.",duration:3e3,gravity:"bottom",position:"right",backgroundColor:"#f44336"}).showToast()}),700)},error:function(){Toastify({text:"Error adding to basket.",duration:3e3,gravity:"top",position:"right",backgroundColor:"#f44336"}).showToast()},complete:function(){setTimeout((function(){o.prop("disabled",!1).text(o.data("original-text")||"Add To Basket")}),1e3)}})})),t(".ajax_add_to_cart, .single_add_to_cart_button").each((function(){const e=t(this);e.data("original-text")||e.data("original-text",e.text().trim())}))})),t(document).on("click",".yml-add-to-cart",(function(e){e.preventDefault();const o=t(this),n=o.data("product_id");n&&!o.prop("disabled")&&(o.data("original-text")||o.data("original-text",o.text().trim()),o.prop("disabled",!0).text("Adding..."),t.ajax({url:AddToQuoteAjax.ajax_url,type:"POST",data:{action:"tdwd_custom_add_to_cart",product_id:n,quantity:1},success:function(e){e.success?(Toastify({text:"Added to basket.",duration:3e3,gravity:"bottom",position:"right",backgroundColor:"#4caf50",destination:e.data.basket_url}).showToast(),e.data.fragments?(t.each(e.data.fragments,(function(e,o){t(e).replaceWith(o)})),t(document.body).trigger("wc_fragments_refreshed")):t(document.body).trigger("wc_fragment_refresh")):Toastify({text:e.data&&e.data.message||"Could not add product to basket.",duration:3e3,gravity:"bottom",position:"right",backgroundColor:"#f44336"}).showToast()},error:function(){Toastify({text:"Error adding to basket.",duration:3e3,gravity:"bottom",position:"right",backgroundColor:"#f44336"}).showToast()},complete:function(){o.prop("disabled",!1).text(o.data("original-text")||"Add To Basket")}}))})),t(".woobt-checkbox").on("click",(function(){let e=t(this),o=t("#woobt-multibuy-ids").val().trim(),n=o?o.split(",").filter(
1Boolean):[];e.is(":checked")?n.includes(e.val())||n.push(e.val()):n=n.filter((t=>t!==e.val())),t("#woobt-multibuy-ids").val(n.join(",")),n.length>1?t(".wbt-add-all.multibuy-button span").text(" ("+n.length+")"):t(".wbt-add-all.multibuy-button span").text("")})),t(".wbt-add-all.multibuy-button").on("click",(function(){let o=t("#woobt-multibuy-ids").val().trim(),n=o?o.split(",").filter(Boolean):[];if(0===n.length)return void Toastify({text:"No products selected for multibuy.",duration:3e3,gravity:"bottom",position:"right",close:!0,style:{background:"#8C181B"}}).showToast();let i=[];n.forEach((function(e,o){let n=new Promise(((n,i)=>{setTimeout((()=>{t.ajax({url:AddToQuoteAjax.ajax_url,method:"POST",data:{action:"add_to_quote",product_id:e},success:function(t){n(t)},error:function(){i()}})}),300*o)}));i.push(n)})),Promise.allSettled(i).then((t=>{t.every((t=>"fulfilled"===t.status&&t.value.success))?(Toastify({text:"All products were successfully added to your multibuy quote.",duration:3e3,destination:t[0].value.data.multibuy_url,newWindow:!0,close:!0,gravity:"bottom",position:"right",stopOnFocus:!0,style:{background:"#282E35"}}).showToast(),e()):Toastify({text:"Some products could not be added to the multibuy quote.",duration:3e3,gravity:"bottom",position:"right",close:!0,style:{background:"#8C181B"}}).showToast()}))})),function(){const e=t(".multibuy-add-to-cart");if(0===e.length)return;if(window.innerWidth>992)return;if(!window.IntersectionObserver)return void console.warn("Intersection Observer not supported, sticky behavior disabled");const o=e[0];let n=e.outerHeight(),i=!1,a=!1,r=null,s=null;const c=t('<div class="multibuy-placeholder"></div>');c.css({display:"none"}),e.after(c);const d=t('<div class="multibuy-sentinel"></div>');function l(){a&&(e.removeClass("is-sticky"),c.hide(),a=!1,i=!1)}function u(){r&&r.disconnect(),s&&s.disconnect(),r=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&t.boundingClientRect.top>0?(i=!0,a||(e.addClass("is-sticky"),c.show(),a=!0)):t.isIntersecting&&i&&t.boundingClientRect.top<=0&&l()}))}),{threshold:0,rootMargin:"0px 0px 0px 0px"}),s=new IntersectionObserver((t=>{t.forEach((t=>{t.isIntersecting&&a&&l()}))}),{threshold:0,rootMargin:"50px 0px 0px 0px"}),r.observe(o),s.observe(d[0])}d.css({position:"absolute",top:"0",left:"0",width:"1px",height:"1px",visibility:"hidden",pointerEvents:"none"}),e.after(d),u(),t(window).on("resize",(function(){window.innerWidth>992?(l(),r&&r.disconnect(),s&&s.disconnect()):(n=e.outerHeight(),u())})),t(window).on("beforeunload",(function(){r&&r.disconnect(),s&&s.disconnect()}))}()})),function(){"use strict";var t="ac_attribution",e=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","gtm_debug"];function o(){var t=document.referrer||"";if(!t)return"";try{if(new URL(t).host===window.location.host)return""}catch(t){return""}return t}var n,i,a,r=(n=new URLSearchParams(window.location.search),i=function(){try{return JSON.parse(window.sessionStorage.getItem(t))||{}}catch(t){return{}}}(),a={},e.forEach((function(t){var e=n.get(t);e&&(a[t]=e)})),Object.keys(a).length&&(e.forEach((function(t){i[t]=a[t]||""})),i.landing_page=window.location.href,i.referrer=o()),i.landing_page||(i.landing_page=window.location.href,i.referrer=o()),function(e){try{window.sessionStorage.setItem(t,JSON.stringify(e))}catch(t){}}(i),i);window.acTracking={fields:e.concat(["referrer","landing_page"]),get:function(){var t=new URLSearchParams(window.location.search),e={};return window.acTracking.fields.forEach((function(o){e[o]=t.get(o)||r[o]||""})),e.referrer||(e.referrer=o()),e}}}(),function(t){t(document).ready((function(){if(t("section.trustpilot").length){var e=t(".trustpilot .trustpilot-slider");function o(){t(window).width()<992?e.hasClass("slick-initialized")||e.slick({slidesToShow:2,slidesToScroll:1,autoplay:!0,autoplaySpeed:1500,arrows:!1,dots:!1,responsive:[{breakpoint:768,settings:{slidesToShow:1}}]}):e.hasClass("slick-initialized")&&e.slick("unslick")}o(),t(window).on("resize",(function(){o()}))}}))}(jQuery); 2//# sourceMappingURL=main.js.map
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.