!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n,r=t();for(n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(self,(function(){return(()=>{"use strict";var e={7684:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=this;this.parentPageOldMetaTagContent=null,this.canHandleThisPage=function(){return!0},this.isProductPage=function(){n.config.logger.debug("GenericPluginPlatform");var e=!!n.identifyAddToCartButton(),t=!!(t=n.extractProductPageRefs()).urlNameParts&&0!==t.urlNameParts.length&&!!t.urlName&&"/"!==t.urlName&&""!==t.urlName;return e&&t},this.identifyAddToCartButton=function(){n.config.logger.debug("GenericPluginPlatform");var e="input , button";n.config.targetAddToCartButtonCssSelector?(n.config.logger.debug("GenericPluginPlatform - Using custom targetAddToCartButtonCssSelector"),e=n.config.targetAddToCartButtonCssSelector):n.config.logger.debug("GenericPluginPlatform - Using automated add-to-cart button detection");for(var t=[],r=(e=document.querySelectorAll(e),e=Array.from(e),{}),o=0,i=e;o");var t,r,o=document.createElement("button");for(t in o.innerText="Text Me This Item",o.classList.add("whym-tmti-drawer-trigger-button"),e.addToCartButtonDomEl.classList)Object.prototype.hasOwnProperty.call(e.addToCartButtonDomEl.classList,t)&&(r=e.addToCartButtonDomEl.classList[t],o.classList.add(r));return e.buttonType&&"text"===e.buttonType&&(o.style.cssText="border:none;box-shadow:none;width:100%;text-align:center;display:block;cursor:pointer;background-color:rgba(0,0,0,0);"),e.buttonStyles&&(o.style.cssText="".concat(o.style.cssText).concat(e.buttonStyles)),e.extraClasses&&e.extraClasses.forEach((function(e){o.classList.add(e)})),o.onclick=function(t){t.preventDefault(),t.stopPropagation(),t=document.querySelector("meta[name=viewport]"),n.parentPageOldMetaTagContent=t.getAttribute("content"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"),t=[e.productPageRefs.urlName,e.productPageRefs.urlNameParts,e.productPageRefs.urlHost,e.productPageRefs.sku,e.productPageRefs.productName],e.buttonAction({productId:"",variantId:"",productRefs:t})},o},this.extractProductPageRefs=function(){n.config.logger.debug("GenericPluginPlatform");var e=window.location.host,t=window.location.pathname,r=t.split("/");try{r=r.filter((function(e){return 0 input"),(t=Array.from(t))&&t.find((function(e){return e.checked})),document.getElementById("qty[]"),{urlName:e.urlName,urlNameParts:e.urlNameParts,urlHost:e.urlHost,priceStr:r||null,sku:i||null,productName:o||null,productSize:null,productQuantity:null}},this.externalPlatformName=e,this.config=t,this.genericPluginParent=new o.default(e,t)},t.default=n},1099:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=r(n(612));n=function(e,t){var n=this;this.canHandleThisPage=function(){return"woo_commerce"===n.externalPlatformName},this.isProductPage=function(){return n.genericPluginParent.isProductPage()},this.identifyAddToCartButton=function(){return n.genericPluginParent.identifyAddToCartButton()},this.prepareTmtiButton=function(e){return!(e=n.genericPluginParent.prepareTmtiButton(e)).style||e.style.margin||e.style["margin-left"]||(e.style["margin-left"]="2px"),e},this.extractProductPageRefs=function(){var e=n.genericPluginParent.extractProductPageRefs(),t=document.querySelectorAll(".woocommerce-Price-amount"),r=Array.from(t),o=r[r.length-1],i=null;o&&(i=o.innerText.replace("$","").replace("₭",""));var a=document.querySelector(".sku");return t=null,a&&(t=a.innerText),o=null,(r=document.querySelector(".text-capitalize"))&&(o=r.innerText),r=null,(a=document.querySelector("input.input-text.qty"))&&(r=a.value),{urlName:e.urlName,urlNameParts:e.urlNameParts,urlHost:e.urlHost,priceStr:i||null,sku:t||null,productName:o||null,productSize:null,productQuantity:r||null}},this.externalPlatformName=e,this.config=t,this.genericPluginParent=new o.default(e,t)},t.default=n},8810:function(e,t,n){var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n");var e=!!n.identifyAddToCartButton(),t=!!(t=n.extractProductPageRefs()).urlNameParts&&0!==t.urlNameParts.length&&!!t.urlName&&"/"!==t.urlName&&""!==t.urlName;return e&&t},this.identifyAddToCartButton=function(){n.config.logger.debug("GenericPluginPlatform");var e="input , button",t=!1;n.config.targetButtonDetectorCssSelectors&&0 - Using custom targetButtonDetectorCssSelector"),t=!0,e=n.config.targetButtonDetectorCssSelectors[0]):n.config.logger.debug("GenericPluginPlatform - Using automated add-to-cart button detection");for(var r=[],o=(e=document.querySelectorAll(e),e=Array.from(e),{}),i=0,a=e;i");var t={container:{className:"whym-m-plugin__container"},explainer:{className:"whym-m-plugin__explainer",textCopy:n.config.overrideCopyExplainer||"Not Ready To Buy?"},cta:{className:"whym-m-plugin__cta",textCopy:n.config.overrideCopyCta||"Text Me This Item",onClick:function(t){t.preventDefault(),t.stopPropagation(),t=[e.productPageRefs.urlName,e.productPageRefs.urlNameParts,e.productPageRefs.urlHost,e.productPageRefs.sku,e.productPageRefs.productName],e.buttonAction({productId:"",variantId:"",productRefs:t})}},followup:{className:"whym-m-plugin__followup",textCopy:"Learn More",href:"https://www.whymwallet.com/shopper"}};(0,o.default)(n.config.cssStyles,n.config.logger);var r=document.createElement("div");r.classList.add(t.container.className);var i=document.createElement("div");i.classList.add(t.explainer.className);var a=document.createElement("div");a.classList.add("".concat(t.explainer.className,"--hr")),a.innerText=" ";var l=document.createElement("p");return l.classList.add("".concat(t.explainer.className,"--text")),l.innerText=t.explainer.textCopy,i.appendChild(a.cloneNode(!0)),i.appendChild(l.cloneNode(!0)),i.appendChild(a.cloneNode(!0)),r.appendChild(i),(a=document.createElement("button")).classList.add(t.cta.className),a.innerText=t.cta.textCopy,a.onclick=t.cta.onClick,r.appendChild(a),(i=document.createElement("div")).classList.add(t.followup.className),(a=document.createElement("a")).classList.add("".concat(t.followup.className,"--text")),a.innerText=t.followup.textCopy,a.href=t.followup.href,a.target="_blank",i.appendChild(a),r.appendChild(i),r},this.extractProductPageRefs=function(){n.config.logger.debug("GenericPluginPlatform");var e=window.location.host,t=window.location.pathname,r=t.split("/");try{r=r.filter((function(e){return 0{Object.defineProperty(t,"__esModule",{value:!0}),t.setUpCustomStyles=t.getFullTMTIStyles=void 0;var n="@overridedStyles",r="\n ".concat("\n .whym-m-plugin__container {\n background-color: #F5F5F4;\n border-radius: 10px;\n padding: 12px 14px;\n margin: 14px 0px;\n display: flex;\n flex-direction: column;\n }\n\n .whym-m-plugin__explainer {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0px;\n margin: 0px 0px 12px;\n }\n\n .whym-m-plugin__explainer--hr {\n flex-grow: 5;\n height: 1px;\n background-color: #232929;\n margin: 0px;\n padding: 0px;\n }\n\n .whym-m-plugin__explainer--text {\n flex-grow: 2;\n text-align: center;\n font-size: 13px;\n color: #232929;\n margin: 0px;\n padding: 0px;\n }\n\n .whym-m-plugin__cta {\n width: 100%;\n background-color: #232929;\n color: #ffffff;\n border: none;\n padding:12px;\n border-radius: 21px;\n font-size: 16px;\n margin: 0px;\n cursor: pointer;\n border-style: solid;\n }\n\n .whym-m-plugin__followup {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 0px;\n margin: 10px 0px 0px;\n }\n\n .whym-m-plugin__followup--text {\n flex: 1;\n text-align: center;\n text-decoration: underline;\n font-size: 13px;\n color: #232929;\n margin: 0px;\n padding: 0px;\n }\n","\n ").concat(n,"\n");t.getFullTMTIStyles=function(e){return e&&0<(null==e?void 0:e.trim().length)?r.replace(n,e):r.replace(n,"")},t.setUpCustomStyles=function(e,n){try{var r=document.head.appendChild(document.createElement("style")),o=(0,t.getFullTMTIStyles)(e);n.log("injected styles",o),r.innerHTML=o}catch(e){return n.error("error - error seting up custom styles"),!1}return!0},t.default=t.setUpCustomStyles},2690:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.injectWhymShopperPlugin=void 0;var r=n(2028);t.injectWhymShopperPlugin=function(e,t){var n;(0,r.featureGateEnabledWithChecks)("shopper-tmti-handler",{developmentOk:!0,stagingOk:!0,invert:!1})?(console.debug("Whym Shopper Plugin - READY",""),(n=document.createElement("script")).src="".concat(e,"/static/embeddable/whym-shopper-plugin").concat("",".js"),document.body.appendChild(n),(n=document.createElement("div")).setAttribute("data-whym-seller",t.sellerAccountId||t.clientToken),n.style.display="none",document.body.appendChild(n)):console.debug("Whym Shopper Plugin - Linking Disabled")},t.default={inject:t.injectWhymShopperPlugin}},1313:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={log:function(){for(var e=[],t=0;to[0]&&a[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.featureGateEnabledWithChecks=t.featureGateEnabled=void 0;var n=new Map([["shopper-tmti-handler",!0],["tmti-drawer-through-shopper-plugin",!0],["jiggle_follow_me",!1]]);t.featureGateEnabled=function(e){return n.get(e)},t.featureGateEnabledWithChecks=function(e,n){return(e=(0,t.featureGateEnabled)(e))||(n.developmentOk,n.stagingOk),!0===n.invert&&(e=!e),n.logToConsole&&console.debug("featureGateEnabledWithChecks environment:",e,{currentEnvironment:"production",options:n}),e}},4311:function(e,t){var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,n=1,r=arguments.length;no[0]&&a[1]$)/g,""),!function(e){var t=e.replace(/^"(.+)"$/,"$1");if(t.trim()){if(/[\.";<>]/.test(t)){if(t===e)return;if(t.split('"').length!==t.split('\\"').length)return}return 1}}(r=r.endsWith(" ")?r.slice(0,-1):r))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>254)return!1;if(n=e.split("@"),e=(r=n.pop()).toLowerCase(),t.host_blacklist.includes(e))return!1;if(0{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return void 0!==window&&null!==window?{currentWindow:window}:{currentWindow:null}}},9451:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IShopperIdentitySignalType=void 0,(t=t.IShopperIdentitySignalType||(t.IShopperIdentitySignalType={})).customId="customId",t.phoneNumber="phoneNumber",t.email="email"}},t={};return function n(r){var o=t[r];return void 0!==o||(o=t[r]={exports:{}},e[r].call(o.exports,o,o.exports,n)),o.exports}(9395)})()})); //# sourceMappingURL=whym-merchant-website-plugin.js.map