PageSourceSearch

https://www.westcoastseeds.com/cdn/shop/t/205/compiled_assets/scripts.js?v=23976290576380295661787948487

js westcoastseeds.com collected 2026-09-24 08:53:19 UTC 13,637 bytes, 2 lines download raw bytes

1(function(){var __sections__={};(function(){for(var i=0,s=document.getElementById("sections-script").getAttribute("data-sections").split(",");i<s.length;i++)__sections__[s[i]]=!0})(),(function(){if(__sections__["blog-tag-filter"])try{$(".article-filters .filter-block").each(function(){$(this).children("ul").children("li").length<1&&$(this).hide()});var acc=document.getElementsByClassName("accordion"),openInit=document.getElementsByClassName("open"),i;for(i=0;i<acc.length;i++)acc[i].addEventListener("click",function(){this.classList.toggle("active");var panel=this.nextElementSibling;panel.classList.contains("open")?(panel.classList.toggle("open"),panel.style.maxHeight=null):(panel.style.maxHeight=panel.scrollHeight+"px",panel.classList.toggle("open"))});for(i=0;i<openInit.length;i++)openInit[i].style.maxHeight=openInit[i].scrollHeight+"px"}catch(e){console.error(e)}})(),(function(){if(__sections__["cart-drawer"])try{let updateNoteCounterOnLoad2=function(){const target=noteTextArea,maxLength=target.getAttribute("maxlength"),currentLength=target.value.length;currentLength>=maxLength?noteAlerts.innerHTML="You have reached the maximum number of characters.":noteAlerts.innerHTML="",noteCounters.innerHTML=`${currentLength}/${maxLength}`};var updateNoteCounterOnLoad=updateNoteCounterOnLoad2,lastNoteVal="",saveCartNoteTimer=null;$("#CartSpecialInstructions").on("change keyup paste mouseup",function(e){var noteValue=$(this).val();noteValue!=lastNoteVal&&(lastNoteVal=noteValue,window.clearTimeout(saveCartNoteTimer),saveCartNoteTimer=window.setTimeout(function(){jQuery.ajax({type:"POST",url:window.Shopify.routes.root+"cart/update.js",data:{note:noteValue},dataType:"json"}),console.log("Note set!")},350),!CartJS.getAttribute("Note Subject")&&noteValue!=""&&(CartJS.setAttribute("Note Subject",$("#whats-the-subject-of-your-note").val()),console.log("no note subject, setting to: ",$("#whats-the-subject-of-your-note").val())))}),$(document).on("change","#what-type-of-gardener-are-you",function(){CartJS.setAttribute("Customer Type",$(this).val()),console.log("Attribute set!")}),$(document).on("change","#whats-the-subject-of-your-note",function(){CartJS.setAttribute("Note Subject",$(this).val()),console.log("Note subject set!")});const noteTextArea=document.querySelector("textarea#CartSpecialInstructions"),noteCounters=document.querySelector(".note-counter"),noteAlerts=document.querySelector(".note-alert"),updateNoteCounter=()=>{const target=noteTextArea,maxLength=target.getAttribute("maxlength"),currentLength=target.value.length;currentLength>=maxLength?noteAlerts.innerHTML="You have reached the maximum number of characters.":noteAlerts.innerHTML="",noteCounters.innerHTML=`${currentLength}/${maxLength}`};noteTextArea.addEventListener("input",updateNoteCounter),$(document).ready(function(){updateNoteCounterOnLoad2()}),document.querySelector("#clearcart").addEventListener("click",function(e){confirm("Are you sure you want to remove everything from your cart?")==!0&&$(document).trigger("cart.drawerClearRequested")})}catch(e){console.error(e)}})(),(function(){if(__sections__["collection-tag-filter"])try{$(".catalog-filters .filter-block").each(function(){$(this).children("ul").children("li").length<1&&$(this).hide()});var acc=document.getElementsByClassName("accordion"),openInit=document.getElementsByClassName("open"),i;for(i=0;i<acc.length;i++)acc[i].addEventListener("click",function(){this.classList.toggle("active");var panel=this.nextElementSibling;panel.classList.contains("open")?(panel.classList.toggle("open"),panel.style.maxHeight=null):(panel.style.maxHeight=panel.scrollHeight+"px",panel.classList.toggle("open"))});for(i=0;i<openInit.length;i++)openInit[i].style.maxHeight=openInit[i].scrollHeight+"px"}catch(e){console.error(e)}})(),(function(){if(__sections__.footer)try{class LocalizationForm extends HTMLElement{constructor(){super(),this.elements={input:this.querySelector('input[name="language_code"], input[name="country_code"]'),button:this.querySelector("button"),panel:this.querySelector("ul")},this.elements.button.addEventListener("click",this.openSelector.bind(this)),this.elements.button.addEventListener("focusout",this.closeSelector.bind(this)),this.addEventListener("keyup",this.onContainerKeyUp.bind(this)),this.querySelectorAll("a").forEach(item=>item.addEventListener("click",this.onItemClick.bind(this)))}hidePanel(){this.elements.button.setAttribute("aria-expanded","fal
1se"),this.elements.panel.setAttribute("hidden",!0)}onContainerKeyUp(event){event.code.toUpperCase()==="ESCAPE"&&(this.hidePanel(),this.elements.button.focus())}onItemClick(event){event.preventDefault();const form=this.querySelector("form");this.elements.input.value=event.currentTarget.dataset.value,form&&form.submit()}openSelector(){this.elements.button.focus(),this.elements.panel.toggleAttribute("hidden"),this.elements.button.setAttribute("aria-expanded",(this.elements.button.getAttribute("aria-expanded")==="false").toString())}closeSelector(event){const shouldClose=event.relatedTarget&&event.relatedTarget.nodeName==="BUTTON";(event.relatedTarget===null||shouldClose)&&this.hidePanel()}}customElements.define("localization-form",LocalizationForm)}catch(e){console.error(e)}})(),(function(){if(!(!__sections__["header-menu-best-sellers"]&&!Shopify.designMode))try{const bestSellerLinks=document.querySelectorAll(".best-seller-link"),bestSellerPlaceholder=document.getElementById("bestseller-img"),bestSellerImg=document.getElementById("bs-img"),bestSellerTitle=document.getElementById("bs-title"),bestSellerLink=document.getElementById("bs-link");for(let link of bestSellerLinks)link.addEventListener("mouseover",function(e){let prodImg=link.dataset.imgUrl,prodTitle=link.textContent.split("-")[0],prodUrl=link.dataset.prodUrl;bestSellerImg.src=prodImg,bestSellerTitle.textContent=prodTitle,bestSellerLink.href=prodUrl})}catch(e){console.error(e)}})(),(function(){if(__sections__.header)try{let getTimeRemaining2=function(endtime){const total=Date.parse(endtime)-Date.parse(new Date),seconds=Math.floor(total/1e3%60),minutes=Math.floor(total/1e3/60%60),hours=Math.floor(total/(1e3*60*60)%24),days=Math.floor(total/(1e3*60*60*24));return{total,days,hours,minutes,seconds}},initializeClock2=function(id,endtime){console.log("initilizing timer with endtime: ",endtime);const clock=document.getElementById(id);clock.style.display="block";const daysSpan=clock.querySelector(".days"),hoursSpan=clock.querySelector(".hours"),minutesSpan=clock.querySelector(".minutes"),secondsSpan=clock.querySelector(".seconds");function updateClock(){const t=getTimeRemaining2(endtime);daysSpan.innerHTML=t.days+"d ",hoursSpan.innerHTML=("0"+t.hours).slice(-2)+"h ",minutesSpan.innerHTML=("0"+t.minutes).slice(-2)+"m ",secondsSpan.innerHTML=("0"+t.seconds).slice(-2)+"s ",t.total<=0&&clearInterval(timeinterval)}updateClock();const timeinterval=setInterval(updateClock,1e3)};var getTimeRemaining=getTimeRemaining2,initializeClock=initializeClock2;const schedule=[["November 25 2022 00:00:00 GMT-0800","November 28 2022 23:59:59 GMT-0800"]]}catch(e){console.error(e)}})(),(function(){if(__sections__.header_full)try{$(".menu-body .recent-posts .owl-carousel").owlCarousel({nav:!0,slideSpeed:300,paginationSpeed:400,dots:!0,items:4,margin:10,loop:!0,navText:["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"]}),$(".menu-body .blog-category-bar .owl-carousel").owlCarousel({nav:!0,dots:!0,slideSpeed:300,paginationSpeed:400,items:4,margin:10,loop:!0,navText:["<i class='fa fa-chevron-left'></i>","<i class='fa fa-chevron-right'></i>"]})}catch(e){console.error(e)}})(),(function(){if(__sections__["product-recommendations-findify"])try{var loadProductRecommendationsIntoSection=function(){var productRecommendationsSection=document.querySelector(".product-recommendations");
1if(productRecommendationsSection!==null){var productId=productRecommendationsSection.dataset.productId,limit=productRecommendationsSection.dataset.limit,requestUrl="/recommendations/products?section_id=product-recommendations&limit="+limit+"&product_id="+productId,request=new XMLHttpRequest;request.open("GET",requestUrl),request.onload=function(){if(request.status>=200&&request.status<300){var container=document.createElement("div");container.innerHTML=request.response,productRecommendationsSection.parentElement.innerHTML=container.querySelector(".product-recommendations").innerHTML,initSwiper()}},request.send()}};document.addEventListener("shopify:section:load",function(event){event.detail.sectionId==="product-recommendations"&&loadProductRecommendationsIntoSection()}),loadProductRecommendationsIntoSection()}catch(e){console.error(e)}})(),(function(){if(__sections__["product-recommendations-shopify"])try{var loadProductRecommendationsIntoSection=function(){var productRecommendationsSection=document.querySelector(".product-recommendations");
1if(productRecommendationsSection!==null){var productId=productRecommendationsSection.dataset.productId,limit=productRecommendationsSection.dataset.limit,requestUrl="/recommendations/products?section_id=product-recommendations&limit="+limit+"&product_id="+productId,request=new XMLHttpRequest;request.open("GET",requestUrl),request.onload=function(){if(request.status>=200&&request.status<300){var container=document.createElement("div");container.innerHTML=request.response,productRecommendationsSection.parentElement.innerHTML=container.querySelector(".product-recommendations").innerHTML,initSwiper()}},request.send()}};document.addEventListener("shopify:section:load",function(event){event.detail.sectionId==="product-recommendations"&&loadProductRecommendationsIntoSection()}),loadProductRecommendationsIntoSection()}catch(e){console.error(e)}})(),(function(){if(__sections__.product)try{var roundUp=function(num,precision){return precision=Math.pow(10,precision),Math.ceil(num*precision)/precision};if($("#bulk-discount-tiers").length){var discountTiersRaw=$("#bulk-discount-tiers").text(),discountType="%";discountTiersRaw.includes("$")?(discountTiersRaw=discountTiersRaw.replace(/[$]/gi,""),discountType="$"):discountTiersRaw.includes("%")&&(discountTiersRaw=discountTiersRaw.replace(/[%]/gi,""),discountType="%"),discountTiersRaw=discountTiersRaw.split(",");var discountTiers=[],discount;$.each(discountTiersRaw,function(index,tier){tierSplit=tier.split(":"),quant=parseInt(tierSplit[0]),disc=parseInt(tierSplit[1]),discountTiers.push({quantity:quant,discount:disc})})}$("input.quantity").on("input",function(){if(currQuantity=$(this).val(),discountTiers&&($.each(discountTiers,function(index,tier){if(currQuantity>=tier.quantity)return discount=tier.discount,discountType=="$"?console.log("$"+discount+" off!"):console.log(discount+"% off!"),!1;discount=!1}),discount||(console.log("quantity too low for discount"),$(this).closest("tr").find(".line-price span.orig-price").length&&($(this).closest("tr").find(".line-price span.discounted-price").remove(),$(this).closest("tr").find(".line-price span.orig-price").unwrap().removeClass("orig-price")))),discount){if(discountType=="$")var origPrice=parseInt($(this).attr("data-price")),linePrice=Math.ceil(origPrice-discount*100),linePriceFormatted=slate.Currency.formatMoney(linePrice,theme.moneyFormat),lineTotal=currQuantity*origPrice-currQuantity*(discount*100);else var origPrice=parseInt($(this).attr("data-price")),linePrice=Math.ceil(origPrice*(1-discount/100)),linePriceFormatted=slate.Currency.formatMoney(linePrice,theme.moneyFormat),lineTotal=$(this).val()*origPrice*(1-discount/100);var lineTotalFormatted=slate.Currency.formatMoney(lineTotal,theme.moneyFormat),origTotalFormatted=slate.Currency.formatMoney($(this).val()*origPrice,theme.moneyFormat);console.log("orig total"+origTotalFormatted),$(this).closest("tr").find(".line-price span.orig-price").length==0?($(this).closest("tr").find(".line-price span.money").addClass("orig-price"),$(this).closest("tr").find(".line-price span.money").wrap("<s></s>"),$(this).closest("tr").find(".line-price").append($(linePriceFormatted).addClass("discounted-price")),$(this).parent().next(".line-total").html(origTotalFormatted),$(this).closest("tr").find(".line-total span.money").addClass("orig-price"),$(this).closest("tr").find(".line-total span.money").wrap("<s></s>"),$(this).closest("tr").find(".line-total").append($(lineTotalFormatted).addClass("discounted-price"))):($(this).closest("tr").find(".line-price span.discounted-price").replaceWith($(linePriceFormatted).addClass("discounted-price")),$(this).closest("tr").find(".line-total span.discounted-price").replaceWith($(lineTotalFormatted).addClass("discounted-price")),$(this).closest("tr").find(".line-total span.orig-price").replaceWith($(origTotalFormatted).addClass("orig-price")))}else{var linePrice=parseInt($(this).attr("data-price")),lineTotal=$(this).val()*linePrice;$(this).parent().next(".line-total").html(slate.Currency.formatMoney(lineTotal,theme.moneyFormat))}$(this).parent().next(".line-total").attr("data-total",lineTotal);var grandTotal=0;$(".line-total").each(function(){if(parseInt($(this).attr("data-total"))>0){if($("span.discounted-price",this).length)var price=parseFloat($("span.discounted-price",this).text().replace("$","").replace(".","").replace(",",""));else var price=parseFloat($("span.money",this).text().replace("$","").replace(".","").replace(",",""));console.log("price is: "+price),grandTotal=grandTotal+price}}),$(".add-to-cart-total").html(slate.Currency.formatMoney(grandTotal,theme.moneyFormat))})}catch(e){console.error(e)}})()})();
2//# sourceMappingURL=/cdn/shop/t/205/compiled_assets/scripts.js.map?v=23976290576380295661787948487

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.