(()=>{var t={950:t=>{const e=Object.freeze({MANUAL:0,AUTO:1}),o=Object.freeze({PAID:1,UNPAID:3}),n=Object.freeze({SYNCED:0,SYNCING:1,ERROR:2}),r=Object.freeze({INACTIVE:0,ACTIVE:1,PENDING:2,REJECTED:3});t.exports={CompanyOrderMarkingType:e,CompanyOrderStatus:o,CompanyOrderSyncStatus:n,CompanyAccountStatus:r}},514:t=>{const e={qb:"isEnableQB",cp:"isEnableCP",act:"isEnableAT",form:"isEnableRF",tax_exempt:"isEnableTE",amo:"isEnableOL",mc:"isEnableMC",public_api:"isEnablePA",dc:"isEnableDC",cart_note:"isEnableON",mo:"isEnableMO",tax_display:"isEnableTD",sr:"isEnableSR",bogo:"isEnableBOGO",qi:"isEnableQI",ef:"isEnableEF",pl:"isEnablePL"};t.exports={checkEnableModulesB2B:(t=[])=>{t.forEach((t=>{BSS_BCP.shopModulesB2B[e[t.code]]=Boolean(t.status)}))},shopModulesB2B:{isEnableQB:!1,isEnableCP:!1,isEnableAT:!1,isEnableRF:!1,isEnableTE:!1,isEnableOL:!1,isEnableMC:!1,isEnablePA:!1,isEnableDC:!1,isEnableON:!1,isEnableTD:!1,isEnableSR:!1,isEnableQI:!1,isEnableEF:!1,isEnablePL:!1,isEnableBOGO:!1,isEnableMO:!1}}},59:t=>{"use strict";t.exports={getAppliedRuleTd:({shopData:t={},rules:e=[]})=>{if(!BSS_BCP.shopModulesB2B.isEnableTD)return null;let o=null;const{customer:n,product_collections:r,product:a}=t;return a&&e.length?(e.forEach((t=>{if(!o&&[0,3].includes(t.apply_to_page)){const e=function(t,e={}){const{apply_to:o}=t;switch(o){case 0:return!0;case 1:return!!e.id;case 2:return!e.id;case 3:return!!e.id&&!(!t.customer_ids||-1===t.customer_ids.split(",").indexOf(e.id.toString()));case 4:if(!e.id)return!1;if(t.customer_tags){if(!e.tags)return!1;{let o=t.customer_tags.toLowerCase().split(","),n=e.tags.map((t=>t.toLowerCase())),r=o.filter((t=>-1!==n.indexOf(t)));if(r&&r.length)return!0}}return!1;default:return!1}}(t,n),c=function(t,e,o){switch(t.product_condition_type){case 0:return!0;case 1:return!(!t.product_ids||-1===t.product_ids.split(",").indexOf(e.id.toString()));case 2:if(t.product_collections){let e=t.product_collections.split(",");if(!o)return!1;{let t=o.filter((t=>-1!==e.indexOf(t.toString())));if(t&&t.length)return!0}}return!1;case 3:if(t.product_tags){if(!e.tags)return!1;{let o=t.product_tags.toLowerCase().split(","),n=e.tags.map((t=>t.toLowerCase())),r=o.filter((t=>-1!==n.indexOf(t)));if(r&&r.length)return!0}}return!1;default:return!1}}(t,a,r);e&&c&&(o=t)}})),o):null},getTaxRate:(t=[])=>{let e=parseFloat(window?.BSS_B2B?.countryTax)||0,o=!1;return"undefined"!=typeof BSS_B2B&&t.length>0&&(window.BSS_B2B.taxOverridesByCountryCode&&window.BSS_B2B.taxOverridesByCountryCode.length>0||window.BSS_B2B.taxOverridesRestOfWorld&&window.BSS_B2B.taxOverridesRestOfWorld.length>0)&&(window.BSS_B2B?.taxOverridesByCountryCode.every((n=>{for(let r=0;r{for(let n=0;n{let e="1em",o="1em";switch(t){case 0:e="2em";break;case 1:e="3em";break;case 2:e="4em";break;case 3:break;case 4:o="4em";break;case 5:o="3em";break;case 6:o="2em"}return{fontSizePriceHasVat:e,fontSizePriceNoVat:o}},checkVariantCpPlRule:({rule:t,variantId:e})=>{if(!t)return!1;let o,n=!0,r=[],a=t.discount_type,c=t.value;return"CP"===t.ruleType?(r=t.product_variants.split(","),o=4===t.product_condition_type,o&&r.length&&(n=r.some((t=>t==e)))):"PL"===t.ruleType&&(o=1===t.product_condition_type,r=t.product_variants,o&&r.length&&(n=r.some((t=>(t.variant_id==e&&(a=t.discount_type,c=t.discount_value),t.variant_id==e))))),{checkVariantPlCp:n,discountType:a,discountValue:c}}}},586:t=>{"use strict";t.exports=new class{constructor(){this.rulesChoice=[]}getList(t=[]){if(!this.rulesChoice.length&&t.length&&"undefined"!=typeof BSS_B2B)for(let e=0;e{t.exports=function(t){return 3141===t.storeId?window.location="apps/customer-portal/purchase-late":window.location="/apps/customer-portal/purchase-late"}}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,o),a.exports}(()=>{"use strict";function t(t,e,o,n){let r={method:"GET"},a=document.createElement("style"),c=document.createTextNode("\n .cart__checkout-button.button.bss-b2b-customer-portal-btn-quote-default {\n margin-top: 0px;\n }\n @media only screen and (max-width: 750px) {\n .cart__checkout-button.button.bss-b2b-customer-portal-btn-quote-default {\n margin-top: 1rem;\n }\n }\n ");a.appendChild(c),document.head.appendChild(a);let i=document.querySelectorAll(e.helper.CheckoutBtnDefaultQuery);const s=document.querySelector(".bss-bcp-customer-portal-btn-quote-default-app-block");let l=null;if(i.length)for(let t=0;t\n
\n

REQUEST FOR QUOTE NOTE

\n
\n \n

\n

\n
\n \n

\n ${n.error_message}\n

\n
\n
\n

View quote cart

\n x\n
\n \n `;window.document.body.insertAdjacentHTML("afterbegin",d);const p=function(t,o,n){let r=o.id?o.id.toString():null,a=window.localStorage.getItem("bssQuoteCart")?JSON.parse(window.localStorage.getItem("bssQuoteCart")):[],c=window.localStorage.getItem("bssListVariantQuoteCart")?JSON.parse(window.localStorage.getItem("bssListVariantQuoteCart")):[];if(window.localStorage.getItem("bssQuoteCart")||window.localStorage.setItem("bssQuoteCart",""),window.localStorage.getItem("bssListVariantQuoteCart")||window.localStorage.setItem("bssListVariantQuoteCart",""),t&&o&&r){let i={};if(a&&a.length&&c&&c.length)if(c.includes(r))for(let t=0;t{const t=await fetch("/cart.js",r).then((function(t){if(!t.ok)throw new Error("HTTP error, status = "+t.status);return t.json()})).catch((function(t){console.log("error:",t)}));if(t.items&&t.items.length>0){let o=[],n=[],a=new Map,c=new Map,i=[];t.items.forEach((function(t){let e=t.product_id;-1===n.indexOf(e)&&(n.push(e),o.push('id:"'+e+'"'),a.set(e,[]));let r=a.get(e);r.push(t.key),a.set(e,r);let s=c.get(e);s&&null!=s||(c.set(e,[]),s=[]),s.push({key:t.key,quantity:t.quantity,id:t.variant_id,price:t.price}),c.set(e,s),i.push({key:t.key,price:t.price})}));let s="/search.js?q="+o.join(" OR ")+"&view=bss.bcp";const l=encodeURI(s);let u=await fetch(l,r).then((function(t){if(!t.ok)throw new Error("HTTP error, status = "+t.status);return t.json()})).catch((function(t){console.log("No! Something error:",t)}));if(u.length>0){let o=[],n=[];for(let t=0;t{e.quote.handleCheckProductQuote(t)||r.push(t)})),r.length){let e=r.map((t=>t.title));document.querySelector(".invalid-quote-product").innerHTML=e.join(", ");let o=document.querySelector(".bss-bcp-popup.popup-validate-product-quote");o.style.display="block",document.querySelector(".bss-bcp-popup-close.popup-validate-product-quote").onclick=t=>{t.preventDefault(),o.style.display="none"},document.querySelector(".bss-view-to-quote").onclick=()=>{const e=r.map((t=>t.id));u.forEach((o=>{t.items.forEach((t=>{e.includes(o.id)||o.id!=t.product_id||p(o,t,t.quantity)}))})),window.location.href="/apps/customer-portal/r4q/quote-cart"}}else u.forEach((e=>{t.items.forEach((t=>{e.id==t.product_id&&p(e,t,t.quantity)}))})),window.location.href="/apps/customer-portal/r4q/quote-cart"}}else console.log("Could not get cart data")}}const e=(t,e)=>{let o=[];for(let n=0;nr.customer_tags.includes(t))).length&&o.push(r)}return o},n=(t,e,o,n)=>{let r=[];for(let a=0;ac.product_collections.includes(t+""))).length&&r.push(c),3===i&&n.length&&c.product_tags.length&&n.filter((t=>c.product_tags.includes(t))).length&&r.push(c)}return r};function r(t,e,o,n,r,a=[]){let c=null,i=[],s=[],l=new Map,u=document.createElement("style");u.type="text/css",u.innerText="\n .card__heading a:after{\n bottom:200px !important;\n }\n .isolate{\n z-index: initial; \n }\n .bss-quote-modal-content{\n color: black !important;\n }\n ",document.head.appendChild(u);let d=[];const p=function(t,o,n,a,c,i){t.style.display="block",c=c?c.toString():null;let s=window.localStorage.getItem("bssQuoteCart")?JSON.parse(window.localStorage.getItem("bssQuoteCart")):[],l=window.localStorage.getItem("bssListVariantQuoteCart")?JSON.parse(window.localStorage.getItem("bssListVariantQuoteCart")):[];if(window.localStorage.getItem("bssQuoteCart")||window.localStorage.setItem("bssQuoteCart",""),window.localStorage.getItem("bssListVariantQuoteCart")||window.localStorage.setItem("bssListVariantQuoteCart",""),n&&a&&c){let t={};if(s&&s.length&&l&&l.length)if(l.includes(c))for(let t=0;t{t.innerHTML=`

${r.the_product} ${n.title+" "+a.title} ${r.added_to_quote}.

`}))}};if(d=a&&a.length?a:document.querySelectorAll("[bss-bcp-quote-product-price]"),3472===e.storeId&&e.page.isProductPage()&&(d=document.querySelectorAll("[bss-bcp-quote-product-price]:not(form[action='/cart/add'] [bss-bcp-quote-product-price])")),d&&d.length){let t=!!e.quoteConfig.hide_price;for(let t=0;tt.setAttribute("style","visibility: visible !important")))}}let i=new Map;for(let t=0;t{let o=e.querySelectorAll(".bss-b2b-customized-compare-at-price ,.bss-b2b-customized-original-price");if(o.length){for(let t=0;t{clearInterval(t)}),1e3)}}let m=document.createElement("div"),b=document.createTextNode(r.add_to_quote),h="",f=!1,_=null;d[t].closest("section")&&(d[t].closest("section").querySelector(".featured-product")&&(f=!0,_=d[t].closest("section")),h=d[t].closest("section,.product__info-container").getAttribute("id")?d[t].closest("section,.product__info-container").getAttribute("id"):""),void 0===i.get(c)&&i.set(c,[]);let g=n.positionSettings.isDisplayOnCollectionPage;if(-1===i.get(c).indexOf(h)){let r=i.get(c);r.push(h),i.set(c,r),m.setAttribute("class","bss-bcp-add-to-quote-btn"),m.appendChild(b);let a=n.textSettings,s=n.btnSettings;if(a)if(0===a.editorMode){if(m.style.justifyContent="center"==a.alignment?a.alignment:"left"==a.alignment?"start":"end",m.style.fontSize=`${a.fontSize}px`,a.textFormat?.includes("bold")&&(m.style.fontWeight="bold"),a.textFormat?.includes("italic")&&(m.style.fontStyle="italic"),a.textFormat?.includes("underline")&&(m.style.textDecoration="underline"),a.textColor){const{red:t,alpha:e,blue:o,green:n}=a.textColor;m.style.color=`rgba(${t}, ${n}, ${o}, ${e})`}}else if(a.customCss){let t=document.getElementById("bss-bcp-r4q-custom-text-style");t||(t=document.createElement("style"),t.id="bss-bcp-r4q-custom-text-style",document.head.appendChild(t)),t.innerHTML=a.customCss}if(s)if(0===s.editorMode)s.btnColor&&(m.style.backgroundColor=`\n rgba(${s.btnColor.red}, \n ${s.btnColor.green}, \n ${s.btnColor.blue}, \n ${s.btnColor.alpha})`),s.borderThickness&&s.outlineColor&&(m.style.border=`\n ${s.borderThickness}px solid \n rgba(${s.outlineColor.red}, \n ${s.outlineColor.green}, \n ${s.outlineColor.blue}, \n ${s.outlineColor.alpha})`),s.cornerRadius&&(m.style.borderRadius=`${s.cornerRadius}px`);else if(s.customCss){let t=document.getElementById("bss-bcp-r4q-custom-btn-style");t||(t=document.createElement("style"),t.id="bss-bcp-r4q-custom-btn-style",document.head.appendChild(t)),t.innerHTML=a.customCss}if(f){let n=d[t].closest("section").querySelector('form[action*="/cart/add"] button'),r=d[t].closest("section").querySelector(".bss-bcp-add-to-quote-btn");n&&!r&&g&&n.after(m),e.helper.handleChangeVariant(o,f,_)}else{let e=d[t].closest(".card-information");g&&(e?e.after(m):d[t].after(m))}}if(o&&o.hide_cart){let o=null;if(885===e.storeId){o=d[t].closest(".productitem");let e=o?o.querySelector(".atc--button"):null;e&&e.remove()}if(1045===e.storeId){o=d[t].closest(".product.animate");let e=o?o.querySelector(".product-details .purchase"):null;e&&e.remove()}if(o=f||1703===e.storeId?d[t].closest("section").querySelectorAll('form[action*="/cart/add"]'):[2922,3315].includes(e.storeId)?document.querySelectorAll('form[action*="/cart/add"],.card__content'):d[t].closest("li").querySelectorAll('form[action*="/cart/add"],.card__content'),o.length)for(let t=0;t\n ×\n
\n
${r.continue_shopping}
\n
${r.view_quote}
\n `;y.setAttribute("class","bss-quote-modal"),y.setAttribute("id",`bss-quote-modal-id-${u}`),y.innerHTML=S,m.after(y);let w=document.getElementById(`bss-quote-modal-id-${u}`),B=document.querySelectorAll(`#bss-quote-modal-close-id-${u}`),C=document.querySelectorAll(`#bss-quote-continue-shopping-${u}`),v=document.querySelectorAll(`#bss-quote-view-quote-cart-${u}`),q=document.querySelectorAll(`#bss-quote-modal-id-${u}`);B.length&&B.forEach((t=>{t.onclick=function(){q.length&&q.forEach((t=>{t.style.display="none"}))}})),C.length&&C.forEach((t=>{t.onclick=function(){q.length&&q.forEach((t=>{t.style.display="none"}))}})),v.length&&v.forEach((t=>{t.onclick=function(){window.location="/apps/customer-portal/r4q/quote-cart"}})),window.onclick=function(t){t.target==w&&(y.style.display="none")};let k=document.querySelectorAll(`#bss-quote-modal-text-${u}`);m.onclick=function(){p(y,k,a,s,u,1)}}}})).catch((function(t){console.log("No! Something error:",t)}))}}const a=(t,e,o)=>e&&1792===t.storeId?"Delivery Note":!(!o||1792!==t.storeId)&&"Order Reference",c=t=>("beetbg.com"===window.location.hostname&&(t=!1),t),i=t=>{if(window.BSS_BCP.executeAction({tag:"custom_checkout_nt",storeId:!1,BSS_BCP:t}),[1532,1830,1792].includes(t.storeId)){let e=$(".bss-bcp-customer-portal-nt-checkout-btn-app-block");e||(e=$(".bss-b2b-customer-portal-nt-checkout-btn")),e.off("click"),e.on("click",(()=>{t.netterm.validateProductBeforePurchaseLate()}))}},s=t=>{"parkstyling.com"===window.location.hostname?t.closest('form[action*="/cart"]')?t.closest('form[action*="/cart"]').setAttribute("bss-fix-button-nt",""):t.closest("#mini-cart")&&t.closest("#mini-cart").setAttribute("bss-fix-button-nt",""):"palapets.com"===window.location.hostname?document.addEventListener("bss_b2b_doneCheckCp",(()=>{t.style.display="none"})):"aps-glass-bar-supply.myshopify.com"===window.location.hostname||(t.style.display="none")},l=(t,e,o)=>{if("colorado-food-showroom.myshopify.com"===window.location.hostname){let t=document.querySelectorAll('.cart-main input[type="number"]');t.length&&t.forEach((t=>{t.addEventListener("keydown",(function(e){13===e.keyCode&&(e.preventDefault(),t.blur())}))}))}t[o].after(e)},u=()=>{setTimeout((function(){const t=function(){let e=document.querySelector('form[action*="/cart"] a[href="/cart"]');if(e&&"/cart"===window.location.pathname&&(e.style.display="none"),"organicbeer.it"===window.location.hostname){let t=setInterval((()=>{let e=document.querySelectorAll('form[action*="/cart"] a[href="/cart"],.push-btn.inline-block.relative.w-full ');if(e.length>1)for(let t=2;t{clearInterval(t)}),2e3)}let o=document.querySelectorAll('#shopping-cart .ajax-cart__qty-control--up, #shopping-cart .ajax-cart__qty-control--down, form[action="/cart"] .ajax-cart__qty-control--up, form[action*="/cart"] .ajax-cart__qty-control--down,.max-w-min .w-8.h-full'),n=document.querySelectorAll('#shopping-cart .ajax-cart__qty-input, form[action="/cart"] .ajax-cart__qty-input,.text-center.bg-transparent,.quantity__input'),r=document.querySelectorAll('#shopping-cart .ajax-cart__item-remove--js, form[action="/cart"] .ajax-cart__item-remove--js,.max-w-min p.text-xs,.delete-product');function a(){const t=setInterval((()=>{let t=document.querySelectorAll(".button-container .button.button--secondary,.bss-b2b-customer-portal-nt-checkout-btn-default,.button-container button.button:not(.bss-b2b-customer-portal-nt-checkout-btn)");t.length&&t.forEach((t=>{t.style.display="none"}))}),100);setTimeout((()=>{clearInterval(t)}),4e3)}if(o&&o.length)for(let e=0;e{"montikids.com"===window.location.hostname&&a(),setTimeout((function(){BSS_BCP.netterm.showButtonOnCartPage(),t()}),2500)}));if(n&&n.length)for(let e=0;e{t.className=e+" bss-b2b-customer-portal-nt-checkout-btn",t.value=n,t.id=o,t.type="button",[3304,3726,3926,4062].includes(BSS_BCP.storeId)||(t.name="checkout"),t.appendChild(r)},p=(t,e)=>{t&&(t.className+=` ${e||""}`,[3726,3926].includes(BSS_BCP.storeId)||(t.name="checkout"))},m=o(71),b=()=>{let t="",e=[];const o=[855,2144,3429],n=[1792];if([...o,...n].includes(BSS_BCP.storeId)){let o=document.querySelectorAll(".cart-total textarea:not(.bss-b2b-cart-note), #cialInstructions, #CartDrawer-Note"),n=document.querySelectorAll(".bss-b2b-custom-fields textarea");o.length&&o.forEach((o=>{if(o.value){t+=`${o.value}, `;let n=a(BSS_BCP,!0,!1)?a(BSS_BCP,!0,!1):"cart note";e.push({key:n,value:o.value})}})),n.length&&n.forEach((o=>{if(o.value){t+=`${o.value}, `;let n=a(BSS_BCP,!1,!0)?a(BSS_BCP,!1,!0):o.className;e.push({key:n,value:o.value})}})),t&&(t=t.slice(0,-2))}t&&o.includes(BSS_BCP.storeId)&&localStorage.setItem("cart-note-for-bcp",t),e.length&&n.includes(BSS_BCP.storeId)&&localStorage.setItem("cart-addtionaldetails-for-bcp",JSON.stringify(e))},h=(t,e={},o=!1)=>{o&&(localStorage.setItem("bssBCPNtId",t),localStorage.setItem("bssBCPNTChoose",JSON.stringify(e))),[1542].includes(BSS_BCP.storeId)?((t,e)=>{["pointoneb2b.com"].includes(window.location.hostname)&&(t.qi&&t.qi.invalidIncrementProducts||e.netterm.validateProductBeforePurchaseLate())})(BSS_B2B,BSS_BCP):(BSS_BCP.netterm.validateProductBeforePurchaseLate(),b())},f=t=>{const e=document.querySelector(`.bss-bcp-popup.bss-bcp-${t}`),o=document.querySelector(`.bss-bcp-popup-close.${t}`);e&&(e.style.display="block"),o&&(o.onclick=function(){e.style.display="none"})},_=(t,e,o=!1)=>{if("undefined"!=typeof BSS_B2B&&BSS_B2B){let n=!1;BSS_B2B.shopModules&&BSS_B2B.shopModules.length>0&&BSS_B2B.shopModules.forEach((function(t){"amo"==t.code&&(n=t.status)})),(n&&BSS_B2B.amoRules&&!BSS_B2B.amoRules.length||!n)&&(t.onclick=function(){const t=this.id.toString().includes("bss-nt-purchase-late-")?this.id.toString().replace("bss-nt-purchase-late-",""):this.getAttribute("rule-id");h(t,e,o)}),document.addEventListener("bss.b2b.amo.doneCheckAMOByBSS",(function(){n&&BSS_B2B.amo&&BSS_B2B.amo.warning&&BSS_B2B.amo.warning.length>0?t.onclick=function(){return BSS_B2B.amo.showWarningsModal(),!1}:t.onclick=function(){const t=this.id.toString().includes("bss-nt-purchase-late-")?this.id.toString().replace("bss-nt-purchase-late-",""):this.getAttribute("rule-id");h(t,e,o)}}))}},g=async(t,e,o,n,r)=>{2!==o&&(n||(n=r));let a={};t.map((t=>{let e=t.key.split(":")[0];a[e]=0})),e.length||a.length&&await BSS_BCP.helper.updateCart(a),m(BSS_BCP)},y=(t,e,o,n,r,a)=>{const c=t.helper.getProductNameList(e),i=document.querySelector(".invalid-netterm-product"),s=document.querySelector(".bss-proceed-to-purchase-late");i&&(i.innerHTML=c),f("popup-validate-product"),s&&(s.onclick=function(){g(e,o,n,r,a)})},S=(t,e)=>{let o=t?t.product_condition_type:null,n=t?t.product_tags:[],r=t.product_ids,a=t.product_collections;n=n?n.split(","):[],r=r?r.split(","):[],a=a?a.split(","):[];let c=e.product_id?e.product_id:e.id,i=e?e.collections:[],s=e?e.tags:[];if(0==o)return!0;if(1==o){if(-1!==r.indexOf(c+""))return!0}else if(2==o){if(i.filter((t=>a.includes(t+""))).length>0)return!0}else if(3==o&&n.filter((t=>s.includes(t+""))).length>0)return!0;return!1},w=(t,e)=>{let o=t.apply_to,n=t.customer_ids,r=t.customer_tags;if(0===o)return!0;if(1===o){if(n=n?n.split(","):[],n.includes(e.id+""))return!0}else if(2===o){r=r.split(",").map((t=>t.toLowerCase().trim()));let t=e.tags?.map((t=>t.toLowerCase().trim()))||[];if(0!==r.filter((e=>t.includes(e))).length)return!0}else if(3===o&&e.id)return!0;return!1};BSS_BCP.nt.checkRuleNtApply=(t,e)=>{const o=localStorage.getItem("bssBCPNtId"),n=BSS_BCP.nt.rules.filter((t=>+o===t.id)),r=t.id,a=t.tags||[];if(n.length){const t=n[0],e=t.customer_ids?t.customer_ids.split(","):[],o=t.customer_tags?t.customer_tags.toLowerCase().split(","):[];if(0==t.apply_to)return{isApplyRule:!0,rule:t};if(1==t.apply_to&&r&&-1!==e.indexOf(r.toString()))return{isApplyRule:!0,rule:t};if(2==t.apply_to&&a.length>0)for(const e of o)for(const o of a)if(o.toLowerCase()===e)return{isApplyRule:!0,rule:t};if(3==t.apply_to&&r)return{isApplyRule:!0,rule:t}}return{isApplyRule:!1,rule:n.length?n[0]:null}};const B=(t,e,o,n)=>{let r={},a={};if(2===o){let o=localStorage.getItem("bssBCPNtId"),c={};if(t.nt.rules.map((t=>{o==t.id&&(c=t)})),w(c,n))for(let t=0;tt.priority-e.priority)),o.length)r=o[0],localStorage.setItem("bssBCPNtId",r.id);else{let t=c.length>0?c:i,e=t[0];for(let o=1;on.priority||e.priority===n.priority&&Date.parse(e.createdAt)>Date.parse(n.createdAt))&&(e=n)}a=e,localStorage.setItem("bssBCPNtId",a?a.id:"")}}return{_ruleNtApply:r,_invalidRuleNtApply:a}},C=(t,e,o,n,r,a,c,i=!1)=>{let s=null;const l=document.createTextNode(e);s=document.createElement(n),s.onclick=function(){let t=this.id.toString();this.id.toString().includes("bss-nt-purchase-late-")&&(t=this.id.toString().replace("bss-nt-purchase-late-","")),h(t,i,!0)},d(s,r,o,e,l),t.nt.config.nt_replace_checkout&&(c.style.display="none"),c.after(s),_(s,i,a)},v=o(71);function q(t,e){let o={},n={},r=null,a="";const m=e.nt.config.nt_apply_to,S=t.customer,q={},k=((t,e,o)=>{let n=!1;if([1,2].includes(o))n=!0;else if(0===o){let o=new Map,r=[],a=[],c=[];t.nt.rules.forEach((t=>{o.set(t.id,t.apply_to),1==t.apply_to?a=[...a,...t.customer_ids.split(",")]:2==t.apply_to&&(c=[...c,...t.customer_tags.split(",")])})),o=new Map([...o.entries()].sort(((t,e)=>t[1]-e[1])));for(const[e,n]of o.entries())t.nt.rules.forEach((t=>{t.status&&[0,1,2,3].includes(+n)&&t.id===e&&r.push(t.apply_to)}));if(e.id){const t=e.tags&&e.tags.length?e.tags.map((t=>t.toLowerCase())):[];for(let o=0;o{t.includes(e.toLowerCase())&&(n=!0)}))}}else r.map((t=>{0===t&&(n=!0)}))}return n})(e,S,m);e.nt.translation&&e.nt.translation.map((t=>{q[t.key]=t.value})),(t=>{const e='\n
\n
\n

Purchase Late Note

\n
\n

\n

\n
\n

Proceed to purchase late page

\n x\n
\n
\n ',o='\n
\n
\n

Purchase Late Note

\n
\n \n
\n x\n
\n
\n ',n='\n
\n
\n

Restrict Net Terms options according to Order Amount/Quantity

\n
\n

\n

\n
\n x\n
\n
\n ',r='\n \n ';window.document.body.insertAdjacentHTML("afterbegin",e),window.document.body.insertAdjacentHTML("afterbegin",o),window.document.body.insertAdjacentHTML("afterbegin",n),window.document.body.insertAdjacentHTML("afterbegin",r),window.BSS_BCP.executeAction({tag:"custom_popup_for_SEO",storeId:3135,popupHtml:e,popupMultiButton:o,popupRestrictNTHtml:n,popupCustomerLogin:r}),document.querySelectorAll(".bss-purchase-late-note").forEach((e=>e.innerHTML=t.purchase_late_note)),document.querySelector(".invalid-netterm-product-message").innerHTML=t.purchase_late_message,document.querySelector(".invalid-netterm-rule-message").innerHTML=t.purchase_late_message_qualify,document.querySelector(".bss-proceed-to-purchase-late").innerHTML=t.purchase_late_link,document.querySelector(".invalid-netterm-rule-message-login").innerHTML=t.purchase_late_message_login,document.querySelector(".bss-proceed-to-purchase-late-login").innerHTML=t.purchase_late_link_login,(t=>{if("tooldepotno.myshopify.com"===window.location.hostname){const e=document.querySelector(".bss-purchase-late-rule-name");e&&(e.innerHTML=t.purchase_late_note)}})(t)})(q),e.netterm.getCartData=async function(t){const o=await e.helper.getCart();o&&e.netterm.validatePurchaseLate(o,t)},e.netterm.showButtonOnCartPage=function(){if(e.nt.config.nt_replace_checkout||0===e.nt.config.nt_display_position?a=e.helper.CheckoutBtnDefaultQuery:1===e.nt.config.nt_display_position?a=e.helper.checkoutBtnCartPage:2===e.nt.config.nt_display_position&&(a=e.helper.checkoutBtnMiniCart),r=document.querySelectorAll(a)?.length?document.querySelectorAll(a):document.querySelectorAll("[bss-b2b-customer-portal-netterm-checkout]"),r=((t,e)=>(e=window.BSS_BCP.executeFilter({tag:"custom_button_checkout_selector",storeId:!1,val:e,checkoutBtn:e}),"www.canterburycanada.com"===window.location.hostname&&(e=document.querySelectorAll("button#checkout.add_to_cart.checkout")),"www.platinumprotectors.com"===window.location.hostname&&(e=document.querySelectorAll('button[name="checkout"]')),"www.arkcolourdesign.com"===window.location.hostname&&(e=document.querySelectorAll("#AjaxCartSubtotal .button.button--solid")),"wexfordhomegoods.com"===window.location.hostname&&(e=document.querySelectorAll("[name='checkout']:not([bss-b2b-create-draft-order])")),e))(0,r),k)if(2===m){const t=document.querySelectorAll(".bss-bcp-customer-portal-nt-checkout-btn-app-block");if(t&&t.length){t.forEach((o=>{const n=o.getAttribute("rule-id");if(n){const a=e.nt.rules.find((t=>t.id===n));p(o,r[0].className),t.forEach((t=>{t.classList.remove("bss-bcp-checkout-app-block")})),"undefined"!=typeof BSS_B2B&&BSS_B2B?_(o,a,!0):o.onclick=function(){h(n,a,!0)}}}));for(let t=0;t=0;t--){let o=e.nt.rules[t];if(r.length){let t=null,n=document.createTextNode(o.name);t=document.createElement(r[0].tagName),t.setAttribute("apply_to",o.apply_to),t.setAttribute("product_condition_type",o.product_condition_type),d(t,r[0].className,"bss-nt-purchase-late-"+o.id,o.name,n),"undefined"!=typeof BSS_B2B&&BSS_B2B?_(t,o,!0):t.onclick=function(){const t=this.id.toString().replace("bss-nt-purchase-late-","");h(t,o,!0)};for(let o=0;o=3&&(r[o].parentElement.style.flexDirection="column")}}}else{const t=document.querySelector(".bss-bcp-customer-portal-nt-checkout-btn-app-block");if(r.length){let o=null,n=document.createTextNode(q.purchase_late);if(o=document.createElement(r[0].tagName),d(o,r[0].className,r[0].id,q.purchase_late,n),t&&(p(t,r[0].className),t.classList.remove("bss-bcp-checkout-app-block")),"undefined"!=typeof BSS_B2B&&BSS_B2B?(_(o,{}),t&&_(t,{})):(o.onclick=function(t){3401===e.storeId&&t.preventDefault();const o=this.id.toString().replace("bss-nt-purchase-late-","");h(o)},t&&(t.onclick=function(){const t=this.id.toString().replace("bss-nt-purchase-late-","");h(t)})),t)for(let t=0;t0){let e=null,o=document.createTextNode(q.purchase_late);e=document.createElement(r[t].tagName),d(e,r[t].className,r[t].id,q.purchase_late,o),"undefined"!=typeof BSS_B2B&&BSS_B2B?_(e,{}):e.onclick=function(){const t=this.id.toString().replace("bss-nt-purchase-late-","");h(t)},r[t].after(e)}else 3092===e.storeId?$(".checkout-default").after(o):r[t].after(o);if([2973,3445].includes(e.storeId))break}}}},e.netterm.validateProductBeforePurchaseLate=function(){if(2===m){const{isApplyRule:t,rule:n}=e.nt.checkRuleNtApply(S,o);if(t)return e.netterm.getCartData(!1);if(n&&n.id){const t=document.querySelector(".bss-purchase-late-rule-name");t&&(t.innerHTML=n.name),3===n.apply_to?f("popup-customer-login"):f("popup-multi-button")}}else{if(1!==m)return e.netterm.getCartData(!1);{const t={id:S.id,tags:S.tags},r=Object.keys(o).length?o:n;if(w(r,t))return e.netterm.getCartData(!1);o=Object.keys(o).length?o:n,3===o.apply_to?f("popup-customer-login"):f("popup-multi-button")}}},e.netterm.validatePurchaseLate=async function(t,r=!0){try{if(t&&t.items&&t.items.length>0){let a=[],c=[],i=new Map,s=[];t.items.forEach((function(t){s.push({id:t.product_id,final_line_price:t.final_line_price,quantity:t.quantity,title:t.title});let e=t.product_id;-1===c.indexOf(e)&&(c.push(e),a.push('id:"'+e+'"'),i.set(e,[]));let o=i.get(e);o.push(t.key),i.set(e,o)}));const l="/search.js?q="+a.join(" OR ")+"&view=bss.bcp",u=encodeURI(l);try{const a=await fetch(u,{method:"GET"});if(!a.ok){const t=await a.text();throw console.log("No! Something error:",t),new Error(t)}let c=await a.json();if(2220===e.storeId&&e.page.isCartPage()&&(c=[],(await e.getItemCartMetaField()).line_item_products.map((t=>{c.push(t)}))),c.length0){let t=[],a=[];for(let e=0;e{let e=((t,e,o)=>{Object.keys(e).length||(e=o);let n=e?e.product_condition_type:null,r=e.product_ids,a=e?e.product_tags:"",c=e.product_collections;a=a?a.split(","):[],r=r?r.split(","):[],c=c?c.split(","):[];let i=t.product_id?t.product_id:"",s=t.collections?t.collections:[],l=t?t.tags:"";if(0==n)return!0;if(1==n){if(-1!==r.indexOf(i+""))return!0}else if(2==n){if(s.filter((t=>c.includes(t+""))).length>0)return!0}else if(3==n&&a.filter((t=>l.includes(t+""))).length>0)return!0;return!1})(t,o,n);e||(d.push(t),a.push(t.product_id))})),s.map((t=>{a.includes(t.id)||p.push(t)})),!r){const t=Object.keys(n).length>0?n:o;localStorage.setItem("bssBCPNtId",t.id),document.getElementsByClassName("modalWarningQI").length&&"block"==document.getElementsByClassName("modalWarningQI")[0].style.display||document.querySelector(".bss-modal-amo.active")||(3==t.apply_to&&d.length?S.id?y(e,d,p,m,o,n):f("popup-customer-login"):0!=t.product_condition_type&&d.length||!o&&d.length?y(e,d,p,m,o,n):p.length?await g(d,p,m,o,n):v(e))}window.BSS_BCP.executeAction({tag:"custom_validate_purchase_late",storeId:!1,BSS_BCP:e,invalidNtProductNtRule:d})}}catch(t){console.log("No! Something error:",t)}}else{const{_ruleNtApply:t,_invalidRuleNtApply:r}=B(e,[],m,S);o=t,n=r,console.log("Cart data is empty")}}catch(t){console.log("Could not get shop data")}},e.netterm.handleButtonMiniCart=(t,o)=>{let n=setInterval((function(){let o=null;if("click"===t?o=document.querySelectorAll(e.helper.miniCartBtn):"mouseover"===t&&(o=document.querySelectorAll(e.helper.btnViewCart)),k&&o&&o.length){for(let t=0;t=0;n--){let r=e.nt.rules[n];C(e,r.name,"bss-nt-purchase-late-"+r.id,o[0].tagName,o[0].className,!0,o[t],r)}else C(e,q.purchase_late,o[0].id,o[0].tagName,o[0].className,!1,o[t])}clearInterval(n)}}),o);setTimeout((function(){clearInterval(n)}),2e3)},function(){const t=document.querySelectorAll(".bss-bcp-customer-portal-nt-checkout-btn-app-block"),o=t&&t.length;if(k){if([0,2].includes(e.nt.config.nt_display_position)){let n=500;n=(t=>(["earlsdoorstore.com","capital-analytical.myshopify.com"].includes(window.location.hostname)&&(t=1500),t))(n);const r=document.querySelectorAll(e.helper.ajaxCartElement),a=document.querySelectorAll(e.helper.mouseOverAjaxCart);2===e.nt.config.nt_display_position&&o&&t.forEach((t=>t.remove()));for(let t=0;tt.remove()));const n=document.querySelectorAll('form[action="/cart/add"] button[type="submit"]');n&&n.length&&n.forEach((t=>{t.addEventListener("click",(function(){setTimeout((()=>{e.netterm.getCartData(!0)}),1e3)}))}))}(),e.netterm.getCartData(!0),(t=>{if(t.netterm.showButtonOnCartPage(),window.BSS_BCP.executeAction({tag:"custom_something_nt",storeId:!1,BSS_BCP:t}),([1478,3086,3818].includes(t.storeId)||["kbgolf.com"].includes(window.location.hostname))&&setTimeout((()=>{t.netterm.showButtonOnCartPage()}),2500),[2469].includes(t.storeId)&&setTimeout((()=>{let e=document.querySelector(".product-form__action-wrapper .product-form--atc-button");e&&e.addEventListener("click",(()=>{setTimeout((()=>{let e=document.querySelector(".atc-banner--cart-footer .bss-b2b-customer-portal-nt-checkout-btn ");e&&e.addEventListener("click",(()=>{t.netterm.validateProductBeforePurchaseLate(),b()}))}),1500)}))}),2e3),[3429].includes(t.storeId)){const t=document.querySelector("cart-drawer");t&&new MutationObserver((()=>{b()})).observe(t,{attributes:!0})}if("colorado-food-showroom.myshopify.com"===window.location.hostname&&document.addEventListener("ARMADA:CART:COUNT:CHANGE",(()=>{t.netterm.showButtonOnCartPage()})),[1532,1830].includes(t.storeId)&&document.addEventListener("closeFlyouts",(()=>{t.netterm.showButtonOnCartPage()})),[2431,3571].includes(t.storeId)&&document.addEventListener("bss:custom:minicart-open",(()=>{t.netterm.showButtonOnCartPage()})),[2094,1559,2640,2083].includes(t.storeId)){let e=document.querySelector(".\\#modal-popup-content, #dropdown-cart .has-items .actions, .cart-section aside #AjaxCartSubtotal, sidebar-drawer .sidebar__body #AjaxCartForm");e&&new MutationObserver((function(o){o.forEach((function(o){if(o.addedNodes.length)if(1559===t.storeId){const o=e.querySelector(".btn.btn-checkout.bss-b2b-customer-portal-nt-checkout-btn");o&&o.addEventListener("click",(function(){t.netterm.getCartData(!1)}))}else t.netterm.showButtonOnCartPage()}))})).observe(e,{childList:!0})}if([2009,1157].includes(t.storeId)){let e=document.querySelector("cart-drawer.cart-drawer.drawer, #HeaderMiniCart, #MainContent, #mini-cart > div.ajax-cart__header-wrapper.grid__wrapper.edge > div.span-4.sm-span-4.auto.a-right.v-center > p > .js-cart-count.inline-block,.cart-page.ajax-cart__page-wrapper.cart-type--drawer.main__section .ajax-cart__header-wrapper.grid__wrapper.edge .js-cart-count, #main");e&&new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.length&&t.netterm.showButtonOnCartPage()}))})).observe(e,{childList:!0,subtree:!0})}if([855].includes(t.storeId)){const e=document.querySelector("header.site-header.site-header-nav--open");e&&new MutationObserver((function(e){e.forEach((function(e){if(e.addedNodes.length){const e=document.querySelectorAll(".bss-b2b-customer-portal-nt-checkout-btn");e&&e.length&&e.forEach((t=>t.remove())),t.netterm.showButtonOnCartPage()}}))})).observe(e,{childList:!0})}if([1945].includes(t.storeId)){let e=7;t.nt.rules.length&&(e=t.nt.rules[0].due_days);let o=new Date,n=new Date;n.setDate(o.getDate()+e);let r={weekday:"short",month:"short",day:"numeric",year:"numeric"},a=n.toLocaleDateString("en-US",r).replaceAll(",",""),c=document.createElement("div");c.className="bss_custom",c.style.textAlign="center";let i=document.createTextNode(`Your payment is due on ${a}`);if(c.appendChild(i),"/cart"===window.location.pathname){let t=document.querySelector(".cart__item-row.text-center"),e=document.querySelectorAll(".cart__page-col")[1];e&&t&&e.appendChild(c)}else{let t=document.querySelector("#CartDrawerForm"),e=document.querySelector(".cart__item-row.text-center");t&&e&&e.insertAdjacentElement("afterend",c)}}if(1901===t.storeId&&t.configData.nt_replace_checkout&&window.location.pathname.includes("/apps/customer-portal/quick-order")){let t=setInterval((function(){let e=document.querySelector("#bss-bcp-qo-checkout-btn");e&&(e.remove(),setTimeout((function(){clearInterval(t)}),500))}),50);setTimeout((function(){clearInterval(t)}),2e3)}885===t.storeId&&(setTimeout((()=>{t.netterm.showButtonOnCartPage()}),3e3),setTimeout((()=>{let e=document.querySelectorAll('form[action="/cart/add"] .product-form--atc .product-form--atc-button');if(e.length)for(let o=0;o{setTimeout((()=>{t.netterm.showButtonOnCartPage()}),1500)}}}),3500)),2144===t.storeId&&(setTimeout((()=>{t.netterm.showButtonOnCartPage()}),2e3),u()),885===t.storeId&&(setTimeout((()=>{t.netterm.showButtonOnCartPage()}),3e3),setTimeout((()=>{const e=document.querySelectorAll('form[action="/cart/add"] .product-form--atc .product-form--atc-button');if(e.length)for(let o=0;o{setTimeout((()=>{t.netterm.showButtonOnCartPage()}),1500)}}}),3500)),3054===t.storeId&&document.querySelectorAll('#nav-user li.cart, button[type="submit"].overlay-tertiary').forEach((e=>{e.addEventListener("click",(()=>{setTimeout((()=>{t.netterm.showButtonOnCartPage()}),700);const e=setInterval((()=>{const o=document.querySelector(".overlay-tertiary.ajax-cart__toggle.bss-b2b-customer-portal-nt-checkout-btn");o&&(o.addEventListener("click",(()=>{t.netterm.validateProductBeforePurchaseLate(),b()})),clearInterval(e))}),300)}))})),"tooldepotno.myshopify.com"===window.location.hostname&&setTimeout((()=>{const e=document.querySelector('form[action="/cart/add"] .product-form--atc .product-form--atc-button');e&&(e.onclick=()=>{const e=document.querySelectorAll(".bss-b2b-customer-portal-nt-checkout-btn");e&&e.length&&e.forEach((t=>{t.remove()})),setTimeout((()=>{t.netterm.showButtonOnCartPage()}),1500)})}),1e3)})(e)}const{changeFontSizeOfPriceVatEle:k,getTaxRate:P}=o(59),E=(t,e,o,n,r,a,c)=>{const i=r?n.compare_at_price:n.price;t.appendChild(o),o.after(e),o.innerHTML=`${c.formatMoney(i)}`,o.style.color=`${a.cpSettings.default_price_color}`,o.style.textDecoration="line-through"},I=t=>{if(t&&t.length)for(let e=0;e{let n,r={id:e.product.id,collections:e.product_collections,tags:e.product.tags};if(BSS_B2B.qi.getAppliedRulesForBuyItNowItem){let e=BSS_B2B.qi.getAppliedRulesForBuyItNowItem(r);if(e&&e.qty_increment){n="increment"===t?Number(o.value)+e.qty_increment:Number(o.value)-e.qty_increment;let r=n%e.qty_increment;r>=e.qty_increment/2?n=n-r+e.qty_increment:n-=r}else n="increment"===t?Number(o.value)+1:Number(o.value)-1}else n="increment"===t?Number(o.value)+1:Number(o.value)-1;return n},T=({rowElement:t,rule:e,variant:o,price:n,taxesIncluded:r,translations:a={excluded_vat_text:"exc. VAT | ",included_vat_text:"inc. VAT"},isComparePrice:c=!1})=>{const i=P(BSS_BCP.shopData.product_collections),s=`${a.included_vat_text}`;let l=`${a.excluded_vat_text}`;const u=document.createElement("span"),d=document.createElement("span");if(u.className="bss-b2b-product-vat-price-has-vat",d.className="bss-b2b-product-vat-price-no-vat",c&&(u.style.textDecoration="line-through",d.style.textDecoration="line-through"),e){const{ratio_type:t,display_price_type:o,exc_text_color:n,inc_text_color:r}=e;switch(o){case 0:break;case 1:d.style.display="none";break;case 2:u.style.display="none",l=l.replace("|","")}u.style.color=r,d.style.color=n;const a=k(t);u.style["font-size"]=a.fontSizePriceHasVat,d.style["font-size"]=a.fontSizePriceNoVat}let p="",m="";r?o&&o.taxable?(p=BSS_BCP.formatMoney(n/(1+i)),m=BSS_BCP.formatMoney(n)):o&&!o.taxable&&(p=BSS_BCP.formatMoney(n),m=p):o&&o.taxable?(p=BSS_BCP.formatMoney(n),m=BSS_BCP.formatMoney(n*(1+i))):o&&!o.taxable&&(p=BSS_BCP.formatMoney(n),m=p),u.innerHTML=m+s,d.innerHTML=p+l,t.innerHTML=`
\n ${d.outerHTML} ${u.outerHTML}\n
`},{getAppliedRuleTd:A,checkVariantCpPlRule:N}=o(59),L=o(586),O=(t,e,o)=>{const n=document.createTextNode(o.vo_buyItNow),r=e[0].cloneNode(!0);r.id="bss-bcp-vo-buy-it-now",r.style.display="block",r.before(n);let a=r,c=!1;const i="undefined"!=typeof BSS_B2B&&BSS_B2B.cpRuleChoice&&BSS_B2B.cpRuleChoice.length;return i&&(c=JSON.parse(document.getElementById("bss-b2b-store-data").innerHTML),BSS_B2B.handleCartCheckoutBtn(c)),a.addEventListener("click",(async function(e){let n=[...document.querySelectorAll(".bss-b2b-variants-order-table .number-input input")];n=n.map((t=>({id:+t.id,quantity:+t.value}))).filter((t=>t.quantity>0)),c&&i&&(c={...c,cart:{...c.cart,items:n}});try{if(n.length){r.disabled=!0;const o=await fetch("/cart/clear.js",{method:"POST",headers:{"Content-Type":"application/json"}});if(!o.ok){const e=await o.text(),n=JSON.parse(e);throw n.description&&(t.innerHTML="*"+n.description),r.disabled=!1,new Error(e)}const a=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:n})});if(!a.ok){const e=await a.text(),o=JSON.parse(e);throw o.description&&(t.innerHTML="*"+o.description),r.disabled=!1,new Error(e)}const s=await a.json();if(s&&s.items.length)if(i){if($(this).off(),e.stopImmediatePropagation(),e.preventDefault(),e.stopPropagation(),"undefined"!=typeof BSS_B2B&&BSS_B2B){const t=BSS_B2B.qi.invalidIncrementProducts;if(t)return void BSS_B2B.qi.renderWarningMessage(t);BSS_B2B.modifyCartDataAndCreateCheckout(c,"",this,this,!1,!1,[],!1,!1)}}else window.location.href="/checkout"}else t.innerHTML="* "+o.vo_atLeast1Item,r.disabled=!1}catch(t){console.log("BSSVOCreateBuyItNowBtn error:",t)}})),r},M=(t,e,o,n)=>{const r=o.money_code,a=o.money_format,c=o.variants_quantity,i=o.variants_policy;let s=document.createElement("table"),l=document.createElement("thead"),u=document.createElement("tbody");s.appendChild(l),s.appendChild(u),s.className="bss-b2b-variants-order-table";const d=A({shopData:window?.BSS_BCP.shopData,rules:window?.BSS_B2B?.taxDisplayRules||[]});return t.map((s=>{let l=document.createElement("tr"),p=document.createElement("div"),m=document.createElement("div"),b=document.createElement("p");if(p.className="bss-vo-item-variant",l.style.borderTop=l.style.borderBottom="2px solid #ebeef0",m.style.width="100px",u.appendChild(l),l.appendChild(p),s.featured_image){let t=document.createElement("img"),e=document.createElement("div"),o=document.createElement("div"),n=document.createElement("span");t.src=s.featured_image.src,t.className="bss-b2b-image-child",e.className="bss-b2b-modal-image",o.className="bss-b2b-modal-image-content",n.className="bss-b2b-close-modal-image",n.innerHTML="×",e.appendChild(o),o.appendChild(n),o.appendChild(t),b.appendChild(e),b.appendChild(t.cloneNode(!0)),window.addEventListener("click",(function(t){t.target!=e&&t.target!=n||(e.style.display="none")})),b.addEventListener("click",(function(){e.style.display="block"}))}m.appendChild(b),p.appendChild(m);let h=document.createElement("div"),f=document.createElement("p");h.style.width="150px",f.style.margin="unset",f.innerHTML=s.public_title,h.appendChild(f),[1792].includes(BSS_BCP.storeId)&&((t,e,o)=>{if([1792].includes(t.storeId)){let t=document.createElement("p");t.style.margin="unset",t.style.marginTop="10px",t.innerHTML=`SKU:${o.sku}`,e.appendChild(t)}})(BSS_BCP,h,s),p.appendChild(h);let _=document.createElement("div"),g=document.createElement("div");BSS_BCP.isEnableQuote&&BSS_BCP.quoteSettings&&Object.keys(BSS_BCP.quoteSettings).length>0&&1===BSS_BCP.quoteSettings.hide_price?g.style.display="none":(g.className="bss-b2b-price-parent-element",_.className="bss-b2b-price-element");let y=document.createElement("div");y.className="bss-b2b-compare-price";let S=s.price/100;document.addEventListener("bss_b2b_doneCheckCp",(()=>{if("undefined"!=typeof BSS_B2B&&window.BSS_B2B.cpRuleChoice){let o=L.getList(t).find((t=>t.id===e));const{checkVariantPlCp:n,discountType:r,discountValue:a}=N({rule:o,variantId:s.id});if(o&&n){const t={type:r,value:+a};0==t.type?S>t.value&&(S=t.value):S=1==t.type?SS?`${e} ${t}
${o} ${t}`:`${o} ${t}`}else _.innerHTML=s.compare_at_price&&s.compare_at_price/100>S?`${s.compare_at_price/100} ${a}
${S} ${a}`:`${S} ${a}`;for(let e=0;e{let e=s.compare_at_price?parseFloat(window.Currency.convert(s.compare_at_price/100,r,t)).toFixed(2):0,o=parseFloat(window.Currency.convert(S,r,t)).toFixed(2);_.innerHTML=s.compare_at_price&&s.compare_at_price/100>S?`${e} ${t}
${o} ${t}`:`${o} ${t}`}))}else if("undefined"==typeof BSS_B2B)_.innerHTML=s.compare_at_price&&s.compare_at_price/100>S?`${BSS_BCP.formatMoney(s.compare_at_price)}
${BSS_BCP.formatMoney(100*S)}`:`${BSS_BCP.formatMoney(100*S)}`;else{let e=!1;document.addEventListener("bss_b2b_doneCheckCp",(()=>{const o=L.getList(t);void 0!==BSS_B2B.cpRuleChoice&&0!==o.length||(_.innerHTML=s.compare_at_price&&s.compare_at_price/100>S?`${BSS_BCP.formatMoney(s.compare_at_price)}
${BSS_BCP.formatMoney(100*S)}`:`${BSS_BCP.formatMoney(100*S)}`),window?.BSS_B2B?.cpRuleChoice&&o.length&&(2===BSS_B2B.cpSettings.cpType&&s.price/100!==S&&(E(g,_,y,s,!1,BSS_B2B,BSS_BCP),d&&T({rowElement:y,rule:d,variant:s,price:s.price,translations:window.BSS_B2B.taxDisplayTranslations,isComparePrice:!0,taxesIncluded:window.BSS_B2B.shopData.taxes_included})),1===BSS_B2B.cpSettings.cpType&&(s.compare_at_price&&s.compare_at_price>s.price?(E(g,_,y,s,!0,BSS_B2B,BSS_BCP),d&&T({rowElement:y,rule:d,variant:s,price:s.compare_at_price,translations:window.BSS_B2B.taxDisplayTranslations,isComparePrice:!0,taxesIncluded:window.BSS_B2B.shopData.taxes_included})):(E(g,_,y,s,!1,BSS_B2B,BSS_BCP),d&&T({rowElement:y,rule:d,variant:s,price:s.price,translations:window.BSS_B2B.taxDisplayTranslations,isComparePrice:!0,taxesIncluded:window.BSS_B2B.shopData.taxes_included}))),_.innerHTML=` ${BSS_BCP.formatMoney(100*S)} `,_.style.color=`${BSS_B2B.cpSettings.price_applied_cp_color}`,d&&T({rowElement:_,rule:d,variant:s,price:100*S,translations:window.BSS_B2B.taxDisplayTranslations,taxesIncluded:window.BSS_B2B.shopData.taxes_included}),e=!0)})),d&&document.addEventListener("doneCalcVatPriceOnProductPage",(()=>{T({rowElement:_,rule:d,variant:s,price:s.price,translations:window.BSS_B2B.taxDisplayTranslations,isComparePrice:!1,taxesIncluded:window.BSS_B2B.shopData.taxes_included})})),e||(_.innerHTML=` ${BSS_BCP.formatMoney(100*S)} `)}g.appendChild(_),p.appendChild(g);let B=document.createElement("div");if(B.style.width="150px",s.available){let t=document.createElement("div"),e=document.createElement("div"),r=document.createElement("button"),a=document.createElement("input"),l=document.createElement("button"),u=document.createElement("p");t.className="qty-group",e.className="number-input",r.className="spinner decrement",r.innerHTML="-",l.className="spinner increment",l.innerHTML="+",a.id=s.id,a.setAttribute("type","text"),a.setAttribute("value","0"),r.addEventListener("click",(()=>{((t,e)=>{let o=Number(t.value)-1;[3362].includes(BSS_BCP.storeId)&&(o=x("decrement",e,t)),t.value=o<0?0:o})(a,o)})),a.addEventListener("keyup",(()=>{a.value=a.value.replace(/[^\d]/,"")})),a.addEventListener("input",(t=>{((t,e,o,n)=>{const r=t.target.value;""!=r&&(parseInt(r)<0&&(t.target.value=0),parseInt(r)>parseInt(e)&&"continue"!=o&&n&&(t.target.value=e))})(t,c[s.id],i[s.id],s.inventory_management)})),l.addEventListener("click",(()=>{((t,e,o,n,r)=>{let a=Number(t.value)+1;[3362].includes(BSS_BCP.storeId)&&(a=x("increment",r,t)),t.value="continue"!=o&&n&&a>e?e:a})(a,c[s.id],i[s.id],s.inventory_management,o)})),"continue"!=i[s.id]&&s.inventory_management?[1792].includes(BSS_BCP.storeId)?((t,e,o)=>{[1792].includes(t.storeId)&&(e.innerHTML=`${o.vo_inStock}`)})(BSS_BCP,u,n):u.innerHTML=`${c[s.id]} ${n.vo_inStock}`:u.innerHTML=n.vo_unlimited,e.appendChild(r),e.appendChild(a),e.appendChild(l),t.appendChild(e),t.appendChild(u),B.appendChild(t)}else B.style.color="#212529",B.style.textAlign="center",B.innerHTML=n.vo_outOfStock;p.appendChild(B)})),s};function D(t,o){const r=t.product.id,a=t.product_collections,c=t.product.tags,i=t.product.variants,s={},l=document.querySelectorAll(o.helper.addToCartVoDefault);o.vo.translation&&o.vo.translation.map((t=>{s[t.key]=t.value})),o.vo.appendBuyItNowBtn=function(t,e){const n=setInterval((()=>{if(o.helper.getBuyItNowBtn().length){let t=new Event("bss_bcp_found_buy_it_now");window.dispatchEvent(t),clearInterval(n)}}),200);setTimeout((()=>{clearInterval(n)}),4500),window.addEventListener("bss_bcp_found_buy_it_now",(()=>{const n=o.helper.getBuyItNowBtn();for(let t=0;t{const r=O(t,n,s);if(r){e.appendChild(r);const t=document.querySelector("#bss-bcp-vo-buy-it-now").querySelector(o.helper.buyItNowtElements);t&&(t.style.display="block")}[611].includes(o.storeId)&&(t=>{if([611].includes(t.storeId)){const t=document.querySelector(".shopify-section .product-content-container .product-block-area");if(t){const e=t.querySelector('form[action="/cart/add"]');e&&e.remove()}}})(o)}),2e3)}))},o.vo.generateVariantsOrder=function(){let u=e(o,t.customer);if(u=n(u,r,a,c),u.length&&u[0]){let e=document.querySelectorAll(o.helper.addToCartVoDefault);const n=document.querySelectorAll(o.helper.productFormVoDefault),a=document.querySelectorAll(o.helper.productPriceVoDefault),c=document.querySelectorAll(o.helper.variantChoiceVoDefault);let u=document.querySelectorAll(o.helper.productQuantityVoDefault);const d=document.querySelectorAll("span.bss-b2b-customer-portal-variants-order");u=window.BSS_BCP.executeFilter({tag:"custom_voProductQuantity",val:u,voProductQuantityDefault:u}),e=window.BSS_BCP.executeFilter({tag:"custom_voAddToCart",val:e,voAddToCartDefault:e}),I(a),I(e),I(c),I(u);const p=document.createElement("p");p.style.cssText="color: red; margin-top: 13px; margin-bottom: -8px;";const m=document.createElement("div"),b=document.createElement("div");m.className="bss-b2b-variants-order",b.className="bss-b2b-table-div";const h=M(i,r,t,s),f=((t,e,o,n)=>{const r=document.createElement("button"),a=document.createTextNode(n.vo_addToCart);return r.className="bss_add_to_cart_vo",o.length&&(r.className=o[0].className+" bss-b2b-customer-portal-variants-order-btn",r.id=o[0].id),r.appendChild(a),r.addEventListener("click",(async function(){let o=[...document.querySelectorAll(".bss-b2b-variants-order-table .number-input input")];o=o.map((t=>({id:+t.id,quantity:+t.value}))).filter((t=>t.quantity>0));try{if(o.length){r.disabled=!0;const n=await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:o})});if(!n.ok){const t=await n.text(),o=JSON.parse(t);throw o.description&&(e.innerHTML="*"+o.description),r.disabled=!1,new Error(t)}const a=await n.json();a&&a.items.length&&([611].includes(t.storeId)?(t=>{if([611].includes(t.storeId)){const t=document.querySelector('.bss-b2b-variants-order [x-show="addedToCart"]');t&&(t.style.display="block")}})(t):window.location.href="/cart")}else e.innerHTML="* "+n.vo_atLeast1Item,r.disabled=!1}catch(t){console.log("BSSVOCreateAddToCartBtn error:",t)}})),r})(o,p,l,s);if(m.appendChild(b),b.appendChild(h),m.appendChild(p),m.appendChild(f),o.vo.appendBuyItNowBtn(p,m),n.length)for(let t=0;t{if([611].includes(t.storeId)){let t=[],e=document.querySelector(".shopify-section .product-content-container .product-block-area");if(e){let o=e.querySelector(".product-variant-picker-block");o&&t.push(o);let n=e.querySelector(".product-quantity-block");n&&t.push(n)}for(let e=0;e{if(void 0!==window.bssBCPHooks&&window.bssBCPHooks.actions&&window.bssBCPHooks.actions[t]&&"function"==typeof window.bssBCPHooks.actions[t]&&t&&(e&&e===window.BSS_BCP.storeId||!e)){const e=window.bssBCPHooks.actions[t];if("function"==typeof e){if(o)return Promise.resolve(e({...n}));e({...n})}}},window.BSS_BCP.executeFilter=({tag:t,storeId:e,val:o,async:n,...r})=>{let a=o;if(void 0!==window.bssBCPHooks&&window.bssBCPHooks.filters&&window.bssBCPHooks.filters[t]&&"function"==typeof window.bssBCPHooks.filters[t]&&t&&(e&&e===window.BSS_BCP.storeId||!e)){const e=window.bssBCPHooks.filters[t];"function"==typeof e&&(n?Promise.resolve(e({...r})).then((t=>t)):a=e({...r}))}return a};const{shopModulesB2B:H,checkEnableModulesB2B:Q}=o(514);!function(){var o={};document.querySelector("#bss-bcp-store-data")&&(o=JSON.parse(document.querySelector("#bss-bcp-store-data").innerHTML)),BSS_BCP.shopModulesB2B=H,"undefined"!=typeof BSS_B2B&&Q(window.BSS_B2B.shopModules),BSS_BCP.helper={},BSS_BCP.shopData=o||{},function(t){t.helper.getQueryArray=function(){let t,e=[],o=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(let n=0;nt.map((t=>t.title)).join(", "),t.helper.updateCart=async function(t){let e=null;try{const o=await fetch("/cart/update.js",{method:"post",headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json"},body:JSON.stringify({updates:t})});e=await o.json()}catch(t){console.log("No! Error update cart NT",t)}return e},t.helper.getCart=async function(){let t=null;try{const e=await fetch("/cart.js",{method:"GET",headers:{"Content-Type":"application/json"}});t=await e.json()}catch(t){console.log("No! Error get cart NT",t)}return t},t.helper.checkoutBtnMiniCart='form[action*="/cart"] [name="checkout"],#dropdown-cart button.btn.btn-checkout.show,a.btn.disabled.ttmodalbtn[href="/checkout"],.baskettop button.mini-cart-checkout,.tt-dropdown-menu .btn.itemCheckout,.bss-btn-checkout-mini-cart,#slidedown-cart button[onclick="window.location=\'/checkout\'"],#dropdown-cart button.btn.btn-checkout,form[action="/cart/add"] .product-form--atc .shopify-payment-button button.shopify-payment-button__button,form[action*="/cart"] a[href="/cart"],#header-mini-cart-footer > div > div.mini-cart-footer-actions > a,#CartDrawer-Checkout,.\\#cart-sidebar-checkout .\\#button,form[action="/cart"] .\\#button,.button.add_to_cart.checkout,.checkout-buttons,.subtotal-title-area [href="/checkout"]',t.helper.ajaxCartElement='[id^="AddToCart"]:not(form), [id^="addToCart"]:not(form):not(span), button[aria-controls="CartDrawer"], a[aria-controls="CartDrawer"], button[name="add"].product-form__add-to-cart,button[name="add"].product__add-to-cart-button, button[name="add"].add-to-cart, a.ajax-cart__toggle, span.icon__fallback-text, button#add-to-cart.add-to-cart, a.cart-toggle,.mini-cart-wrap[data-cart-mini-toggle], .addtocart-button-active[data-product-submit], button.product-form--atc-button, button.productitem--action-atc, #add-to-cart-product-template,.product-form__add-button[data-action="add-to-cart"], .header__cart-toggle[data-action="toggle-mini-cart"], button[type="submit"][data-action="add-to-cart"], button.btn-addtocart,form[action*="/cart/add"] input.AddtoCart, a[data-cart-toggle][data-dropdown-menu], input[data-btn-addtocart], .cart-block-click, button[data-btn-addtocart], a.js-cart-trigger[href="/cart"],form.js-product-form, form[action*="/cart/add"] button.single_add_to_cart_button.button, .Header__Wrapper .Header__FlexItem a[data-drawer-id="sidebar-cart"], button.product-form__cart-submit,.add-to-cart-box .add-to-cart, a.header-cart-btn.cart-toggle, .product-page--submit-action .btn, .ajax-submit.action_button.add_to_cart, .site-header__cart.cart-modal, form[action*="/cart/add"] button.ajax-submit.button--add-to-cart,form[action*="/cart/add"] div.add-to-cart button.button[type="submit"], a.add-cart-btn, button.tt-dropdown-toggle, .quick-view button.add-to-cart-btn.btn, button.add.font--secondary-button, button[type="submit"].gf_add-to-cart.product-form-product-template,a.header--cart-link.font--accent, .cart-container, .icon-bag.mini_cart.dropdown_link, a.my-cart-link, .product-form--button-container button.product-form--add-to-cart, .product-form--submit span.price, a.push_side.pr.cb.chp.db,.ProductForm__AddToCart, .slideout__trigger-mobile-menu.js-mini-cart-trigger.js-slideout-open, button.btn.btn--full.btn--status.btn--animated.js-product-button-add-to-cart, a.header__btn-cart.js-popup-button, .payment-buttons button[data-add-to-cart],a.js-product-button-add-to-cart, .js-drawer-open-cart, button.btn.btn--tertiary.add-to-cart, .cart-link, .mini-cart a.icon-link, .quick-cart__indicator, .add-to-cart-box, .header-wrapper .mini-cart, .woodmart-add-btn,.ajax-cart.ajax-cart--drawer, #custom_atc_button, .header-middle .mini-cart, #mini-cart-toggle a.head-slot-nav-link.head-slot-cart-link, .quick-add__submit, .header__icon--cart, .product-form__buttons.w3_bg .button--secondary.button--full-width,.product-form__buttons button[name="add"], .button--add-to-cart, .product-form__add-button.button--primary, .purchase-details__buttons button[name="add"],.header-cart-details, .btn-get-your-now.js-product-atc,.quantity-submit-row__submit.input-row',t.helper.mouseOverAjaxCart=".icon-cart-header, .woodmart-cart-wrapper, .icon.header__icon, .top-cart-holder.hover-dropdown, .header__action-list .header__action-item--cart",t.helper.checkoutBtnCartPage='a.button.checkout-button[href="/checkout"],form[action*="/checkout"] .add_to_cart,form[action*="/cart"]#cart_form #checkout,form[action*="/cart"] button.Cart__Checkout,form[action*="/cart"] button.cart__checkout,form[action*="/cart"] [name="checkout"][type="submit"],form[action*="/cart"] button[type="submit"].c-btn.c-btn--light.cart__button-update.update-cart,form[action*="/cart"] .sp-proceed-to-checkout a[href="/checkout/"],form[action*="/cart"] div.cart__checkout:not(.bss-fix-nt),button.Cart__Checkout.Button.Button--primary.Button--full,button[name="checkout"].btn,form[action*="/checkout"] [name="checkout"],.cart__footer .cart__checkout-button.button,#cartform #checkout,.button.checkout,.bss-b2b-customer-portal-nt-checkout-btn,.checkout-button.button.button--primary.button--full,.button.cursor-pointer[name="checkout"],#CartDrawer-Checkout,#cart-checkout,#checkout,#CheckOut,div.push-btn.inline-block,[name="checkout"],form[action="/checkout"] [type="submit"]',t.helper.CheckoutBtnDefaultQuery='form[action*="/cart"] [name="checkout"],#dropdown-cart button.btn.btn-checkout.show,a.button.checkout-button[href="/checkout"],form[action*="/checkout"] .add_to_cart,form[action*="/cart"]#cart_form #checkout,form[action*="/cart"] button.Cart__Checkout,form[action*="/cart"] button.cart__checkout,a.btn.disabled.ttmodalbtn[href="/checkout"],form[action*="/cart"] [name="checkout"][type="submit"],button.Cart__Checkout.Button.Button--primary.Button--full,.baskettop button.mini-cart-checkout,.tt-dropdown-menu .btn.itemCheckout,.bss-btn-checkout-mini-cart,button[name="checkout"].btn,form[action*="/checkout"] [name="checkout"],.cart__footer .cart__checkout-button.button,#cartform #checkout,#slidedown-cart button[onclick="window.location=\'/checkout\'"],#dropdown-cart button.btn.btn-checkout,.button.checkout,form[action*="/cart"] button[type="submit"].c-btn.c-btn--light.cart__button-update.update-cart,form[action*="/cart"] .sp-proceed-to-checkout a[href="/checkout/"],.bss-b2b-customer-portal-nt-checkout-btn,.checkout-button.button.button--primary.button--full,.button.cursor-pointer[name="checkout"],form[action="/cart/add"] .product-form--atc .shopify-payment-button button.shopify-payment-button__button,form[action*="/cart"] div.cart__checkout,form[action*="/cart"] a[href="/cart"],#header-mini-cart-footer > div > div.mini-cart-footer-actions > a,#cart-checkout,#CartDrawer-Checkout,#checkout,#CheckOut,div.push-btn.inline-block,.\\#cart-sidebar-checkout .\\#button,form[action="/cart"] .\\#button,.button.add_to_cart.checkout,form[action="/checkout"] [type="submit"],.group-button.pt-1 .check-out.btn.btn-primary,.subtotal-title-area [href="/checkout"]',t.helper.miniCartBtn='.cart-popup a[href*="/cart"], #CartDrawer button[type="submit"], #ajaxifyCart button[type="submit"],.button.checkout.wc-forward, .off-canvas--right-sidebar button[type="submit"][name="checkout"], .atc-banner--cart,.button-primary.atc-button--checkout, .modal-footer .btn.btn-success.calltoaction.npopup-checkout, .button-group.button-group--loose.button-group--fit,.btn.accent.cart__checkout, .rebuy-cart__flyout .rebuy-button.rebuy-cart__checkout-button, .mini-cart__footer .button-container button,.Cart.Drawer__Content .Drawer__Footer button.Cart__Checkout.btn--primary, form[action="/cart"] button[type="submit"], .header-wrapper .mini-cart a[href*="/checkout"], .header-middle .mini-cart a[href*="/checkout"],[name="checkout"], .ajax-success-modal.halo-modal a.btn.btn-checkout.show,.checkout-buttons,#cart-sidebar-checkout',t.helper.btnViewCart='form[action="/cart"] button[type="submit"], .cart-popup a[href*="/cart"], #CartDrawer button[type="submit"],#ajaxifyCart button[type="submit"], .header-wrapper .mini-cart a[href*="/checkout"], .header-middle .mini-cart a[href*="/checkout"],.button.checkout.wc-forward, [name="checkout"], .ajax-success-modal.halo-modal a.btn.btn-checkout.show, .rebuy-cart__flyout .rebuy-button.rebuy-cart__checkout-button',t.helper.addToCartVoDefault="#shopify-section-product-template #AddToCart, .template-product .product-form__cart-submit, .template-product .product__content-main .btn.btn--full.product__add-to-cart-button.shopify-payment-btn,#shopify-section-product-template .grid .grid-item.large--three-fifths #addToCart-product-template, #shopify-section-product-template #ProductSection--product-template #AddToCartForm--product-template #AddToCart--product-template,#shopify-section-product-template .product .product__details.grid__item #AddToCart-product-template, .product.product--template .product__sticky .product-form__buttons .product-form__add-to-cart.button,.page-width .product__info-container.product__info-container--sticky .product-form__buttons .product-form__submit.button, .page-width .product__info-container.product__column-sticky .product-form__buttons .product-form__submit.button,.template-product .product-single__info-wrapper #AddToCart-product-template, .product-content-container .product-block-area .shopify-product-form .add-to-cart-container #addToCartButton, .bss-bcp-vo-add-to-cart",t.helper.productFormVoDefault=".template-product .product-single__meta .product-form.product-form-product-template, #shopify-section-product-template .product-single__title,.template-product .product-single__title, .template-product #shopify-section-product-template .product__content-main .product-form, #shopify-section-product-template .grid .grid-item.large--three-fifths h1.h2,#shopify-section-product-template #ProductSection--product-template h1.product-single__title, #shopify-section-product-template .product .product__details.grid__item h1.h2,.product.product--template .product__sticky h1#ProductHeading, .page-width .product__info-container.product__info-container--sticky h1.product__title, .template-product .product-single__info-wrapper .product-single__title,#product-form-installment, .product__title, .product-content-container .product-block-area .shopify-product-form",t.helper.productPriceVoDefault=".template-product .product__price, #shopify-section-product-template .product-single__prices, #shopify-section-product-template .grid .grid-item.large--three-fifths ul.inline-list.product-meta,#shopify-section-product-template #ProductSection--product-template .price-container, #shopify-section-product-template .product .product__details.grid__item .product__price,.product.product--template .product__sticky dl.price, .page-width .product__info-container.product__info-container--sticky .price, .page-width .product__info-container.product__column-sticky .price,.template-product .product-single__info-wrapper .product-single__meta-list, .product__variants",t.helper.variantChoiceVoDefault=".template-product .product-form__controls-group .selector-wrapper.js.product-form__item, #shopify-section-product-template .product-form--wide .selector-wrapper,.template-product #ProductSection .grid.product-single .product-single__meta .product-form, .template-product .product__content-main .product-form .product-form__item.supports-js,#shopify-section-product-template .grid .grid-item.large--three-fifths .selector-wrapper, #shopify-section-product-template #ProductSection--product-template #AddToCartForm--product-template .radio-wrapper.js.product-form__item,#shopify-section-product-template .product .product__details.grid__item .selector-wrapper, .product.product--template .product__sticky .product-form__select.form__input-wrapper.form__input-wrapper--select,.page-width .product__info-container.product__info-container--sticky variant-radios, .page-width .product__info-container.product__column-sticky variant-radios,.page-width .product__info-container.product__info-container--sticky .product-form__input.product-form__quantity, .template-product .product-single__info-wrapper .selector-wrapper.js.product-form__item,.template-product .product-single__info-wrapper .product-form__item.product-form__item--quantity, .product-form__action-wrapper .product-form--atc-button",t.helper.productQuantityVoDefault='form[action*="/cart/add"] .product-form__item, .product-form__input.product-form__quantity, .product-form__action-wrapper .quantity-selector__wrapper',t.helper.getAddToCartDefault=function(){return document.querySelectorAll('.productView-action,#shopify-section-product-template #AddToCart,.template-product .product-form__cart-submit,.template-product .product__content-main .btn.btn--full.product__add-to-cart-button.shopify-payment-btn,#shopify-section-product-template .grid .grid-item.large--three-fifths #addToCart-product-template,#shopify-section-product-template #ProductSection--product-template #AddToCartForm--product-template #AddToCart--product-template,#shopify-section-product-template .product .product__details.grid__item #AddToCart-product-template,.product.product--template .product__sticky .product-form__buttons .product-form__add-to-cart.button,.page-width .product__info-container.product__info-container--sticky .product-form__buttons .product-form__submit.button,.template-product .product-single__info-wrapper #AddToCart-product-template,.product-content-container .product-block-area .shopify-product-form .add-to-cart-container #addToCartButton,.product-form--atc .product-form--atc-button,.product_single_detail_section #AddToCart,.product-form-product--static .product-form__controls-group--submit .product-form__submit-button-wrapper .product-form__cart-submit,.buy-buttons-row .button.button--large[type="submit"],.tab-body .purchase-section button.btn.add-to-cart,.product-form .product-form__payment-container,.action_button.button--add-to-cart,product-form div:nth-child(6) div button[type="submit"],.product-form__submit.button.button--full-width.button--secondary,.quick-add__submit.button.button--full-width.button--secondary,product-form product-to-cart,.button.button-add-to-cart.button-secondary,.add_to_cart.global-button.global-button--primary.ajax-submit,.product-form__buttons .product-form__buttons-row .product-form__submit.button,[id^="x-atc-button"],.quantity-submit-row__submit.input-row,.ecom-product-single__add-to-cart--submit,.tt-product-single-info div.tt-row-custom-01 div:nth-child(2) button,.product-wrapper form[action="/cart/add"] .form-group button.btn.btn-add-to-cart,form[action="/cart/add"] button[type="submit"]#AddToCart,form[action="/cart/add"] button[name="add"],form[data-type="add-to-cart-form"] button[name="add"][type="submit"]')},t.helper.AddToCartDefaultElement='#shopify-section-product-template #AddToCart,.template-product .product-form__cart-submit,.template-product .product__content-main .btn.btn--full.product__add-to-cart-button.shopify-payment-btn,#shopify-section-product-template .grid .grid-item.large--three-fifths #addToCart-product-template,#shopify-section-product-template #ProductSection--product-template #AddToCartForm--product-template #AddToCart--product-template,#shopify-section-product-template .product .product__details.grid__item #AddToCart-product-template,.product.product--template .product__sticky .product-form__buttons .product-form__add-to-cart.button,.page-width .product__info-container.product__info-container--sticky .product-form__buttons .product-form__submit.button,.template-product .product-single__info-wrapper #AddToCart-product-template,.product-content-container .product-block-area .shopify-product-form .add-to-cart-container #addToCartButton,.product-form--atc .product-form--atc-button,.product_single_detail_section #AddToCart,.product-form-product--static .product-form__controls-group--submit .product-form__submit-button-wrapper .product-form__cart-submit,.buy-buttons-row .button.button--large[type="submit"],.tab-body .purchase-section button.btn.add-to-cart,.product-form .product-form__payment-container,.action_button.button--add-to-cart,product-form div:nth-child(6) div button[type="submit"],.product-form__submit.button.button--full-width.button--secondary,.quick-add__submit.button.button--full-width.button--secondary,.quick-add.no-js-hidden [bss-bcp-quote-product-price]',t.helper.getBuyItNowBtn=function(){return document.querySelectorAll(t.helper.buyItNowtElements)},t.helper.buyItNowtElements='.template-product .shopify-payment-button .shopify-payment-button__button--unbranded:not([disabled]),.page-width .product__info-container.product__info-container--sticky .product-form__buttons .shopify-payment-button,.template-product .product-single__info-wrapper .shopify-payment-button,.product-form--atc .shopify-payment-button,.purchase-section .bottompad-half div[data-shopify="payment-button"],.shopify-payment-button, form[action="/cart/add"] .product-form__button',t.helper.buyItNowBtnForVO=".shopify-payment-button__button",t.helper.featuredCollectionSelector=function(){return document.querySelectorAll(".product-recommendations--section [bss-bcp-quote-product-price],.product-recommendations [bss-bcp-quote-product-price],.product-recently-viewed--section [bss-bcp-quote-product-price],.related-products-wrapper [bss-bcp-quote-product-price],.featured-product [bss-bcp-quote-product-price], .collection [bss-bcp-quote-product-price],.product-recommendations [bss-bcp-quote-product-price],.related-products-wrapper [bss-bcp-quote-product-price],.productgrid--item [bss-bcp-quote-product-price]")},t.helper.recommendedProductSelector=function(){return document.querySelectorAll(".product-recommendations--section [bss-bcp-quote-product-price],.product-recommendations [bss-bcp-quote-product-price],.product-recently-viewed--section [bss-bcp-quote-product-price],.related-products [bss-bcp-quote-product-price]")},t.page={},t.page.getPage=function(){return window.location.href.split("/")},t.page.isCartPage=function(){var e=t.page.getPage();return"cart"==e[e.length-1]||e[e.length-1].includes("cart")&&"products"!==e[e.length-2]&&"collections"!==e[e.length-2]},t.page.isCollectionPage=function(){var e=t.page.getPage();return"collections"==e[e.length-2]},t.page.isProductPage=function(){var e=t.page.getPage();return"products"==e[e.length-2]},t.page.isSearchPage=function(){return"/search"==window.location.pathname},t.page.isHomePage=function(){return"/"==window.location.pathname},t.getItemCartMetaField=async()=>{let e=null;if(t.page.isCartPage()){let t={};document.querySelector(".bss-b2b-cart-metafield")&&(t=JSON.parse(document.querySelector("#bss-bcp-store-data").innerHTML)),t.cart&&await Promise.all(t.cart.items.map((async t=>{try{const o=await fetch(t.url,{method:"GET",headers:{"Content-Type":"application/json"}}),n=await o.text(),r=(new DOMParser).parseFromString(n,"text/html");e=JSON.parse(r.querySelector("#bss-b2b-store-data").innerHTML)}catch(t){console.log("Error:",t)}})))}return e},t.helper.getQuotePriceList=function(){return document.querySelectorAll(t.helper.quotePriceListElements)},t.helper.quotePriceListElements="[bss-bcp-quote-product-price],.price,.product-price,.product-block-price,.product__price,.price-item,.price-item--regular,.price-item--sale,.price-sale,.price--sale",t.helper.parentProductPage='product-info,[id*="ProductInfo"],[class*="product-info"],[class*="product__info"]',t.helper.productPageTitle='[class*="product"][class*="title"],.title,.product-title,.product-block-title,.product__title,.product-meta__title',t.helper.productPageVariantPicker='variant-selects,[id^="variant-selects"],variant-radios,[id^="variant-radios"],variant-picker,.variant-picker',t.helper.productPageQuantityInput='input[type="number"][name="quantity"],input[type="number"][data-quantity-input],input[type="number"][class$="quantity"],input[id^="Quantity"],input[name="quantity"],input.quantity-selector__input'}(BSS_BCP),function(t,e){e.money_format=t.shop.money_format,e.formatMoney=function(t,o){"string"==typeof t&&(t=t.replace(".",""));let n="",r=/\{\{\s*(\w+)\s*\}\}/,a=o||e.money_format||this.money_format,c=["","","
","
","",""];for(let t=0;t{g[t.key]=t.value}));let y=a.page.isProductPage(),S=a.page.isCollectionPage(),w=a.page.isHomePage(),B=a.page.isSearchPage(),C=a.page.isCartPage(),v=l?l.split(","):[],q=u?u.split(","):[],k=d?d.split(","):[],P=p?p.split(","):[],E=m?m.split(","):[];a.quote.handleGetQuantity=function(){let t=1,e=document.querySelectorAll('input[type="number"][name="quantity"],input[type="number"][data-quantity-input],input[type="number"][class$="quantity"],input[id^="Quantity"],input[name="quantity"]');return e&&e.length&&(t=e[e.length-1].value),t},a.quote.handleCheckCustomer=function(){let t=!1;return 0==h?null==i?t=!1:-1!==v.indexOf(i+"")&&(t=!0):1==h?null==s?t=!1:0!=s.filter((t=>k.includes(t+""))).length&&(t=!0):2==h?null!=i&&(t=!0):3==h&&(t=!0),t};const I=()=>{let t=document.querySelectorAll("[bss-bcp-quote-product-price]");t.length&&t.forEach((t=>t.setAttribute("style","visibility: visible !important")))};a.quote.handleCheckProductQuote=function(t){let e=!1,o=t.id,n=t.collections,r=t.tags;return 0==b?e=!0:1==b?q.length&&null!=o&&-1!==q.indexOf(o+"")&&(e=!0):2==b?m.length&&n.length&&n.filter((t=>E.includes(t+""))).length>0&&(e=!0):3==b&&r&&r.length&&r.filter((t=>P.includes(t+""))).length>0&&(e=!0),e},a.quote.renderQuoteCartItem=function(t,e,o){let n=null;return e&&e.image?n=e.image:t&&t.featureImage&&(n=t.featureImage),{productId:t.id,productTitle:t.title,variantId:e.id,variantTitle:e.title,featureImage:n,price:e.price,requiresShipping:e.requires_shipping,quantity:o,productTags:t.tags,productCollections:t.collections}};let x=a.quote.handleCheckCustomer();if(x){let t=document.querySelector("body"),e=document.createElement("div");e.setAttribute("class","bss-quote-cart-icon"),e.innerHTML="🛒",t&&(t.append(e),e.onclick=function(){window.location="/apps/customer-portal/r4q/quote-cart"})}y&&x&&null!=c&&(1703===a.storeId||3353===a.storeId?setTimeout((()=>{r(0,a,f,_,g)}),2e3):function(t,o,r,a,c){const i=t.product?t.product.id:null;let s=null,l=encodeURI(`/search.js?q=id:${i}&view=bss.bcp`);fetch(l,{method:"GET"}).then((function(t){if(!t.ok)throw new Error("HTTP error, status = "+t.status);return t.json()})).then((function(l){if(l.length>0)if(s=l[0],o.quote.handleCheckProductQuote(s)){let l=null,u=o.helper.getAddToCartDefault(),d=o.helper.getBuyItNowBtn(),p=100;938===o.storeId&&(p=5);let m=setInterval((function(){if(d&&d.length){if(r&&r.hide_buy_it_now&&d&&d.length)for(let t=0;t{let t=l[0].querySelectorAll(".bss-b2b-customized-compare-at-price ,.bss-b2b-customized-original-price");if(t.length){for(let e=0;e{clearInterval(o)}),3e3)}else if(r&&!r.hide_price){let t=document.querySelectorAll(o.helper.quotePriceListElements);t.length&&t.forEach((t=>t.setAttribute("style","visibility: visible !important")))}o.helper.handleChangeVariant(r,!1,l[0])}let h=document.createElement("div"),f=document.createTextNode(c.add_to_quote);h.setAttribute("class","bss-bcp-add-to-quote-btn"),h.appendChild(f);let _=a.textSettings,g=a.btnSettings;if(_)if(0===_.editorMode){if(h.style.justifyContent="center"==_.alignment?_.alignment:"left"==_.alignment?"start":"end",h.style.fontSize=`${_.fontSize}px`,_.textFormat?.includes("bold")&&(h.style.fontWeight="bold"),_.textFormat?.includes("italic")&&(h.style.fontStyle="italic"),_.textFormat?.includes("underline")&&(h.style.textDecoration="underline"),_.textColor){const{red:t,alpha:e,blue:o,green:n}=_.textColor;h.style.color=`rgba(${t}, ${n}, ${o}, ${e})`}}else if(_.customCss){let t=document.getElementById("bss-bcp-r4q-custom-text-style");t||(t=document.createElement("style"),t.id="bss-bcp-r4q-custom-text-style",document.head.appendChild(t)),t.innerHTML=_.customCss}if(g)if(0===g.editorMode)g.btnColor&&(h.style.backgroundColor=`\n rgba(${g.btnColor.red}, \n ${g.btnColor.green}, \n ${g.btnColor.blue}, \n ${g.btnColor.alpha})`),g.borderThickness&&g.outlineColor&&(h.style.border=`\n ${g.borderThickness}px solid \n rgba(${g.outlineColor.red}, \n ${g.outlineColor.green}, \n ${g.outlineColor.blue}, \n ${g.outlineColor.alpha})`),g.cornerRadius&&(h.style.borderRadius=`${g.cornerRadius}px`);else if(g.customCss){let t=document.getElementById("bss-bcp-r4q-custom-btn-style");t||(t=document.createElement("style"),t.id="bss-bcp-r4q-custom-btn-style",document.head.appendChild(t)),t.innerHTML=_.customCss}let y=document.createElement("div"),S=`
\n ×\n
\n
${c.continue_shopping}
\n
${c.view_quote}
\n
`;S=window.BSS_BCP.executeFilter({tag:"custom_quote_modal_content",storeId:!1,val:S,translations:c,currentProduct:s}),y.setAttribute("class","bss-quote-modal"),y.setAttribute("id","bss-quote-modal-id"),y.innerHTML=S;let w="body";document.querySelector(w).after(y);let B=document.querySelector("#bss-quote-view-quote-cart"),C=document.getElementById("bss-quote-modal-id"),v=document.getElementsByClassName("bss-quote-modal-close")[0],q=document.querySelector("#bss-quote-continue-shopping"),k=document.querySelector("#bss-quote-modal-text");h.onclick=function(){!function(r,a,s,l){r.style.display="block";let u=o.helper.handleGetVariantId(),d=parseInt(o.quote.handleGetQuantity());u&&s&&s.variants&&s.variants.length&&s.variants.map((t=>{t.id==u&&(l=t)})),u=u?u.toString():null;let p=window.localStorage.getItem("bssQuoteCart")?JSON.parse(window.localStorage.getItem("bssQuoteCart")):[],m=window.localStorage.getItem("bssListVariantQuoteCart")?JSON.parse(window.localStorage.getItem("bssListVariantQuoteCart")):[];window.localStorage.getItem("bssQuoteCart")||window.localStorage.setItem("bssQuoteCart",""),window.localStorage.getItem("bssListVariantQuoteCart")||window.localStorage.setItem("bssListVariantQuoteCart","");let b=!1;if(o.vo.isEnable){let r=e(o,t.customer);r=n(r,i,t.product_collections,t.product.tags),b=r.length}if(s&&l&&u){let t={},e=[];if(p&&p.length&&m&&m.length&&!o.vo.isEnable)if(m.includes(u))for(let t=0;t{const n=document.getElementById(`${e.id}`);if(n&&+n.value>0)return t=o.quote.renderQuoteCartItem(s,e,+n.value),p.push(t),m.push(e.id.toString()),e})).map((t=>t.title)):(t=o.quote.renderQuoteCartItem(s,l,d),m.push(u),p.push(t));window.localStorage.setItem("bssQuoteCart",JSON.stringify(p)),window.localStorage.setItem("bssListVariantQuoteCart",JSON.stringify(m)),a.innerHTML=o.vo.isEnable?`

${c.the_product} ${s.title} ${e} ${c.added_to_quote}.

`:`

${c.the_product} ${s.title+" "+l.title} ${c.added_to_quote}.

`}}(y,k,s,null)},B&&(B.onclick=function(){window.location="/apps/customer-portal/r4q/quote-cart"}),v&&(v.onclick=function(){y.style.display="none"}),q&&(q.onclick=function(){y.style.display="none"}),window.onclick=function(t){t.target==C&&(y.style.display="none")};let P=a.positionSettings.isDisplayOnProductPage,E=a.positionSettings.displayOnProductPagePosition,I=document.querySelectorAll(o.helper.parentProductPage);if(I&&I.length||console.error("BSS BCP: Can not find product wrapper elements"),I&&I.length&&P&&0==E){let t=I[0].querySelectorAll(o.helper.productPageTitle);t=window.BSS_BCP.executeFilter({tag:"custom_product_page_title",storeId:!1,val:t,productTitleElements:t}),t&&t.length?t[0].after(h):console.error("BSS BCP: Can not find product title elements")}else if(I&&I.length&&P&&2==E){let t=I[0].querySelectorAll(o.helper.productPageVariantPicker);t=window.BSS_BCP.executeFilter({tag:"custom_product_page_variant",storeId:!1,val:t,productVariantElements:t}),t&&t.length?t[0].after(h):console.error("BSS BCP: Can not find product variant picker elements")}else if(I&&I.length&&P&&3==E){let t=I[0].querySelectorAll(o.helper.productPageQuantityInput);t=window.BSS_BCP.executeFilter({tag:"custom_product_page_quantity",storeId:!1,val:t,productQuantityElements:t}),t&&t.length?t[0].closest(".product-form__input,.product-form__quantity,.product-form-input,.product-input").after(h):console.error("BSS BCP: Can not find product quantity input elements")}else if(I&&I.length&&P&&1==E){let t=I[0].querySelectorAll(o.helper.quotePriceListElements);t=window.BSS_BCP.executeFilter({tag:"custom_product_page_price",storeId:!1,val:t,productPriceElements:t}),t&&t.length?t[0].after(h):console.error("BSS BCP: Can not find product price elements")}else if(P&&4==E){let t=document.querySelectorAll('form[action*="/cart/add"]'),e=!1;if(u=window.BSS_BCP.executeFilter({tag:"custom_quote_add_to_cart_default",storeId:!1,val:u,BSSQuoteAddToCartDefault:u}),t=window.BSS_BCP.executeFilter({tag:"custom_quote_add_to_cart_customize_cart_form",storeId:!1,val:t,cartForm:t}),t&&t.length&&u&&u.length){console.log("BSSQuoteAddToCartDefault",u);for(let t=0;t{document.querySelector(".bss-b2b-customer-portal-variants-order-btn")?(document.querySelector(".bss-b2b-customer-portal-variants-order-btn").after(h),clearInterval(e)):(u[t].after(h),clearInterval(e))}),3e3);break}P&&4==E&&u[t].after(h),e=!0,[3825].includes(o.storeId)&&(e=!1)}}if(r&&r.hide_cart){u[t].classList.add("bss-bcp-quote-hide-add-to-cart"),u[t].after(h),e=!0;break}}}else console.error("BSS BCP: Can not find cart form elements or add to cart button")}}else{let t=document.querySelectorAll(o.helper.quotePriceListElements);t.length&&t.forEach((t=>t.setAttribute("style","visibility: visible !important")))}else console.log("No data")})).catch((function(t){console.log("No! Something error:",t)}))}(o,a,f,_,g));let T=(C||y)&&x;if([2083,4133,4196].includes(a.storeId)&&(T=x),T){if(setTimeout((()=>{t(0,a,0,g)}),1e3),[2083,3429].includes(a.storeId)){const e=document.querySelector("#site-cart-sidebar , .cart-section, .cart-drawer__form");if(e){const o=e.querySelector("#AjaxCartForm, .cart-items");new MutationObserver((o=>{o.forEach((o=>{"childList"===o.type&&(e.querySelector(".bss-b2b-customer-portal-btn-quote-default")||setTimeout((()=>{t(0,a,0,g)}),500))}))})).observe(o,{childList:!0})}}if([2094,1532,2688,4196].includes(a.storeId)){let e=a.helper.getAddToCartDefault(),o=1e3;4196===a.storeId&&(o=2e3),e.length&&e.forEach((e=>{e.addEventListener("click",(()=>{setTimeout((()=>{t(0,a,0,g)}),o)}))}))}window.BSS_BCP.executeAction({tag:"custom_show_r4q",storeId:3813,applyCartPage:t,quoteConfig:f,translations:g,shopData:o})}else{const t=document.querySelector(".bss-bcp-customer-portal-btn-quote-default-app-block");t&&t.remove()}if((S||B||w||y&&3472===a.storeId||2095===a.storeId&&window.location.pathname.includes("/page"))&&x&&([1858,3472].includes(a.storeId)?setTimeout((function(){r(0,a,f,_,g)}),{1858:1500,3472:3e3}[a.storeId]):r(0,a,f,_,g)),window.BSS_BCP.executeAction({tag:"custom_apply_collection_page_quote",applyCollectionPage:r,quoteConfig:f,translations:g,shopData:o}),x||I(),y){let t=a.helper.featuredCollectionSelector();t&&t.length&&x&&r(0,a,f,_,g,t);const e=window.innerHeight,o=e,n=e,c=()=>{let t=window.scrollY;t>=0&&t=o&&t=o+n&&document.body.clientHeight,(()=>{let t=a.helper.recommendedProductSelector();t&&t.length&&(x?r(0,a,f,_,g,t):I(),window.removeEventListener("scroll",c))})()};window.addEventListener("scroll",c)}}(o,BSS_BCP)),c&&(BSS_BCP.netterm={},q(o,BSS_BCP)),i&&"product"===o.template&&o.product.variants.length>1&&D(o,BSS_BCP),s&&function(t,e){const o=e.ca.orderMarkingType,n=e.ca.listSubUser,r=e.ca.shareCartText,a=t.customer;if(o===j.CompanyOrderMarkingType.MANUAL&&-1!=n.indexOf(a.email)){let t=document.querySelectorAll(e.helper.CheckoutBtnDefaultQuery);const o=r||"Share to company";"thorkitchenvendorportal-com.myshopify.com"===Shopify.shop&&"/cart"===window.location.pathname&&document.querySelectorAll('input.btn.btn-checkout[type="submit"]');const n=document.createTextNode(o);let a=document.createElement("button");a.className="bss-b2b-customer-portal-share-cart-btn-default",a.style.width="130px",a.style.height="40px",a.type="button",a.appendChild(n),a.onclick=function(){window.location="/apps/customer-portal/company-account/share-cart"};const c=t=>{const e=document.querySelector(".bss-bcp-customer-portal-share-cart-btn-app-block");if(t.length)for(let n=0;n{window.location="/apps/customer-portal/company-account/share-cart"},t[n].after(e)}};fetch("/cart.js",{method:"GET"}).then((function(t){if(!t.ok)throw new Error("HTTP error, status = "+t.status);return t.json()})).then((function(e){if(e.items.length){const e=document.querySelectorAll("[bss-b2b-customer-portal-share-cart]");t.length?c(t):e.length&&c(e)}})).catch((function(t){console.log("Error:",t)}));const i=document.querySelectorAll(e.helper.ajaxCartElement),s=t=>{const e=document.createTextNode(o),n=document.createElement(t.tagName);n.className=`${t.className||""} bss-b2b-customer-portal-ca-checkout-btn`,n.value=o,n.id=t.id,n.type="button",n.appendChild(e),n.onclick=()=>{window.location="/apps/customer-portal/company-account/share-cart"},t.after(n)},l=()=>{let t=document.querySelectorAll('.cart-popup a[href*="/cart"], #CartDrawer button[type="submit"], #ajaxifyCart button[type="submit"], .header-wrapper .mini-cart a[href*="/checkout"], .header-middle .mini-cart a[href*="/checkout"], .group-button.pt-1 .check-out.btn.btn-primary');t=window.BSS_BCP.executeFilter({tag:"custom_cart_buttons_mini_cart",storeId:2691,val:t,cartButtons:t});const e=document.querySelector(".bss-bcp-customer-portal-share-cart-btn-app-block");if(t.length)for(let o=0;o{i.forEach((t=>{t.addEventListener("click",(()=>{setTimeout((()=>{l()}),2e3)}))}))};document.querySelectorAll(".icon-cart-header").forEach((t=>{t.addEventListener("mouseover",(()=>{setTimeout((()=>{l()}),200)}))})),u()}else{const t=document.querySelector(".bss-bcp-customer-portal-share-cart-btn-app-block");t&&t.remove()}}(o,BSS_BCP)}()})()})();