PageSourceSearch

https://myfireroad.com/cdn/shop/t/106/assets/selling-plans-integration.js?v=147693899417530651491763472921

js myfireroad.com collected 2026-10-07 06:47:19 UTC 5,566 bytes, 2 lines download raw bytes

1const hiddenClass="selling_plan_theme_integration--hidden";class SellingPlansWidget{constructor(sellingPlansWidgetContainer){this.enablePerformanceObserver(),this.sellingPlansWidgetContainer=sellingPlansWidgetContainer,this.updateSellingPlanInputsValues(),this.listenToVariantChange(),this.listenToSellingPlanFormRadioButtonChange()}get sectionId(){return this.sellingPlansWidgetContainer.getAttribute("data-section-id")}get shopifySection(){return document.querySelector(`#shopify-section-${this.sectionId}`)}get variantIdInput(){return this.addToCartForms[1]?.querySelector('input[name="id"]')||this.addToCartForms[1]?.querySelector('select[name="id"]')||this.addToCartForms[0].querySelector('input[name="id"]')||this.addToCartForms[0].querySelector('select[name="id"]')}get priceElement(){return this.shopifySection.querySelector(".price")}get comparedAtPrice(){return this.shopifySection.querySelector(".price__sale")}get visibleSellingPlanForm(){return this.shopifySection.querySelector(`section[data-variant-id^="${this.variantIdInput.value}"]`)}get isVariantAvailable(){return this.selectedPurchaseOption.getAttributeNames().includes("disabled")}get sellingPlanInput(){return this.shopifySection.querySelector(".selected-selling-plan-id")}get addToCartForms(){return this.shopifySection.querySelectorAll('[action*="/cart/add"]')}appendSellingPlanInputs(){this.addToCartForms.forEach(addToCartForm=>{addToCartForm.appendChild(this.sellingPlanInput.cloneNode())})}showSellingPlanForm(sellingPlanFormForSelectedVariant){sellingPlanFormForSelectedVariant?.classList?.remove(hiddenClass)}hideSellingPlanForms(sellingPlanFormsForUnselectedVariants){sellingPlanFormsForUnselectedVariants.forEac
1h(element=>{element.classList.add(hiddenClass)})}handleSellingPlanFormVisibility(){const sellingPlanFormForSelectedVariant=this.shopifySection.querySelector(`section[data-variant-id="${this.variantIdInput.value}"]`),sellingPlanFormsForUnselectedVariants=this.shopifySection.querySelectorAll(`.selling_plan_theme_integration:not([data-variant-id="${this.variantIdInput.value}"])`);this.showSellingPlanForm(sellingPlanFormForSelectedVariant),this.hideSellingPlanForms(sellingPlanFormsForUnselectedVariants)}handleVariantChange(){this.handleSellingPlanFormVisibility(),this.updateSellingPlanInputsValues(),this.listenToSellingPlanFormRadioButtonChange()}listenToVariantChange(){this.listenToAddToCartForms(),this.variantIdInput.tagName==="INPUT"&&new MutationObserver(mutationList=>{mutationList.forEach(mutationRecord=>{this.handleVariantChange(mutationRecord.target.value)})}).observe(this.variantIdInput,{attributes:!0})}listenToAddToCartForms(){this.addToCartForms.forEach(addToCartForm=>{addToCartForm.addEventListener("change",()=>{this.handleVariantChange()})})}get regularPriceElement(){return this.shopifySection.querySelector(".price__regular")}get salePriceElement(){return this.shopifySection.querySelector(".price__sale")}get salePriceValue(){return this.salePriceElement.querySelector(".price-item--sale")}get regularPriceValue(){return this.salePriceElement.querySelector(".price-item--regular")}get sellingPlanAllocationPrice(){return document.getElementById(`${this.selectedPurchaseOption.dataset.sellingPlanGroupId}_allocation_price`)}get selectedPurchaseOptionPrice(){return this.selectedPurchaseOption.dataset.variantPrice}get selectedPurchaseOptionComparedAtPrice(){return this.selectedPurchaseOption.dataset.variantCompareAtPrice}get price(){return this.sellingPlanAllocationPrices.price??null}updatePrice(){!this.selectedPurchaseOptionComparedAtPrice||this.selectedPurchaseOptionComparedAtPrice===this.selectedPurchaseOptionPrice?(this.showRegularPrice(),this.hideSalePrice(),this.priceElement.classList.remove("price--on-sale")):(this.showSalePrice(),this.hideRegularPrice(),this.priceElement.classList.add("price--on-sale"))}hideSalePrice(){this.salePriceElement.style.display="none"}hideRegularPrice(){this.regularPriceElement.style.display="none"}showRegularPrice(){this.regularPriceElement.style.display="block",this.shopifySection.querySelector(".price__sale").style.display="none"}showSalePrice(){this.salePriceElement.style.display="block",this.regularPriceValue.innerHTML=this.selectedPurchaseOptionComparedAtPrice,this.salePriceValue.innerHTML=this.selectedPurchaseOptionPrice}get sellingPlanInputs(){return this.shopifySection.querySelectorAll(".selected-selling-plan-id")}updateSellingPlanInputsValues(){this.sellingPlanInputs.forEach(sellingPlanInput=>{sellingPlanInput.value=this.sellingPlanInputValue})}get sellingPlanInputValue(){return this.selectedPurchaseOption?.dataset.sellingPlanId??null}get selectedPurchaseOption(){return this.visibleSellingPlanForm?.querySelector('input[type="radio"]:checked')}set selectedPurchaseOption(selectedPurchaseOption){this._selectedPurchaseOption=selectedPurchaseOption}handleRadioButtonChange(selectedPurchaseOption){this.selectedPurchaseOption=selectedPurchaseOption,this.updateSellingPlanInputsValues()}listenToSellingPlanFormRadioButtonChange(){this.visibleSellingPlanForm?.querySelectorAll('input[type="radio"]').forEach(radio=>{radio.addEventListener("change",event=>{this.handleRadioButtonChange(event.target)})})}enablePerformanceObserver(){new PerformanceObserver(list=>{list.getEntries().forEach(entry=>{if(entry.initiatorType!=="fetch")return;const url=new URL(entry.name);url.search.includes("variant")||url.search.includes("variants")})}).observe({entryTypes:["resource"]})}}
2//# sourceMappingURL=/cdn/shop/t/106/assets/selling-plans-integration.js.map?v=147693899417530651491763472921

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.