PageSourceSearch

https://www.murad.com/cdn/shop/t/2/assets/chunk--GWP-4OCBTFOV.vbt.js

js murad.com collected 2026-10-02 17:09:11 UTC 22,129 bytes, 14 lines download raw bytes

1import{addRemoveGwpItems,getMatchingThemeGwpProducts,getMatchingUserInputCode,testCartMeetsCollectionPurchaseRequirement,testCartMeetsPriceThreshold,testCartMeetsProductPurchaseRequirement,updateCartDiscountCodes}from"./chunk--chunk-GBPFPGUS.vbt.js";import{getCartData}from"./chunk--chunk-UDTFVZUR.vbt.js";import{cartActions,cartUpdateQuantities}from"./chunk--chunk-TT72TRRF.vbt.js";import{COMPLETE_REGIMEN_DISCOUNT_CODE_PREFIX,COMPLETE_REGIMEN_DISCOUNT_DISPLAY_CODE,LOCAL_STORAGE_KEY_GWP_CURRENCY_SYMBOL,LOCAL_STORAGE_KEY_GWP_THEME_DATA,LOCAL_STORAGE_KEY_GWP_USER_INPUT_CODES,PUB_SUB_EVENTS,cartDebug,getLocalStorage,setLocalStorage,subscribe}from"./chunk--chunk-Z3ZRRM3S.vbt.js";import"./chunk--chunk-Z7A6LSGX.vbt.js";var GWP=class{constructor(el,sel){this.el=el,this.sel=sel;let props=el.getAttribute(sel);if(props)props=JSON.parse(props);else throw new Error("GWP component used, but its data attribute was not provided necessary props.");const{graphql_storefront_access_token}=props;this.GRAPHQL_ENDPOINT="/api/2026-04/graphql.json",this.STOREFRONT_ACCESS_TOKEN=graphql_storefront_access_token,this.els={wrapper:el.querySelector("#gwp-wrapper"),codeInput:el.querySelector("#input-gwp-coupon-code"),buttonSubmit:el.querySelector("#button-gwp-coupon-code"),divStatusMessage:el.querySelector("#status-gwp-coupon-code"),buttonRemoveSingleCode:el.querySelector("button#gwp-code-remove-single")},this.colors={green:"var(--color-green-dark)",red:"var(--color-red)",grayDark:"var(--color-text-primary)"},this.messages={emptyCart:codeValue=>{let wrapper=document.createElement("span");return wrapper.textContent="Please add items to your cart to redeem coupon codes",wrapper.style.color=this.colors.red,wrapper},addedNotValidated:codeValue=>{const displayCode=this.getDisplayCode(codeValue);let wrapper=document.createElement("span");return wrapper.textContent=`Applying ${displayCode}...`,wrapper.style.color=this.colors.green,wrapper},invalid:codeValue=>{const displayCode=this.getDisplayCode(codeValue);let wrapper=document.createElement("span");return wrapper.textContent=`Sorry, ${displayCode} is not valid`,wrapper.style.color=this.colors.red,wrapper},validMissingProducts:(codeValue,productsNeededToMeetRequirement,dollarsNeededToReachThresholdString,collectionsNeededToMeetRequirement,requiredPurchasesMustPurchaseAll)=>{const displayCode=this.getDisplayCode(codeValue);let wrapper=document.createElement("ul");wrapper.textContent=`For your free gift with ${displayCode.toUpperCase()}, add ${requiredPurchasesMustPurchaseAll?"all":"any"} to your cart: `,wrapper.style.color=this.colors.red;for(let product of productsNeededToMeetRequirement){let anchorWrapper=document.createElement("li"),anchorLink=document.createElement("a");anchorLink.textContent=product.name,anchorLink.setAttribute("href",product.url),anchorLink.style.color=this.colors.grayDark,anchorLink.style.textDecoration="underline",anchorWrapper.append(anchorLink),wrapper.append(anchorWrapper)}return wrapper},validMissingCollectionProducts:(codeValue,productsNeededToMeetRequirement,dollarsNeededToReachThresholdString,collectionsNeededToMeetRequirement,requiredPurchasesMustPurchaseAll)=>{const displayCode=this.getDisplayCode(codeValue);let wrapper=document.createElement("ul");wrapper.textContent=`For your free gift with ${displayCode.toUpperCase()}, add to your cart an item from ${requiredPurchasesMustPurchaseAll?"each":"any"} of these collections: `,wrapper.style.color=this.colors.red;for(let collection of collectionsNeededToMeetRequirement){let anchorWrapper=document.createElement("li"),anchorLink=document.createElement("a");anchorLink.textContent=collection.name,anchorLink.setAttribute("href",collection.url),anchorLink.style.color=this.colors.grayDark,anchorLink.style.textDecoration="underline",anchorWrapper.append(anchorLink),wrapper.append(anchorWrapper)}return wrapper},validBelowThreshold:(codeValue,productsNeededToMeetRequirement,dollarsNeededToReachThresholdString)=>{const displayCode=this.getDisplayCode(codeValue);let wrapper=document.createElement("span");return wrapper.textContent=`Add ${getLocalStorage(LOCAL_STORAGE_KEY_GWP_CURRENCY_SYMBOL)??"$"}${dollarsNeededToReachThresholdString} to your cart for your free gift with ${displayCode.toUpperCase()}`,wrapper.style.color=this.colors.red,wrapper},validApplied:codeValue=>{const displayCode=this.getDisplayCode(codeValue);let wrapper=document.createElement("span");return wrapper.textContent=`Free gift added for ${displayCode}`,wrapper.style.color=this.colors.green,wrapper},removed:codeValue=>{const displayCode=this.getDisplayCode(codeValue);let wrapper=document.createElement("span");return wrapper.textContent=`Removed ${displayCode}`,wrapper.style.color=this.colors.red,wrapper},removedEmptyCart:codeValue=>{const displayCode=this.getDisplayCode(codeValue);let wrapper=document.createElement("span");return wrapper.textContent=`Removed ${displayCode}. Please add items to your cart to redeem coupon codes.`,wrapper.style.color=this.colors.red,wrapper},validAppliedShopifyDiscount:codeValue=>{const displayCode=this.getDisplayCode(codeValue);let wrapper=document.createElement("span");return wrapper.textContent=`${displayCode} applied to cart`,wrapper.style.color=this.colors.green,wrapper},invalidShopifyDiscount:codeValue=>{const displayCode=this.getDisplayCode(codeValue);let wrapper=document.createElement("span");return wrapper.textContent=`${displayCode} isn't valid for the items in your cart`,wrapper.style.color=this.colors.red,wrapper}}
1,this.codeStatus={addedNotValidated:"addedNotValidated",invalid:"invalid",validMissingProducts:"validMissingProducts",validMissingCollectionProducts:"validMissingCollectionProducts",validBelowThreshold:"validBelowThreshold",validApplied:"validApplied",removed:"removed",removedEmptyCart:"removedEmptyCart",validReplaced:"validReplaced"},this.persistentStatuses=[this.codeStatus.validApplied,this.codeStatus.validMissingProducts,this.codeStatus.validMissingCollectionProducts,this.codeStatus.validBelowThreshold],this.timeoutMessageReset=!1,this.resetMessageAfterMs=5e3,this.fakeHashForShopifyDiscountCodes="SHOPIFY_DISCOUNT_CODE",this.activeShopifyDiscountCode=void 0,this.shopifyDiscountsRemoveCode="''",this.callbackTimeout=null,this.callbackTriggers=0,this.pendingRawCodeSubmitValue=null,this.handleRemoveCodeWithParams=null}getDisplayCode(codeValue){return typeof codeValue!="string"?codeValue:codeValue.startsWith(COMPLETE_REGIMEN_DISCOUNT_CODE_PREFIX)?COMPLETE_REGIMEN_DISCOUNT_DISPLAY_CODE:codeValue}async sha256(message){const msgBuffer=new TextEncoder().encode(message),hashBuffer=await crypto.subtle.digest("SHA-256",msgBuffer);return Array.from(new Uint8Array(hashBuffer)).map(b=>b.toString(16).padStart(2,"0")).join("")}async getCodeHash(codeValue){return codeValue.trim()!==""?await this.sha256(codeValue.toUpperCase()):""}async applyDiscountCode(code,cartToken){try{const token=cartToken||(await getCartData())?.cartRaw?.token;token&&code&&await updateCartDiscountCodes(token,[code],{endpoint:this.GRAPHQL_ENDPOINT,storefrontToken:this.STOREFRONT_ACCESS_TOKEN})}catch(err){throw err}}async removeDiscountCodes(cartToken){try{const token=cartToken||(await getCartData())?.cartRaw?.token;token&&await updateCartDiscountCodes(token,[],{endpoint:this.GRAPHQL_ENDPOINT,storefrontToken:this.STOREFRONT_ACCESS_TOKEN})}catch(err){throw err}}async getCartDiscountCodes(cartId){try{let json=await(await fetch(this.GRAPHQL_ENDPOINT,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":this.STOREFRONT_ACCESS_TOKEN},body:JSON.stringify({query:`query getCart($id: ID!) {
2            cart(id: $id) {
3              id
4              createdAt
5              updatedAt
6              discountCodes {
7                applicable
8                code
9              }
10            }
11          }`,variables:`{
12            "id": "gid://shopify/Cart/${cartId}"
13          }`})})).json();return cartDebug({json}),json?.data?.cart?.discountCodes}catch(err){throw err}}async getCartIdAndDiscountCodes(cartId){try{return cartId?await this.getCartDiscountCodes(cartId):[]}catch(err){console.error(err)}}async applyTestShopifyDiscount(gwpInputVal,cartId){try{return cartDebug("applyTestShopifyDiscount"),await this.applyDiscountCode(gwpInputVal,cartId),cartDebug("applied Shopify Discounts code, now checking if it was applied"),await this.checkDiscountCodes(cartId)}catch(err){throw err}}getThemeGwpData(){return getLocalStorage(LOCAL_STORAGE_KEY_GWP_THEME_DATA)??[]}getUserInputCodes(){return getLocalStorage(LOCAL_STORAGE_KEY_GWP_USER_INPUT_CODES)??[]}setUserInputCodes(val){setLocalStorage(LOCAL_STORAGE_KEY_GWP_USER_INPUT_CODES,val)}updateStatusMessage(el,resetMessage){clearTimeout(this.timeoutMessageReset),this.els.divStatusMessage.replaceChildren(el),resetMessage&&(this.timeoutMessageReset=setTimeout(()=>{this.updateStatusMessage(resetMessage)},this.resetMessageAfterMs))}localRemoveDiscountCode(codeValue,messageType="removed"){this.updateStatusMessage(this.messages[messageType](codeValue,void 0,void 0)),this.activeShopifyDiscountCode=void 0}async handleRemoveDiscountCode(codeValue,messageType){cartDebug("handleRemoveDiscountCode");try{await this.removeDiscountCodes(),this.localRemoveDiscountCode(codeValue,messageType),cartActions.cartRefresh()}catch(err){throw err}}handleRemoveGwpCode(codeObj){try{this.removeCode(codeObj),this.updateUIAppliedCodes()}catch(err){throw err}}updateInput(codeToShowInInput){let gwpInput=this.el.querySelector("#input-gwp-coupon-code");const resetInput=()=>{gwpInput.disabled=!1,gwpInput.value="",this.disableSubmitButton(),this.els.buttonRemoveSingleCode.classList.add("hidden"),this.els.buttonRemoveSingleCode.removeEventListener("click",this.handleRemoveCodeWithParams)},handleRemoveCode=async codeToShowInInput2=>{try{codeToShowInInput2.codeHash===this.fakeHashForShopifyDiscountCodes?await this.handleRemoveDiscountCode(codeToShowInInput2.codeValue,"removed"):this.handleRemoveGwpCode(codeToShowInInput2),resetInput();const codeValue=codeToShowInInput2.codeValue,displayCode=this.getDisplayCode(codeValue),reapplyWrapper=document.createElement("span");reapplyWrapper.style.color=this.colors.red,reapplyWrapper.textContent=`Removed ${displayCode} `;const reapplyBtn=document.createElement("button");reapplyBtn.type="button",reapplyBtn.textContent="Reapply",reapplyBtn.style.background="none",reapplyBtn.style.border="none",reapplyBtn.style.padding="0",reapplyBtn.style.marginLeft="4px",reapplyBtn.style.cursor="pointer",reapplyBtn.style.textDecoration="underline",reapplyBtn.style.color=this.colors.red,reapplyBtn.setAttribute("aria-label",`Reapply ${codeValue}`),reapplyBtn.addEventListener("click",()=>{this.pendingRawCodeSubmitValue=codeValue,this.els.codeInput.value=this.getDisplayCode(codeValue),this.enableSubmitButton(),this.handleSubmitCode()}),reapplyWrapper.appendChild(reapplyBtn),this.updateStatusMessage(reapplyWrapper,document.createElement("span"))}catch(err){console.error(err)}};codeToShowInInput?(this.els.buttonRemoveSingleCode.removeEventListener("click",this.handleRemoveCodeWithParams),this.handleRemoveCodeWithParams=()=>handleRemoveCode(codeToShowInInput),this.disableSubmitButton(),gwpInput.disabled=!0,gwpInput.value=this.getDisplayCode(codeToShowInInput.codeValue),this.els.buttonRemoveSingleCode.classList.remove("hidden"),this.els.buttonRemoveSingleCode.addEventListener("click",this.handleRemoveCodeWithParams)):resetInput()}removeItemArrayFromCart(variantIdArray){let updates=variantIdArray.reduce((prev,curr)=>({...prev,[curr]:0}),{});cartUpdateQuantities(updates)}removeGiftProducts(codeObj){const productsToRemove=getMatchingThemeGwpProducts(codeObj,"id");cartDebug({productsToRemove}),productsToRemove.length>0&&this.removeItemArrayFromCart(productsToRemove.map(product=>product.variantId))}
13removeCode(codeObj){const{codeValue,codeHash}=codeObj;let codeStatusBeforeRemoval=getMatchingUserInputCode(codeObj)?.status;this.addUpdateUserCode({codeValue,codeHash,status:this.codeStatus.removed}),codeStatusBeforeRemoval===this.codeStatus.validApplied&&this.removeGiftProducts(codeObj)}updateUIAppliedCodes(allowMultipleCodes=!1){let userInputCodes=this.getUserInputCodes();if(!allowMultipleCodes){let lastUpdatedCode=userInputCodes[0];if(lastUpdatedCode){let{codeValue,codeHash,status,productsNeededToMeetRequirement,dollarsNeededToReachThresholdString,collectionsNeededToMeetRequirement,requiredPurchasesMustPurchaseAll}=lastUpdatedCode;this.persistentStatuses.includes(status)?this.updateStatusMessage(this.messages[status](codeValue,productsNeededToMeetRequirement,dollarsNeededToReachThresholdString,collectionsNeededToMeetRequirement,requiredPurchasesMustPurchaseAll)):Date.now()-lastUpdatedCode.timeUpdated<this.resetMessageAfterMs&&this.updateStatusMessage(this.messages[status](codeValue,productsNeededToMeetRequirement,dollarsNeededToReachThresholdString,collectionsNeededToMeetRequirement,requiredPurchasesMustPurchaseAll))}let codeToShowInInput=userInputCodes.find(codeObj=>this.persistentStatuses.includes(codeObj.status));this.updateInput(codeToShowInInput)}}addUpdateUserCode(codeObj){const{codeValue,codeHash,status}=codeObj;codeObj.timeUpdated=Date.now();let updatedUserInputCodes=[...this.getUserInputCodes()];if(status===this.codeStatus.validApplied)for(let thisCodeObj of updatedUserInputCodes)thisCodeObj.codeStatus===this.codeStatus.validApplied&&(thisCodeObj.codeStatus=this.codeStatus.validReplaced);let codeToUpdateIndex=updatedUserInputCodes.findIndex(val=>val.codeValue===codeValue&&val.codeHash===codeHash);return codeToUpdateIndex>-1?(cartDebug("User-input code exists; updating its entry in userInputCodes"),updatedUserInputCodes=[{...updatedUserInputCodes.splice(codeToUpdateIndex,1)[0],...codeObj},...updatedUserInputCodes]):(cartDebug("User-input is new; adding to userInputCodes"),codeObj.timeAdded=Date.now(),updatedUserInputCodes=[codeObj,...updatedUserInputCodes]),this.setUserInputCodes(updatedUserInputCodes),codeObj}getCodeStatus(codeObj,cartData){const{codeValue,codeHash,status}=codeObj,{cartRaw,cartItemVariantIds,cartTotalPrice}=cartData;if(status===this.codeStatus.removed||status===this.codeStatus.removedEmptyCart||status===this.codeStatus.invalid)return cartDebug("GWP code is invalid or was removed; returning data as-is",codeObj),codeObj;const matchingThemeGwpProducts=getMatchingThemeGwpProducts(codeObj,"hash");cartDebug({matchingThemeGwpProducts});const gwpInputValThemeMatch=matchingThemeGwpProducts[0];if(!gwpInputValThemeMatch)return cartDebug("GWP code does not match any in theme settings",codeObj),{status:this.codeStatus.invalid,productsNeededToMeetRequirement:void 0,dollarsNeededToReachThresholdString:void 0,collectionsNeededToMeetRequirement:void 0,requiredPurchasesMustPurchaseAll:void 0};if(cartTotalPrice===0)return cartDebug("Cart is empty; rejecting GWP"),{status:this.codeStatus.removedEmptyCart,productsNeededToMeetRequirement:void 0,dollarsNeededToReachThresholdString:void 0,collectionsNeededToMeetRequirement:void 0,requiredPurchasesMustPurchaseAll:void 0};const{gwpId,requiredProductPurchases,requiredCollectionPurchases,requiredPurchasesMustPurchaseAll,threshold}=gwpInputValThemeMatch;if(requiredProductPurchases.length>0){let{doesMeetProductPurchaseRequirement,productsNeededToMeetRequirement}=testCartMeetsProductPurchaseRequirement(requiredProductPurchases,cartItemVariantIds,requiredPurchasesMustPurchaseAll);if(!doesMeetProductPurchaseRequirement)return cartDebug("GWP code does not meet product purchase requirement",codeObj),{gwpId,status:this.codeStatus.validMissingProducts,productsNeededToMeetRequirement,dollarsNeededToReachThresholdString:void 0,collectionsNeededToMeetRequirement:void 0,requiredPurchasesMustPurchaseAll}}if(requiredCollectionPurchases.length>0){let{doesMeetCollectionPurchaseRequirement,collectionsNeededToMeetRequirement}=testCartMeetsCollectionPurchaseRequirement(requiredCollectionPurchases,cartItemVariantIds,requiredPurchasesMustPurchaseAll);
13if(cartDebug({doesMeetCollectionPurchaseRequirement,collectionsNeededToMeetRequirement}),!doesMeetCollectionPurchaseRequirement)return cartDebug("GWP code does not meet collection purchase requirement",codeObj),{gwpId,status:this.codeStatus.validMissingCollectionProducts,productsNeededToMeetRequirement:void 0,dollarsNeededToReachThresholdString:void 0,collectionsNeededToMeetRequirement,requiredPurchasesMustPurchaseAll}}let{doesMeetThreshold,dollarsNeededToReachThresholdString}=testCartMeetsPriceThreshold(threshold,cartTotalPrice);return doesMeetThreshold?(cartDebug("GWP code is valid and applied",codeObj),{gwpId,status:this.codeStatus.validApplied,productsNeededToMeetRequirement:void 0,dollarsNeededToReachThresholdString:void 0,collectionsNeededToMeetRequirement:void 0,requiredPurchasesMustPurchaseAll}):(cartDebug("GWP code does not meet price threshold requirement",codeObj),{gwpId,status:this.codeStatus.validBelowThreshold,productsNeededToMeetRequirement:void 0,dollarsNeededToReachThresholdString,collectionsNeededToMeetRequirement:void 0,requiredPurchasesMustPurchaseAll})}testCodeValidity(codeObj,cartData){const{codeValue,codeHash,status,productsNeededToMeetRequirement,dollarsNeededToReachThresholdString,collectionsNeededToMeetRequirement,requiredPurchasesMustPurchaseAll}=codeObj,updatedStatus=this.getCodeStatus(codeObj,cartData);return updatedStatus.status!==status||updatedStatus.productsNeededToMeetRequirement!==productsNeededToMeetRequirement||updatedStatus.collectionsNeededToMeetRequirement!==collectionsNeededToMeetRequirement||updatedStatus.dollarsNeededToReachThresholdString!==dollarsNeededToReachThresholdString?this.addUpdateUserCode({codeValue,codeHash,...updatedStatus}):codeObj}testAllAddedCodes(userInputCodes,cartData){cartDebug("testAllAddedCodes");const GWP_CODES_MAX_ALLOWED=1;let gwpCodesValidAppliedCount=0;for(let codeObj of userInputCodes){let testedCodeObj=this.testCodeValidity(codeObj,cartData);testedCodeObj.status===this.codeStatus.validApplied&&(gwpCodesValidAppliedCount+=1,gwpCodesValidAppliedCount>GWP_CODES_MAX_ALLOWED&&this.removeCode(testedCodeObj))}}updateCartGwp=async cartData=>{addRemoveGwpItems(cartData)};async applyTestGwpCode(codeValue,cartData){try{var codeHash=await this.getCodeHash(codeValue);let savedCodeObj=this.addUpdateUserCode({codeValue,codeHash,status:this.codeStatus.addedNotValidated});return this.testCodeValidity(savedCodeObj,cartData).status===this.codeStatus.validApplied}catch(err){throw err}}async handleSubmitCode(){try{this.disableSubmitButton();let inputCode=this.els.codeInput,codeValue=(this.pendingRawCodeSubmitValue||inputCode.value).toUpperCase();this.pendingRawCodeSubmitValue=null;let cartData=await getCartData();if(cartData.cartTotalPrice===0){this.updateStatusMessage(this.messages.emptyCart()),inputCode.value="";return}if(await this.applyTestGwpCode(codeValue,cartData)){this.updateUIAppliedCodes(),this.updateCartGwp(cartData);return}if(await this.applyTestShopifyDiscount(codeValue,cartData?.cartRaw?.token)){cartActions.cartRefresh();return}this.updateUIAppliedCodes()}catch(err){throw console.error(err),this.enableSubmitButton(),err}}disableSubmitButton(){let gwpSubmitBtn=this.els.buttonSubmit;gwpSubmitBtn.classList.add("opacity-50"),gwpSubmitBtn.disabled=!0}enableSubmitButton(){let gwpSubmitBtn=this.els.buttonSubmit;gwpSubmitBtn.classList.remove("opacity-50"),gwpSubmitBtn.disabled=!1}async testPerformance(testFunc,funcName,iterations=1){console.time(funcName);for(var i=0;i<iterations;i++)await testFunc();console.log(`%cPerformance ${funcName}`,"color: #fff; font-size: 1.0rem; background-color: red; padding: 4px"),console.timeEnd(funcName)}addEventListeners(el){this.els.buttonSubmit.addEventListener("click",()=>{try{this.handleSubmitCode()}catch(err){console.error(err)}});let gwpInput=this.els.codeInput;["input","change","keypress"].forEach(eventType=>{gwpInput?.addEventListener(eventType,e=>{const inputVal=e.currentTarget.value;if(eventType==="keypress"&&e.code==="Enter"){e.preventDefault();try{inputVal.trim()!==""&&this.handleSubmitCode()}catch(err){console.error(err)}return}inputVal.trim()!==""?this.enableSubmitButton():this.disableSubmitButton()})})}async testCodesUpdateUI(){cartDebug("testCodesUpdateUI");let cartData=await getCartData();if(!cartData){console.error("GWP - no cart data found");return}await this.checkDiscountCodes(cartData?.cartRaw?.token)||(this.testAllAddedCodes(this.getUserInputCodes(),cartData),this.updateUIAppliedCodes())}isValidGwpCodePresent(){return!!this.getUserInputCodes().find(codeObj=>this.persistentStatuses.includes(codeObj.status))}isValidCodePresent(){return this.activeShopifyDiscountCode?!0:this.isValidGwpCodePresent()}async checkDiscountCodes(cartId){cartDebug("checkDiscountCodes",cartId);try{let cartDiscountCodes=await this.getCartIdAndDiscountCodes(cartId);if(cartDebug({cartId,cartDiscountCodes}),cartDiscountCodes&&cartDiscountCodes.length>0){let firstApplicableCode=cartDiscountCodes.find(val=>val.applicable);if(firstApplicableCode){let userInputCodes=this.getUserInputCodes();for(let eachCode of userInputCodes)(eachCode.status===this.codeStatus.val
13idApplied||eachCode.status===this.codeStatus.validMissingProducts||eachCode.status===this.codeStatus.validBelowThreshold)&&this.removeCode(eachCode);return this.updateInput({codeValue:firstApplicableCode.code,codeHash:this.fakeHashForShopifyDiscountCodes}),this.updateStatusMessage(this.messages.validAppliedShopifyDiscount(firstApplicableCode.code)),this.activeShopifyDiscountCode=firstApplicableCode.code,!0}}return this.activeShopifyDiscountCode?this.localRemoveDiscountCode(this.activeShopifyDiscountCode,"invalidShopifyDiscount"):cartDiscountCodes?.[0]&&this.shopifyDiscountsRemoveCode,!1}catch(err){throw err}}unhide(){this.getThemeGwpData().length>0&&(this.els.wrapper.style.display="block")}async init(){try{await this.testCodesUpdateUI(),subscribe(PUB_SUB_EVENTS.cartMutationComplete,()=>{this.testCodesUpdateUI()},"gwp_testCodesUpdateUI"),this.addEventListeners(this.el)}catch(err){console.error(err)}}},GWP_default=GWP;export{GWP_default as default};
14//# sourceMappingURL=/cdn/shop/t/2/assets/chunk--GWP-4OCBTFOV.vbt.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.