@ordergroove/offers 2.32.0 → 2.32.1-alpha-PR-727-3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/offers.js CHANGED
@@ -8,7 +8,7 @@ else {
8
8
  window.og['offers'] = factory();
9
9
  }
10
10
  })(()=>{
11
- var lib=(()=>{var Aa=Object.create;var ot=Object.defineProperty;var Na=Object.getOwnPropertyDescriptor;var Ia=Object.getOwnPropertyNames;var ka=Object.getPrototypeOf,qa=Object.prototype.hasOwnProperty;var In=t=>ot(t,"__esModule",{value:!0}),n=(t,e)=>ot(t,"name",{value:e,configurable:!0});var S=(t,e)=>()=>(t&&(e=t(t=0)),e);var _e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ur=(t,e)=>{In(t);for(var r in e)ot(t,r,{get:e[r],enumerable:!0})},Da=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ia(e))!qa.call(t,o)&&o!=="default"&&ot(t,o,{get:()=>e[o],enumerable:!(r=Na(e,o))||r.enumerable});return t},ce=t=>Da(In(ot(t!=null?Aa(ka(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var qt=_e((kt,jn)=>{(function(t,e){typeof kt=="object"&&typeof jn!="undefined"?e(kt):typeof define=="function"&&define.amd?define(["exports"],e):(t=t||self,e(t.throttleDebounce={}))})(kt,function(t){"use strict";function e(o,s,i,a){var c,l=!1,p=0;function f(){c&&clearTimeout(c)}n(f,"clearExistingTimeout");function u(){f(),l=!0}n(u,"cancel"),typeof s!="boolean"&&(a=i,i=s,s=void 0);function h(){for(var P=arguments.length,_=new Array(P),m=0;m<P;m++)_[m]=arguments[m];var x=this,C=Date.now()-p;if(l)return;function b(){p=Date.now(),i.apply(x,_)}n(b,"exec");function y(){c=void 0}n(y,"clear"),a&&!c&&b(),f(),a===void 0&&C>o?b():s!==!0&&(c=setTimeout(a?y:b,a===void 0?o-C:o))}return n(h,"wrapper"),h.cancel=u,h}n(e,"throttle");function r(o,s,i){return i===void 0?e(o,s,!1):e(o,i,s!==!1)}n(r,"debounce"),t.debounce=r,t.throttle=e,Object.defineProperty(t,"__esModule",{value:!0})})});function Vn(){return typeof window.og_auth!="undefined"?Dt(window.og_auth):null}async function Ba(t=100){return new Promise(e=>{setTimeout(()=>e(Vn()),t)})}async function Hn(t,e=Va,r=Ha){let o;if(o=Dt(Vn())||Dt(e()),o)return o;if(t&&typeof t=="string"){let s=await fetch(t);s.status>=200&&s.status<300&&(o=e()||await(Ga(s)?s.json():Promise.resolve(r(t)).then(e)))}else o||(o=await Ba());if(o=Dt(o),o)return o;throw new Error("Unauthorized")}var $n,Va,Dt,Ha,Ga,Gn=S(()=>{$n=/^og_auth=/,Va=n((t=$n)=>(document.cookie.split(/;\s*/).find(e=>e.match(t))||"").replace($n,""),"c"),Dt=n(t=>{if(typeof t=="object")return t;let e=String(t||"").split("|");return e.length===3?{sig_field:e[0],ts:parseInt(e[1],10),sig:e[2]}:null},"r"),Ha=n(t=>new Promise((e,r)=>{let o=document.createElement("iframe");o.style.setProperty("display","none","important"),document.body.appendChild(o),o.onload=e,o.onerror=r,o.src=t}),"p"),Ga=n(t=>(t.headers.get("content-type")||"").indexOf("application/json")!==-1,"d");n(Vn,"a");n(Ba,"f");n(Hn,"u")});var N,q,D,re,Ue,J,R,st,Le,Ft,Bn,Ut,Se,zn,Lt,Mt,Wn,Me,je,$e,Yn,Jn,jt,Qn,$t,Ve,Kn,Vt,He,it,at,Hr,Ht,Gt,Ee,le,Bt,zt,B,Q,pe,xe,Wt,ve,Te,Yt,Jt,Zn,j=S(()=>{N="OPTIN_PRODUCT",q="OPTOUT_PRODUCT",D="PRODUCT_CHANGE_FREQUENCY",re="PRODUCT_CHANGE_PREPAID_SHIPMENTS",Ue="SET_MERCHANT_ID",J="REQUEST_OFFER",R="RECEIVE_OFFER",st="PRODUCT_HAS_CHANGED",Le="CREATED_SESSION_ID",Ft="SET_AUTH_URL",Bn="REQUEST_AUTH",Ut="AUTHORIZE",Se="UNAUTHORIZED",zn="REQUEST_ORDERS",Lt="RECEIVE_ORDERS",Mt="RECEIVE_ORDER_ITEMS",Wn="FETCH_RESPONSE_ERROR",Me="SET_ENVIRONMENT_STAGING",je="SET_ENVIRONMENT_DEV",$e="SET_ENVIRONMENT_PROD",Yn="CONCLUDE_UPSELL",Jn="REQUEST_CREATE_IU_ORDER",jt="CREATE_ONE_TIME",Qn="REQUEST_CONVERT_ONE_TIME",$t="CONVERT_ONE_TIME",Ve="CHECKOUT",Kn="RECEIVE_FETCH",Vt="SET_LOCALE",He="SET_CONFIG",it="SET_PREVIEW_STANDARD_OFFER",at="SET_PREVIEW_UPSELL_OFFER",Hr="SET_PREVIEW_PREPAID_OFFER",Ht="ADD_TEMPLATE",Gt="SET_TEMPLATES",Ee="LOCAL_STORAGE_CHANGE",le="LOCAL_STORAGE_CLEAR",Bt="SET_FIRST_ORDER_PLACE_DATE",zt="SET_PRODUCT_TO_SUBSCRIBE",B="RECEIVE_PRODUCT_PLANS",Q="SETUP_PRODUCT",pe="SETUP_CART",xe="pdp",Wt="dev",ve="staging",Te="prod",Yt="static.ordergroove.com",Jt="staging.static.ordergroove.com",Zn="og-cart-updated"});var lt=_e((Pu,is)=>{var za="Expected a function",Xn="__lodash_hash_undefined__",Wa="[object Function]",Ya="[object GeneratorFunction]",Ja=/[\\^$.*+?()[\]{}|]/g,Qa=/^\[object .+?Constructor\]$/,Ka=typeof window=="object"&&window&&window.Object===Object&&window,Za=typeof self=="object"&&self&&self.Object===Object&&self,es=Ka||Za||Function("return this")();function Xa(t,e){return t==null?void 0:t[e]}n(Xa,"getValue");function ec(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}n(ec,"isHostObject");var tc=Array.prototype,rc=Function.prototype,ts=Object.prototype,Gr=es["__core-js_shared__"],rs=function(){var t=/[^.]+$/.exec(Gr&&Gr.keys&&Gr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),os=rc.toString,Br=ts.hasOwnProperty,oc=ts.toString,nc=RegExp("^"+os.call(Br).replace(Ja,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),sc=tc.splice,ic=ns(es,"Map"),ct=ns(Object,"create");function Oe(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(Oe,"Hash");function ac(){this.__data__=ct?ct(null):{}}n(ac,"hashClear");function cc(t){return this.has(t)&&delete this.__data__[t]}n(cc,"hashDelete");function lc(t){var e=this.__data__;if(ct){var r=e[t];return r===Xn?void 0:r}return Br.call(e,t)?e[t]:void 0}n(lc,"hashGet");function pc(t){var e=this.__data__;return ct?e[t]!==void 0:Br.call(e,t)}n(pc,"hashHas");function uc(t,e){var r=this.__data__;return r[t]=ct&&e===void 0?Xn:e,this}n(uc,"hashSet");Oe.prototype.clear=ac;Oe.prototype.delete=cc;Oe.prototype.get=lc;Oe.prototype.has=pc;Oe.prototype.set=uc;function Ge(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(Ge,"ListCache");function dc(){this.__data__=[]}n(dc,"listCacheClear");function fc(t){var e=this.__data__,r=Qt(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():sc.call(e,r,1),!0}n(fc,"listCacheDelete");function hc(t){var e=this.__data__,r=Qt(e,t);return r<0?void 0:e[r][1]}n(hc,"listCacheGet");function mc(t){return Qt(this.__data__,t)>-1}n(mc,"listCacheHas");function gc(t,e){var r=this.__data__,o=Qt(r,t);return o<0?r.push([t,e]):r[o][1]=e,this}n(gc,"listCacheSet");Ge.prototype.clear=dc;Ge.prototype.delete=fc;Ge.prototype.get=hc;Ge.prototype.has=mc;Ge.prototype.set=gc;function Pe(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(Pe,"MapCache");function yc(){this.__data__={hash:new Oe,map:new(ic||Ge),string:new Oe}}n(yc,"mapCacheClear");function bc(t){return Kt(this,t).delete(t)}n(bc,"mapCacheDelete");function _c(t){return Kt(this,t).get(t)}n(_c,"mapCacheGet");function Sc(t){return Kt(this,t).has(t)}n(Sc,"mapCacheHas");function Ec(t,e){return Kt(this,t).set(t,e),this}n(Ec,"mapCacheSet");Pe.prototype.clear=yc;Pe.prototype.delete=bc;Pe.prototype.get=_c;Pe.prototype.has=Sc;Pe.prototype.set=Ec;function Qt(t,e){for(var r=t.length;r--;)if(Pc(t[r][0],e))return r;return-1}n(Qt,"assocIndexOf");function xc(t){if(!ss(t)||Tc(t))return!1;var e=wc(t)||ec(t)?nc:Qa;return e.test(Oc(t))}n(xc,"baseIsNative");function Kt(t,e){var r=t.__data__;return vc(e)?r[typeof e=="string"?"string":"hash"]:r.map}n(Kt,"getMapData");function ns(t,e){var r=Xa(t,e);return xc(r)?r:void 0}n(ns,"getNative");function vc(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}n(vc,"isKeyable");function Tc(t){return!!rs&&rs in t}n(Tc,"isMasked");function Oc(t){if(t!=null){try{return os.call(t)}catch{}try{return t+""}catch{}}return""}n(Oc,"toSource");function zr(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(za);var r=n(function(){var o=arguments,s=e?e.apply(this,o):o[0],i=r.cache;if(i.has(s))return i.get(s);var a=t.apply(this,o);return r.cache=i.set(s,a),a},"memoized");return r.cache=new(zr.Cache||Pe),r}n(zr,"memoize");zr.Cache=Pe;function Pc(t,e){return t===e||t!==t&&e!==e}n(Pc,"eq");function wc(t){var e=ss(t)?oc.call(t):"";return e==Wa||e==Ya}n(wc,"isFunction");function ss(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}n(ss,"isObject");is.exports=zr});var Zt,Wr,pt,ut,Xt,as,cs,Cc,Rc,Ac,Nc,Ic,dt,Yr,kc,ls,ft,qc,ue,de=S(()=>{Zt=ce(lt()),Wr=n((...t)=>JSON.stringify(t),"memoizeKey"),pt=n(t=>(...e)=>fetch(...t(...e)).then(r=>r.json()),"withFetchJson"),ut=n(t=>(e,...r)=>{if(!e)throw Error("host required");let[o,s={}]=t(...r);return[`${e.replace(/\/+$/,"")}${o}`,s]},"withHost"),Xt=n(t=>(e,...r)=>{if(!e)throw Error("auth required");let[o,s={}]=t(...r);return[o,{...s,headers:{Authorization:JSON.stringify(e),...s.headers}}]},"withAuth"),as=n(t=>(...e)=>{let[r,o={}]=t(...e);return[r,{method:"POST",...o,body:JSON.stringify(o.body),headers:{"Content-type":"application/json",...o.headers}}]},"withJsonBody"),cs=n((t=[])=>(Array.isArray(t)?t:Object.entries(t)).map(([e,r])=>[e,encodeURIComponent(r)].join("=")).join("&"),"toQuery"),Cc=n(t=>JSON.stringify([].concat(t).map(e=>typeof e=="object"?e.id:e).filter(e=>e)),"toProductId"),Rc=(0,Zt.default)(pt(ut((t,e,r,o="pdp")=>{if(!t)throw Error("merchantId required");if(!e)throw Error("sessionId required");if(!r)throw Error("product required");let s=cs([["session_id",e],["page_type",1],["p",Cc(r)],["module_view",JSON.stringify(["regular"])]]);return[`/offer/${t}/${o}?${s}`]})),Wr),Ac=(0,Zt.default)(pt(ut(Xt((t=1,e="place")=>[`/orders/?${cs([["status",t],["ordering",e],["exclude_prepaid_orders","true"]])}`]))),Wr),Nc=(0,Zt.default)(pt(ut(Xt(t=>{if(!t)throw Error("orderId required");return[`/items/?order=${t}`]}))),Wr),Ic=pt(ut(Xt(as((t,e,r,o)=>{if(!t)throw Error("product required");if(!e)throw Error("order required");if(!r)throw Error("quantity required");if(r<=0)throw Error("quantity must be greater or equal than one");if(!o)throw Error("offer required");return["/items/iu/",{body:{product:t,order:e,quantity:r,offer:o}}]})))),dt=n(t=>{if(typeof t=="object")return{...t};let[e,r]=(t||"").split(/_/).map(o=>parseInt(o,10));return e&&r&&{every:e,every_period:r}},"parseFrequency"),Yr=n(t=>t.match(/^\d+_\d$/),"isFrequencyValid"),kc=n((t,e)=>String.prototype.localeCompare.call(t&&t.split("_").reverse().join("_"),e&&e.split("_").reverse().join("_")),"compareFrequencies"),ls=n(t=>[...new Set(t&&t.split(/\s+/))].filter(Yr).sort(kc),"parseFrequenciesList"),ft=n(t=>{if(typeof t=="object"){let{every:e,period:r,every_period:o}=t;return`${e}_${r||o}`}return typeof t=="string"?t:""},"stringifyFrequency"),qc=pt(ut(Xt(as((t,e,r)=>{if(!t)throw Error("item required");if(!e)throw Error("frequency required");let o=dt(e);if(!o)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:{item:t.public_id,offer:r,...o}}]})))),ue={fetchOffer:Rc,fetchOrders:Ac,fetchItems:Nc,createOneTime:Ic,convertOneTimeToSubscription:qc}});var Jr,L,ht=S(()=>{F();Jr=mt(),L={shopify:typeof window.Shopify!="undefined",shopify_selling_plans:typeof(Jr==null?void 0:Jr.dataset.shopifySellingPlans)!="undefined"}});function Dc(t,e){return t===e}function Fc(t,e,r){if(e===null||r===null||e.length!==r.length)return!1;for(var o=e.length,s=0;s<o;s++)if(!t(e[s],r[s]))return!1;return!0}function Uc(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dc,r=null,o=null;return function(){return Fc(e,r,arguments)||(o=t.apply(null,arguments)),r=arguments,o}}function Lc(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every(function(o){return typeof o=="function"})){var r=e.map(function(o){return typeof o}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, "+("instead received the following types: ["+r+"]"))}return e}function Mc(t){for(var e=arguments.length,r=Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];return function(){for(var s=arguments.length,i=Array(s),a=0;a<s;a++)i[a]=arguments[a];var c=0,l=i.pop(),p=Lc(i),f=t.apply(void 0,[function(){return c++,l.apply(null,arguments)}].concat(r)),u=t(function(){for(var h=[],P=p.length,_=0;_<P;_++)h.push(p[_].apply(null,arguments));return f.apply(null,h)});return u.resultFunc=l,u.dependencies=p,u.recomputations=function(){return c},u.resetRecomputations=function(){return c=0},u}}var K,ps=S(()=>{n(Dc,"defaultEqualityCheck");n(Fc,"areArgumentsShallowlyEqual");n(Uc,"defaultMemoize");n(Lc,"getDependencies");n(Mc,"createSelectorCreator");K=Mc(Uc)});function jc(t,e){if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}function $c(t,e,r){let o=ft(r);return L.shopify_selling_plans?ee(t,e,o):o}var z,I,gt,us,Qr,Vc,Hc,Gc,Bc,zc,Z,er,ds,tr,rr,X,or,nr,Be,Kr,H,ze,U=S(()=>{ps();z=ce(lt());de();ht();F();z.default.Cache=Map;n(jc,"arraysEqual");n($c,"resolveFrequency");I=n((t,e)=>!!(t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&t.id===e.id&&(!(Array.isArray(t.components)&&Array.isArray(e.components))||jc((t.components||[]).sort(),(e.components||[]).sort()))),"isSameProduct"),gt=n(t=>t.optedin||[],"optedinSelector"),us=n(t=>t.optedout||[],"optedoutSelector"),Qr=n(t=>t.autoshipByDefault||{},"autoshipSelector"),Vc=n(t=>t.defaultFrequencies||{},"defaultFrequenciesSelector"),Hc=n(t=>{var e;return((e=t==null?void 0:t.config)==null?void 0:e.frequencies)||[]},"sellingPlansSelector"),Gc=n(t=>{var e;return((e=t==null?void 0:t.config)==null?void 0:e.frequenciesEveryPeriod)||[]},"frequenciesEveryPeriodSelector"),Bc=n(t=>{var e;return((e=t==null?void 0:t.config)==null?void 0:e.prepaidSellingPlans)||[]},"prepaidSellingPlansSelector"),zc=n(t=>(t==null?void 0:t.prepaidShipmentsSelected)||{},"prepaidShipmentsSelectedSelector"),Z=(0,z.default)(t=>K(gt,us,Qr,(e,r,o)=>{let s=e.find(i=>I(t,i));return s||(r.find(i=>I(t,i))?!1:t&&o[t.id]?{id:t.id}:!1)}),t=>JSON.stringify(t)),er=(0,z.default)(t=>K(gt,e=>{let r=e.find(o=>I(t,o));return r||!1}),t=>JSON.stringify(t)),ds=(0,z.default)(t=>K(gt,e=>e.some(r=>I(t,r)&&r.prepaidShipments)),t=>JSON.stringify(t)),tr=(0,z.default)(t=>K(zc,e=>e[t.id]||null),t=>JSON.stringify(t)),rr=(0,z.default)(t=>K(us,e=>e.find(r=>I(t,r)))),X=(0,z.default)(t=>K(Z(t),e=>e&&e.frequency||null)),or=(0,z.default)(t=>K(Z(t),e=>e&&e.prepaidShipments||null)),nr=(0,z.default)(t=>K(Bc,e=>{var r;return((r=e[t])==null?void 0:r.map(({numberShipments:o})=>o))||[]})),Be=(0,z.default)(t=>K(Vc,Hc,Gc,(e,r,o)=>e[w(t)]&&$c(r,o,e[w(t)])||null)),Kr=n(t=>t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),"kebabCase"),H=n((t,e,r,o)=>({[r]:t.config&&t.config[r]||e&&e.hasAttribute&&e.hasAttribute(Kr(r))&&e[r]||e.offer&&typeof(e.offer[r]!=="undefined")&&e.offer[r]||o}),"configSelector"),ze=n(t=>({templates:t.templates||[]}),"templatesSelector")});function sr(t){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t()}function mt(){return document.querySelector([`script[src^="https://${Yt}"]`,`script[src^="https://${Jt}"]`,`script[src^="http://${Yt}"]`,`script[src^="http://${Jt}"]`].join(","))}function Zr(){let t=mt();if(!t)return[];let e=new URL(t.src),r=e.host.startsWith(ve)?ve:Te,o=e.pathname.split("/")[1];return!r&&!o?[]:[o,r,t]}function hs(t){if(t.isReady())return;console.info("OG offers are auto initializing");let[e,r]=Zr();if(!r&&!e)return;let o=document.createElement("script");o.onload=()=>console.info("OG pull initialization chunk for merchant",e,r),o.onerror=()=>t.initialize(e,r),o.src=`${window.location.protocol}//${r===Te?Yt:Jt}/${e}/main.js?initOnly=true`,document.head.appendChild(o)}function gs(t){let e=document.cookie.match(`(^|;) ?${t}=([^;]*)(;|$)`);return e?e[2]:null}function ys(t,e,r){let o=t.querySelector(`[name="${e}"]`);if(o&&!r){o.remove();return}!o&&r&&(o=document.createElement("input"),o.type="hidden",o.name=e,t.appendChild(o)),o&&(o.value=r)}function Ye(t,e){let[[r],o]=t.reduce((s,i)=>s[I(e,i)?0:1].push(i)&&s,[[],[]]);return[r||{},o||[]]}var w,fs,Xr,ms,We,we,ir,ee,F=S(()=>{ht();j();U();n(sr,"onReady");n(mt,"getMainJs");n(Zr,"resolveEnvAndMerchant");w=n(t=>{var r;if(!t)return"";let e=`${t.id||t}`;return((r=L)==null?void 0:r.shopify_selling_plans)&&(e=e.split(":")[0]),e},"safeProductId"),fs=n((t,e)=>{var r;if(L.shopify_selling_plans){let o=(r=e.frequencies)==null?void 0:r.indexOf(t);if(o>=0&&e.frequenciesEveryPeriod[o])return e.frequenciesEveryPeriod[o]}return t},"safeOgFrequency"),Xr=n((t,e)=>{var o;if(!`${t}`.includes("_"))return t;let r=(o=e.frequenciesEveryPeriod)==null?void 0:o.indexOf(t);return r>=0&&e.frequenciesEveryPeriod[r]?e.frequencies[r]:t},"frequencyToSellingPlan");n(hs,"autoInitializeOffers");ms=n(t=>{document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`},"clearCookie");n(gs,"getCookieValue");We=n(t=>!!(t&&(t==null?void 0:t.includes("_"))),"isOgFrequency"),we=n((t=[])=>(t==null?void 0:t[0])||null,"getFirstSellingPlan"),ir=n((t=[],e=[])=>{var r;return!!(((r=L)==null?void 0:r.shopify_selling_plans)&&t.length&&e.length)},"hasShopifySellingPlans"),ee=n((t,e,r)=>{if(t.length!==e.length)return null;let o=e.findIndex(s=>s===r);return o>=0?t[o]:null},"mapFrequencyToSellingPlan");n(ys,"getOrCreateHidden");n(Ye,"getMatchingProductIfExists")});var oe,Je,bs,ar,_s,Ss,Es,eo,Wc,yt,fe,xs,cr,vs,Yc,to,ro,lr,oo,Ts,Ce,no,Jc,Os,Ps,Qc,Kc,Zc,Xc,ws,Cs,Rs,As,Ns,Is,ks,k=S(()=>{Gn();j();de();F();oe=n((t,e,r)=>({type:N,payload:{product:t,frequency:e,offer:r}}),"optinProduct"),Je=n((t,e)=>({type:q,payload:{product:t,offer:e}}),"optoutProduct"),bs=n((t,e)=>({type:st,payload:{newProduct:t,product:e}}),"productHasChangedComponents"),ar=n((t,e,r)=>({type:D,payload:{product:t,frequency:e,offer:r}}),"productChangeFrequency"),_s=n((t,e,r)=>({type:re,payload:{product:t,prepaidShipments:e,offer:r}}),"productChangePrepaidShipments"),Ss=n(t=>({type:Yn,payload:{product:t}}),"concludeUpsell"),Es=n(t=>({type:Ue,payload:t}),"setMerchantId"),eo=n(t=>({type:Le,payload:`${t}.${Math.floor(Math.random()*999999)}.${Math.round(new Date().getTime()/1e3)}`}),"createSessionId"),Wc=n(t=>({type:Bn,payload:t}),"requestAuth"),yt=n((t,e,r,o)=>({type:Ut,payload:{public_id:t,sig_field:e,ts:r,sig:o}}),"authorize"),fe=n(t=>({type:Se,payload:t}),"unauthorized"),xs=n(t=>({type:Ft,payload:t}),"setAuthUrl"),cr=n(t=>({type:Kn,payload:t}),"fetchDone"),vs=n((t=Hn)=>n(function(r,o){if(window.og&&window.og.previewMode)return r(fe({message:"Offers are running in preview mode"}));let{merchantId:s,authUrl:i}=o(),a=Wc(i);return r(a),t(i).then(({sig_field:c,ts:l,sig:p})=>r(yt(s,c,l,p)),c=>r(fe(c))).finally(()=>r(cr(a)))},"fetchAuthThunk"),"fetchAuth"),Yc=n((t,e)=>({type:zn,payload:{status:t,ordering:e}}),"requestOrders"),to=n(t=>({type:Lt,payload:t}),"receiveOrders"),ro=n(t=>({type:Mt,payload:t}),"receiveItems"),lr=n((t=1,e="place")=>n(function(o,s){let{environment:{legoUrl:i},auth:a}=s();if(!a)return o(fe("No auth set."));let c=Yc(t,e);return o(c),ue.fetchOrders(i,a,t,e).then(l=>{if(l.results){o(to(l));let p=(l.results[0]||{}).public_id;if(p)return ue.fetchItems(i,a,p).then(f=>o(ro(f)))}return o(fe(l.detail)),null},l=>o(fe(l))).finally(()=>o(cr(c)))},"fetchOrdersThunk"),"fetchOrders"),oo=n(t=>{switch(t){case Wt:return{type:je,payload:t};case ve:return{type:Me,payload:t};case Te:return{type:$e,payload:t};default:throw new Error(`${t} is not a supported environment`)}},"setEnvironment"),Ts=n(()=>(t,e)=>{let{merchantId:r,sessionId:o}=e();return(!o||r&&!o.startsWith(r))&&t(eo(r)),o},"requestSessionId"),Ce=n((t,e)=>({type:R,payload:{...t,offer:e}}),"receiveOffer"),no=n(t=>({type:Wn,payload:t}),"fetchResponseError"),Jc=n((t,e=xe,r)=>({type:J,payload:{product:t,module:e,offer:r}}),"requestOffer"),Os=n((t,e=xe,r)=>n(function(s,i){let{merchantId:a,sessionId:c,environment:{apiUrl:l}}=i(),p=Jc(t,e,r);s(p);let f=w(t);return f?ue.fetchOffer(l,a,c,f,e).then(u=>s(Ce(u,r)),u=>s(no(u))).finally(()=>s(cr(p))):null},"fetchOfferThunk"),"fetchOffer"),Ps=n(()=>({type:Ve}),"checkout"),Qc=n((t,e,r,o)=>({type:Jn,payload:{product:t,order:e,quantity:r,offerId:o}}),"requestCreateOneTime"),Kc=n(t=>({type:jt,payload:t}),"receiveCreateOneTime"),Zc=n((t,e)=>({type:Qn,payload:{item:t,frequency:e}}),"requestConvertOneTimeToSubscription"),Xc=n((t,e)=>({type:$t,payload:{response:t,product:e}}),"receiveConvertOneTime"),ws=n((t,e,r,o=!1,s=null)=>n(function(a,c){let{auth:l,config:p,environment:{legoUrl:f},previewUpsellOffer:u,offerId:h}=c();if(!l)return a(fe("No auth set."));let P=fs(s,p),_=Qc(t,e,r,h);return a(_),(u?Promise.resolve({legoUrl:f,product:t,order:e,quantity:r,offer:h}):ue.createOneTime(f,l,t.id,e,r,h)).then(m=>(a(Kc(m)),o?(a(Zc(m,P)),(u?Promise.resolve({item:m,frequency:P}):ue.convertOneTimeToSubscription(f,l,m,P,h)).then(x=>a(Xc(x,t)),x=>a(no(x)))):m),m=>a(no(m))).finally(()=>a(cr(_)))},"createIuThunk"),"createIu"),Cs=n(t=>({type:Vt,payload:t}),"setLocale"),Rs=n(t=>({type:He,payload:t}),"setConfig"),As=n((t,e,r)=>({type:Ht,payload:{selector:t,markup:e,config:r}}),"addTemplate"),Ns=n(t=>({type:Gt,payload:t}),"setTemplates"),Is=n((t,e)=>({type:Bt,payload:{product:t,firstOrderPlaceDate:e}}),"setFirstOrderPlaceDate"),ks=n((t,e)=>({type:zt,payload:{product:t,productToSubscribe:e}}),"setProductToSubscribe")});var lo,Re,Ae=S(()=>{lo=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,Re=n((t,e,r=null)=>{for(;e!==r;){let o=e.nextSibling;t.removeChild(e),e=o}},"removeNodes")});var G,po,Qs,Ke,Ne,Ks,_t,te,dr,he=S(()=>{G=`{{lit-${String(Math.random()).slice(2)}}}`,po=`<!--${G}-->`,Qs=new RegExp(`${G}|${po}`),Ke="$lit$",Ne=class{constructor(e,r){this.parts=[],this.element=r;let o=[],s=[],i=document.createTreeWalker(r.content,133,null,!1),a=0,c=-1,l=0,{strings:p,values:{length:f}}=e;for(;l<f;){let u=i.nextNode();if(u===null){i.currentNode=s.pop();continue}if(c++,u.nodeType===1){if(u.hasAttributes()){let h=u.attributes,{length:P}=h,_=0;for(let m=0;m<P;m++)Ks(h[m].name,Ke)&&_++;for(;_-- >0;){let m=p[l],x=dr.exec(m)[2],C=x.toLowerCase()+Ke,b=u.getAttribute(C);u.removeAttribute(C);let y=b.split(Qs);this.parts.push({type:"attribute",index:c,name:x,strings:y}),l+=y.length-1}}u.tagName==="TEMPLATE"&&(s.push(u),i.currentNode=u.content)}else if(u.nodeType===3){let h=u.data;if(h.indexOf(G)>=0){let P=u.parentNode,_=h.split(Qs),m=_.length-1;for(let x=0;x<m;x++){let C,b=_[x];if(b==="")C=te();else{let y=dr.exec(b);y!==null&&Ks(y[2],Ke)&&(b=b.slice(0,y.index)+y[1]+y[2].slice(0,-Ke.length)+y[3]),C=document.createTextNode(b)}P.insertBefore(C,u),this.parts.push({type:"node",index:++c})}_[m]===""?(P.insertBefore(te(),u),o.push(u)):u.data=_[m],l+=m}}else if(u.nodeType===8)if(u.data===G){let h=u.parentNode;(u.previousSibling===null||c===a)&&(c++,h.insertBefore(te(),u)),a=c,this.parts.push({type:"node",index:c}),u.nextSibling===null?u.data="":(o.push(u),c--),l++}else{let h=-1;for(;(h=u.data.indexOf(G,h+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(let u of o)u.parentNode.removeChild(u)}};n(Ne,"Template");Ks=n((t,e)=>{let r=t.length-e.length;return r>=0&&t.slice(r)===e},"endsWith"),_t=n(t=>t.index!==-1,"isTemplatePartActive"),te=n(()=>document.createComment(""),"createMarker"),dr=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/});function fo(t,e){let{element:{content:r},parts:o}=t,s=document.createTreeWalker(r,uo,null,!1),i=St(o),a=o[i],c=-1,l=0,p=[],f=null;for(;s.nextNode();){c++;let u=s.currentNode;for(u.previousSibling===f&&(f=null),e.has(u)&&(p.push(u),f===null&&(f=u)),f!==null&&l++;a!==void 0&&a.index===c;)a.index=f!==null?-1:a.index-l,i=St(o,i),a=o[i]}p.forEach(u=>u.parentNode.removeChild(u))}function Zs(t,e,r=null){let{element:{content:o},parts:s}=t;if(r==null){o.appendChild(e);return}let i=document.createTreeWalker(o,uo,null,!1),a=St(s),c=0,l=-1;for(;i.nextNode();)for(l++,i.currentNode===r&&(c=al(e),r.parentNode.insertBefore(e,r));a!==-1&&s[a].index===l;){if(c>0){for(;a!==-1;)s[a].index+=c,a=St(s,a);return}a=St(s,a)}}var uo,al,St,Xs=S(()=>{he();uo=133;n(fo,"removeNodesFromTemplate");al=n(t=>{let e=t.nodeType===11?0:1,r=document.createTreeWalker(t,uo,null,!1);for(;r.nextNode();)e++;return e},"countNodes"),St=n((t,e=-1)=>{for(let r=e+1;r<t.length;r++){let o=t[r];if(_t(o))return r}return-1},"nextActiveIndexInTemplateParts");n(Zs,"insertNodeIntoTemplate")});var cl,Ie,ho=S(()=>{cl=new WeakMap,Ie=n(t=>typeof t=="function"&&cl.has(t),"isDirective")});var $,fr,mo=S(()=>{$={},fr={}});var me,hr=S(()=>{Ae();he();me=class{constructor(e,r,o){this.__parts=[],this.template=e,this.processor=r,this.options=o}update(e){let r=0;for(let o of this.__parts)o!==void 0&&o.setValue(e[r]),r++;for(let o of this.__parts)o!==void 0&&o.commit()}_clone(){let e=lo?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),r=[],o=this.template.parts,s=document.createTreeWalker(e,133,null,!1),i=0,a=0,c,l=s.nextNode();for(;i<o.length;){if(c=o[i],!_t(c)){this.__parts.push(void 0),i++;continue}for(;a<c.index;)a++,l.nodeName==="TEMPLATE"&&(r.push(l),s.currentNode=l.content),(l=s.nextNode())===null&&(s.currentNode=r.pop(),l=s.nextNode());if(c.type==="node"){let p=this.processor.handleTextExpression(this.options);p.insertAfterNode(l.previousSibling),this.__parts.push(p)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,c.name,c.strings,this.options));i++}return lo&&(document.adoptNode(e),customElements.upgrade(e)),e}};n(me,"TemplateInstance")});var ei,pl,ne,mr=S(()=>{Ae();he();ei=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),pl=` ${G} `,ne=class{constructor(e,r,o,s){this.strings=e,this.values=r,this.type=o,this.processor=s}getHTML(){let e=this.strings.length-1,r="",o=!1;for(let s=0;s<e;s++){let i=this.strings[s],a=i.lastIndexOf("<!--");o=(a>-1||o)&&i.indexOf("-->",a+1)===-1;let c=dr.exec(i);c===null?r+=i+(o?pl:po):r+=i.substr(0,c.index)+c[1]+c[2]+Ke+c[3]+G}return r+=this.strings[e],r}getTemplateElement(){let e=document.createElement("template"),r=this.getHTML();return ei!==void 0&&(r=ei.createHTML(r)),e.innerHTML=r,e}};n(ne,"TemplateResult")});var gr,yr,Ze,Et,se,xt,vt,br,ti,Tt,ul,_r=S(()=>{ho();Ae();mo();hr();mr();he();gr=n(t=>t===null||!(typeof t=="object"||typeof t=="function"),"isPrimitive"),yr=n(t=>Array.isArray(t)||!!(t&&t[Symbol.iterator]),"isIterable"),Ze=class{constructor(e,r,o){this.dirty=!0,this.element=e,this.name=r,this.strings=o,this.parts=[];for(let s=0;s<o.length-1;s++)this.parts[s]=this._createPart()}_createPart(){return new Et(this)}_getValue(){let e=this.strings,r=e.length-1,o=this.parts;if(r===1&&e[0]===""&&e[1]===""){let i=o[0].value;if(typeof i=="symbol")return String(i);if(typeof i=="string"||!yr(i))return i}let s="";for(let i=0;i<r;i++){s+=e[i];let a=o[i];if(a!==void 0){let c=a.value;if(gr(c)||!yr(c))s+=typeof c=="string"?c:String(c);else for(let l of c)s+=typeof l=="string"?l:String(l)}}return s+=e[r],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}};n(Ze,"AttributeCommitter");Et=class{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==$&&(!gr(e)||e!==this.value)&&(this.value=e,Ie(e)||(this.committer.dirty=!0))}commit(){for(;Ie(this.value);){let e=this.value;this.value=$,e(this)}this.value!==$&&this.committer.commit()}};n(Et,"AttributePart");se=class{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(te()),this.endNode=e.appendChild(te())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=te()),e.__insert(this.endNode=te())}insertAfterPart(e){e.__insert(this.startNode=te()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;Ie(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=$,r(this)}let e=this.__pendingValue;e!==$&&(gr(e)?e!==this.value&&this.__commitText(e):e instanceof ne?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):yr(e)?this.__commitIterable(e):e===fr?(this.value=fr,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){let r=this.startNode.nextSibling;e=e??"";let o=typeof e=="string"?e:String(e);r===this.endNode.previousSibling&&r.nodeType===3?r.data=o:this.__commitNode(document.createTextNode(o)),this.value=e}__commitTemplateResult(e){let r=this.options.templateFactory(e);if(this.value instanceof me&&this.value.template===r)this.value.update(e.values);else{let o=new me(r,e.processor,this.options),s=o._clone();o.update(e.values),this.__commitNode(s),this.value=o}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());let r=this.value,o=0,s;for(let i of e)s=r[o],s===void 0&&(s=new se(this.options),r.push(s),o===0?s.appendIntoPart(this):s.insertAfterPart(r[o-1])),s.setValue(i),s.commit(),o++;o<r.length&&(r.length=o,this.clear(s&&s.endNode))}clear(e=this.startNode){Re(this.startNode.parentNode,e.nextSibling,this.endNode)}};n(se,"NodePart");xt=class{constructor(e,r,o){if(this.value=void 0,this.__pendingValue=void 0,o.length!==2||o[0]!==""||o[1]!=="")throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=r,this.strings=o}setValue(e){this.__pendingValue=e}commit(){for(;Ie(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=$,r(this)}if(this.__pendingValue===$)return;let e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=$}};n(xt,"BooleanAttributePart");vt=class extends Ze{constructor(e,r,o){super(e,r,o);this.single=o.length===2&&o[0]===""&&o[1]===""}_createPart(){return new br(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}};n(vt,"PropertyCommitter");br=class extends Et{};n(br,"PropertyPart");ti=!1;(()=>{try{let t={get capture(){return ti=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{}})();Tt=class{constructor(e,r,o){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=r,this.eventContext=o,this.__boundHandleEvent=s=>this.handleEvent(s)}setValue(e){this.__pendingValue=e}commit(){for(;Ie(this.__pendingValue);){let i=this.__pendingValue;this.__pendingValue=$,i(this)}if(this.__pendingValue===$)return;let e=this.__pendingValue,r=this.value,o=e==null||r!=null&&(e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive),s=e!=null&&(r==null||o);o&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=ul(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=$}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}};n(Tt,"EventPart");ul=n(t=>t&&(ti?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),"getOptions")});function go(t){let e=ke.get(t.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},ke.set(t.type,e));let r=e.stringsArray.get(t.strings);if(r!==void 0)return r;let o=t.strings.join(G);return r=e.keyString.get(o),r===void 0&&(r=new Ne(t,t.getTemplateElement()),e.keyString.set(o,r)),e.stringsArray.set(t.strings,r),r}var ke,Sr=S(()=>{he();n(go,"templateFactory");ke=new Map});var ge,yo,bo=S(()=>{Ae();_r();Sr();ge=new WeakMap,yo=n((t,e,r)=>{let o=ge.get(e);o===void 0&&(Re(e,e.firstChild),ge.set(e,o=new se(Object.assign({templateFactory:go},r))),o.appendInto(e)),o.setValue(t),o.commit()},"render")});var Er,_o,So=S(()=>{_r();Er=class{handleAttributeExpressions(e,r,o,s){let i=r[0];return i==="."?new vt(e,r.slice(1),o).parts:i==="@"?[new Tt(e,r.slice(1),s.eventContext)]:i==="?"?[new xt(e,r.slice(1),o)]:new Ze(e,r,o).parts}handleTextExpression(e){return new se(e)}};n(Er,"DefaultTemplateProcessor");_o=new Er});var d,Eo=S(()=>{So();mr();So();ho();Ae();mo();_r();bo();Sr();hr();mr();he();typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");d=n((t,...e)=>new ne(t,e,"html",_o),"html")});var oi,xr,fl,hl,ml,ni,gl,si,ii=S(()=>{Ae();Xs();bo();Sr();hr();he();Eo();oi=n((t,e)=>`${t}--${e}`,"getTemplateCacheKey"),xr=!0;typeof window.ShadyCSS=="undefined"?xr=!1:typeof window.ShadyCSS.prepareTemplateDom=="undefined"&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),xr=!1);fl=n(t=>e=>{let r=oi(e.type,t),o=ke.get(r);o===void 0&&(o={stringsArray:new WeakMap,keyString:new Map},ke.set(r,o));let s=o.stringsArray.get(e.strings);if(s!==void 0)return s;let i=e.strings.join(G);if(s=o.keyString.get(i),s===void 0){let a=e.getTemplateElement();xr&&window.ShadyCSS.prepareTemplateDom(a,t),s=new Ne(e,a),o.keyString.set(i,s)}return o.stringsArray.set(e.strings,s),s},"shadyTemplateFactory"),hl=["html","svg"],ml=n(t=>{hl.forEach(e=>{let r=ke.get(oi(e,t));r!==void 0&&r.keyString.forEach(o=>{let{element:{content:s}}=o,i=new Set;Array.from(s.querySelectorAll("style")).forEach(a=>{i.add(a)}),fo(o,i)})})},"removeStylesFromLitTemplates"),ni=new Set,gl=n((t,e,r)=>{ni.add(t);let o=r?r.element:document.createElement("template"),s=e.querySelectorAll("style"),{length:i}=s;if(i===0){window.ShadyCSS.prepareTemplateStyles(o,t);return}let a=document.createElement("style");for(let p=0;p<i;p++){let f=s[p];f.parentNode.removeChild(f),a.textContent+=f.textContent}ml(t);let c=o.content;r?Zs(r,a,c.firstChild):c.insertBefore(a,c.firstChild),window.ShadyCSS.prepareTemplateStyles(o,t);let l=c.querySelector("style");if(window.ShadyCSS.nativeShadow&&l!==null)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(r){c.insertBefore(a,c.firstChild);let p=new Set;p.add(a),fo(r,p)}},"prepareTemplateStyles"),si=n((t,e,r)=>{if(!r||typeof r!="object"||!r.scopeName)throw new Error("The `scopeName` option is required.");let o=r.scopeName,s=ge.has(e),i=xr&&e.nodeType===11&&!!e.host,a=i&&!ni.has(o),c=a?document.createDocumentFragment():e;if(yo(t,c,Object.assign({templateFactory:fl(o)},r)),a){let l=ge.get(c);ge.delete(c);let p=l.value instanceof me?l.value.template:void 0;gl(o,c,p),Re(e,e.firstChild),e.appendChild(c),ge.set(e,l)}!s&&i&&window.ShadyCSS.styleElement(e.host)},"render")});var ai,xo,ci,vo,To,Oo,Po,wo,Co,Ot,Ro=S(()=>{window.JSCompiler_renameProperty=(t,e)=>t;xo={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return t!==null;case Number:return t===null?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},ci=n((t,e)=>e!==t&&(e===e||t===t),"notEqual"),vo={attribute:!0,type:String,converter:xo,reflect:!1,hasChanged:ci},To=1,Oo=1<<2,Po=1<<3,wo=1<<4,Co="finalized",Ot=class extends HTMLElement{constructor(){super();this.initialize()}static get observedAttributes(){this.finalize();let e=[];return this._classProperties.forEach((r,o)=>{let s=this._attributeNameForProperty(o,r);s!==void 0&&(this._attributeToPropertyMap.set(s,o),e.push(s))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;let e=Object.getPrototypeOf(this)._classProperties;e!==void 0&&e.forEach((r,o)=>this._classProperties.set(o,r))}}static createProperty(e,r=vo){if(this._ensureClassProperties(),this._classProperties.set(e,r),r.noAccessor||this.prototype.hasOwnProperty(e))return;let o=typeof e=="symbol"?Symbol():`__${e}`,s=this.getPropertyDescriptor(e,o,r);s!==void 0&&Object.defineProperty(this.prototype,e,s)}static getPropertyDescriptor(e,r,o){return{get(){return this[r]},set(s){let i=this[e];this[r]=s,this.requestUpdateInternal(e,i,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||vo}static finalize(){let e=Object.getPrototypeOf(this);if(e.hasOwnProperty(Co)||e.finalize(),this[Co]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){let r=this.properties,o=[...Object.getOwnPropertyNames(r),...typeof Object.getOwnPropertySymbols=="function"?Object.getOwnPropertySymbols(r):[]];for(let s of o)this.createProperty(s,r[s])}}static _attributeNameForProperty(e,r){let o=r.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}static _valueHasChanged(e,r,o=ci){return o(e,r)}static _propertyValueFromAttribute(e,r){let o=r.type,s=r.converter||xo,i=typeof s=="function"?s:s.fromAttribute;return i?i(e,o):e}static _propertyValueToAttribute(e,r){if(r.reflect===void 0)return;let o=r.type,s=r.converter;return(s&&s.toAttribute||xo.toAttribute)(e,o)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,r)=>{if(this.hasOwnProperty(r)){let o=this[r];delete this[r],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(r,o)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,r)=>this[r]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){this._enableUpdatingResolver!==void 0&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,r,o){r!==o&&this._attributeToProperty(e,o)}_propertyToAttribute(e,r,o=vo){let s=this.constructor,i=s._attributeNameForProperty(e,o);if(i!==void 0){let a=s._propertyValueToAttribute(r,o);if(a===void 0)return;this._updateState=this._updateState|Po,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._updateState=this._updateState&~Po}}_attributeToProperty(e,r){if(this._updateState&Po)return;let o=this.constructor,s=o._attributeToPropertyMap.get(e);if(s!==void 0){let i=o.getPropertyOptions(s);this._updateState=this._updateState|wo,this[s]=o._propertyValueFromAttribute(r,i),this._updateState=this._updateState&~wo}}requestUpdateInternal(e,r,o){let s=!0;if(e!==void 0){let i=this.constructor;o=o||i.getPropertyOptions(e),i._valueHasChanged(this[e],r,o.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,r),o.reflect===!0&&!(this._updateState&wo)&&(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,o))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,r){return this.requestUpdateInternal(e,r),this.updateComplete}async _enqueueUpdate(){this._updateState=this._updateState|Oo;try{await this._updatePromise}catch{}let e=this.performUpdate();return e!=null&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return this._updateState&Oo}get hasUpdated(){return this._updateState&To}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1,r=this._changedProperties;try{e=this.shouldUpdate(r),e?this.update(r):this._markUpdated()}catch(o){throw e=!1,this._markUpdated(),o}e&&(this._updateState&To||(this._updateState=this._updateState|To,this.firstUpdated(r)),this.updated(r))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~Oo}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){this._reflectingProperties!==void 0&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((r,o)=>this._propertyToAttribute(o,this[o],r)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}};n(Ot,"UpdatingElement");ai=Co;Ot[ai]=!0});var li,df,pi=S(()=>{li=Element.prototype,df=li.msMatchesSelector||li.webkitMatchesSelector});var vr,Ao,Pt,ui,yl,E,No=S(()=>{vr=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ao=Symbol(),Pt=class{constructor(e,r){if(r!==Ao)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return this._styleSheet===void 0&&(vr?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}};n(Pt,"CSSResult");ui=n(t=>new Pt(String(t),Ao),"unsafeCSS"),yl=n(t=>{if(t instanceof Pt)return t.cssText;if(typeof t=="number")return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but
11
+ var lib=(()=>{var Aa=Object.create;var ot=Object.defineProperty;var Na=Object.getOwnPropertyDescriptor;var Ia=Object.getOwnPropertyNames;var ka=Object.getPrototypeOf,qa=Object.prototype.hasOwnProperty;var In=t=>ot(t,"__esModule",{value:!0}),n=(t,e)=>ot(t,"name",{value:e,configurable:!0});var S=(t,e)=>()=>(t&&(e=t(t=0)),e);var _e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ur=(t,e)=>{In(t);for(var r in e)ot(t,r,{get:e[r],enumerable:!0})},Da=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ia(e))!qa.call(t,o)&&o!=="default"&&ot(t,o,{get:()=>e[o],enumerable:!(r=Na(e,o))||r.enumerable});return t},ce=t=>Da(In(ot(t!=null?Aa(ka(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var qt=_e((kt,jn)=>{(function(t,e){typeof kt=="object"&&typeof jn!="undefined"?e(kt):typeof define=="function"&&define.amd?define(["exports"],e):(t=t||self,e(t.throttleDebounce={}))})(kt,function(t){"use strict";function e(o,s,i,a){var c,l=!1,p=0;function f(){c&&clearTimeout(c)}n(f,"clearExistingTimeout");function u(){f(),l=!0}n(u,"cancel"),typeof s!="boolean"&&(a=i,i=s,s=void 0);function h(){for(var P=arguments.length,_=new Array(P),m=0;m<P;m++)_[m]=arguments[m];var x=this,C=Date.now()-p;if(l)return;function b(){p=Date.now(),i.apply(x,_)}n(b,"exec");function y(){c=void 0}n(y,"clear"),a&&!c&&b(),f(),a===void 0&&C>o?b():s!==!0&&(c=setTimeout(a?y:b,a===void 0?o-C:o))}return n(h,"wrapper"),h.cancel=u,h}n(e,"throttle");function r(o,s,i){return i===void 0?e(o,s,!1):e(o,i,s!==!1)}n(r,"debounce"),t.debounce=r,t.throttle=e,Object.defineProperty(t,"__esModule",{value:!0})})});function Vn(){return typeof window.og_auth!="undefined"?Dt(window.og_auth):null}async function Ba(t=100){return new Promise(e=>{setTimeout(()=>e(Vn()),t)})}async function Hn(t,e=Va,r=Ha){let o;if(o=Dt(Vn())||Dt(e()),o)return o;if(t&&typeof t=="string"){let s=await fetch(t);s.status>=200&&s.status<300&&(o=e()||await(Ga(s)?s.json():Promise.resolve(r(t)).then(e)))}else o||(o=await Ba());if(o=Dt(o),o)return o;throw new Error("Unauthorized")}var $n,Va,Dt,Ha,Ga,Gn=S(()=>{$n=/^og_auth=/,Va=n((t=$n)=>(document.cookie.split(/;\s*/).find(e=>e.match(t))||"").replace($n,""),"c"),Dt=n(t=>{if(typeof t=="object")return t;let e=String(t||"").split("|");return e.length===3?{sig_field:e[0],ts:parseInt(e[1],10),sig:e[2]}:null},"r"),Ha=n(t=>new Promise((e,r)=>{let o=document.createElement("iframe");o.style.setProperty("display","none","important"),document.body.appendChild(o),o.onload=e,o.onerror=r,o.src=t}),"p"),Ga=n(t=>(t.headers.get("content-type")||"").indexOf("application/json")!==-1,"d");n(Vn,"a");n(Ba,"f");n(Hn,"u")});var N,q,D,re,Ue,J,R,st,Le,Ft,Bn,Ut,Se,zn,Lt,Mt,Wn,Me,je,$e,Yn,Jn,jt,Qn,$t,Ve,Kn,Vt,He,it,at,Hr,Ht,Gt,Ee,le,Bt,zt,B,Q,pe,xe,Wt,ve,Te,Yt,Jt,Zn,j=S(()=>{N="OPTIN_PRODUCT",q="OPTOUT_PRODUCT",D="PRODUCT_CHANGE_FREQUENCY",re="PRODUCT_CHANGE_PREPAID_SHIPMENTS",Ue="SET_MERCHANT_ID",J="REQUEST_OFFER",R="RECEIVE_OFFER",st="PRODUCT_HAS_CHANGED",Le="CREATED_SESSION_ID",Ft="SET_AUTH_URL",Bn="REQUEST_AUTH",Ut="AUTHORIZE",Se="UNAUTHORIZED",zn="REQUEST_ORDERS",Lt="RECEIVE_ORDERS",Mt="RECEIVE_ORDER_ITEMS",Wn="FETCH_RESPONSE_ERROR",Me="SET_ENVIRONMENT_STAGING",je="SET_ENVIRONMENT_DEV",$e="SET_ENVIRONMENT_PROD",Yn="CONCLUDE_UPSELL",Jn="REQUEST_CREATE_IU_ORDER",jt="CREATE_ONE_TIME",Qn="REQUEST_CONVERT_ONE_TIME",$t="CONVERT_ONE_TIME",Ve="CHECKOUT",Kn="RECEIVE_FETCH",Vt="SET_LOCALE",He="SET_CONFIG",it="SET_PREVIEW_STANDARD_OFFER",at="SET_PREVIEW_UPSELL_OFFER",Hr="SET_PREVIEW_PREPAID_OFFER",Ht="ADD_TEMPLATE",Gt="SET_TEMPLATES",Ee="LOCAL_STORAGE_CHANGE",le="LOCAL_STORAGE_CLEAR",Bt="SET_FIRST_ORDER_PLACE_DATE",zt="SET_PRODUCT_TO_SUBSCRIBE",B="RECEIVE_PRODUCT_PLANS",Q="SETUP_PRODUCT",pe="SETUP_CART",xe="pdp",Wt="dev",ve="staging",Te="prod",Yt="static.ordergroove.com",Jt="staging.static.ordergroove.com",Zn="og-cart-updated"});var lt=_e((Pu,is)=>{var za="Expected a function",Xn="__lodash_hash_undefined__",Wa="[object Function]",Ya="[object GeneratorFunction]",Ja=/[\\^$.*+?()[\]{}|]/g,Qa=/^\[object .+?Constructor\]$/,Ka=typeof window=="object"&&window&&window.Object===Object&&window,Za=typeof self=="object"&&self&&self.Object===Object&&self,es=Ka||Za||Function("return this")();function Xa(t,e){return t==null?void 0:t[e]}n(Xa,"getValue");function ec(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}n(ec,"isHostObject");var tc=Array.prototype,rc=Function.prototype,ts=Object.prototype,Gr=es["__core-js_shared__"],rs=function(){var t=/[^.]+$/.exec(Gr&&Gr.keys&&Gr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),os=rc.toString,Br=ts.hasOwnProperty,oc=ts.toString,nc=RegExp("^"+os.call(Br).replace(Ja,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),sc=tc.splice,ic=ns(es,"Map"),ct=ns(Object,"create");function Oe(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(Oe,"Hash");function ac(){this.__data__=ct?ct(null):{}}n(ac,"hashClear");function cc(t){return this.has(t)&&delete this.__data__[t]}n(cc,"hashDelete");function lc(t){var e=this.__data__;if(ct){var r=e[t];return r===Xn?void 0:r}return Br.call(e,t)?e[t]:void 0}n(lc,"hashGet");function pc(t){var e=this.__data__;return ct?e[t]!==void 0:Br.call(e,t)}n(pc,"hashHas");function uc(t,e){var r=this.__data__;return r[t]=ct&&e===void 0?Xn:e,this}n(uc,"hashSet");Oe.prototype.clear=ac;Oe.prototype.delete=cc;Oe.prototype.get=lc;Oe.prototype.has=pc;Oe.prototype.set=uc;function Ge(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(Ge,"ListCache");function dc(){this.__data__=[]}n(dc,"listCacheClear");function fc(t){var e=this.__data__,r=Qt(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():sc.call(e,r,1),!0}n(fc,"listCacheDelete");function hc(t){var e=this.__data__,r=Qt(e,t);return r<0?void 0:e[r][1]}n(hc,"listCacheGet");function mc(t){return Qt(this.__data__,t)>-1}n(mc,"listCacheHas");function gc(t,e){var r=this.__data__,o=Qt(r,t);return o<0?r.push([t,e]):r[o][1]=e,this}n(gc,"listCacheSet");Ge.prototype.clear=dc;Ge.prototype.delete=fc;Ge.prototype.get=hc;Ge.prototype.has=mc;Ge.prototype.set=gc;function Pe(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(Pe,"MapCache");function yc(){this.__data__={hash:new Oe,map:new(ic||Ge),string:new Oe}}n(yc,"mapCacheClear");function bc(t){return Kt(this,t).delete(t)}n(bc,"mapCacheDelete");function _c(t){return Kt(this,t).get(t)}n(_c,"mapCacheGet");function Sc(t){return Kt(this,t).has(t)}n(Sc,"mapCacheHas");function Ec(t,e){return Kt(this,t).set(t,e),this}n(Ec,"mapCacheSet");Pe.prototype.clear=yc;Pe.prototype.delete=bc;Pe.prototype.get=_c;Pe.prototype.has=Sc;Pe.prototype.set=Ec;function Qt(t,e){for(var r=t.length;r--;)if(Pc(t[r][0],e))return r;return-1}n(Qt,"assocIndexOf");function xc(t){if(!ss(t)||Tc(t))return!1;var e=wc(t)||ec(t)?nc:Qa;return e.test(Oc(t))}n(xc,"baseIsNative");function Kt(t,e){var r=t.__data__;return vc(e)?r[typeof e=="string"?"string":"hash"]:r.map}n(Kt,"getMapData");function ns(t,e){var r=Xa(t,e);return xc(r)?r:void 0}n(ns,"getNative");function vc(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}n(vc,"isKeyable");function Tc(t){return!!rs&&rs in t}n(Tc,"isMasked");function Oc(t){if(t!=null){try{return os.call(t)}catch{}try{return t+""}catch{}}return""}n(Oc,"toSource");function zr(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(za);var r=n(function(){var o=arguments,s=e?e.apply(this,o):o[0],i=r.cache;if(i.has(s))return i.get(s);var a=t.apply(this,o);return r.cache=i.set(s,a),a},"memoized");return r.cache=new(zr.Cache||Pe),r}n(zr,"memoize");zr.Cache=Pe;function Pc(t,e){return t===e||t!==t&&e!==e}n(Pc,"eq");function wc(t){var e=ss(t)?oc.call(t):"";return e==Wa||e==Ya}n(wc,"isFunction");function ss(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}n(ss,"isObject");is.exports=zr});var Zt,Wr,pt,ut,Xt,as,cs,Cc,Rc,Ac,Nc,Ic,dt,Yr,kc,ls,ft,qc,ue,de=S(()=>{Zt=ce(lt()),Wr=n((...t)=>JSON.stringify(t),"memoizeKey"),pt=n(t=>(...e)=>fetch(...t(...e)).then(r=>r.json()),"withFetchJson"),ut=n(t=>(e,...r)=>{if(!e)throw Error("host required");let[o,s={}]=t(...r);return[`${e.replace(/\/+$/,"")}${o}`,s]},"withHost"),Xt=n(t=>(e,...r)=>{if(!e)throw Error("auth required");let[o,s={}]=t(...r);return[o,{...s,headers:{Authorization:JSON.stringify(e),...s.headers}}]},"withAuth"),as=n(t=>(...e)=>{let[r,o={}]=t(...e);return[r,{method:"POST",...o,body:JSON.stringify(o.body),headers:{"Content-type":"application/json",...o.headers}}]},"withJsonBody"),cs=n((t=[])=>(Array.isArray(t)?t:Object.entries(t)).map(([e,r])=>[e,encodeURIComponent(r)].join("=")).join("&"),"toQuery"),Cc=n(t=>JSON.stringify([].concat(t).map(e=>typeof e=="object"?e.id:e).filter(e=>e)),"toProductId"),Rc=(0,Zt.default)(pt(ut((t,e,r,o="pdp")=>{if(!t)throw Error("merchantId required");if(!e)throw Error("sessionId required");if(!r)throw Error("product required");let s=cs([["session_id",e],["page_type",1],["p",Cc(r)],["module_view",JSON.stringify(["regular"])]]);return[`/offer/${t}/${o}?${s}`]})),Wr),Ac=(0,Zt.default)(pt(ut(Xt((t=1,e="place")=>[`/orders/?${cs([["status",t],["ordering",e],["exclude_prepaid_orders","true"]])}`]))),Wr),Nc=(0,Zt.default)(pt(ut(Xt(t=>{if(!t)throw Error("orderId required");return[`/items/?order=${t}`]}))),Wr),Ic=pt(ut(Xt(as((t,e,r,o)=>{if(!t)throw Error("product required");if(!e)throw Error("order required");if(!r)throw Error("quantity required");if(r<=0)throw Error("quantity must be greater or equal than one");if(!o)throw Error("offer required");return["/items/iu/",{body:{product:t,order:e,quantity:r,offer:o}}]})))),dt=n(t=>{if(typeof t=="object")return{...t};let[e,r]=(t||"").split(/_/).map(o=>parseInt(o,10));return e&&r&&{every:e,every_period:r}},"parseFrequency"),Yr=n(t=>t.match(/^\d+_\d$/),"isFrequencyValid"),kc=n((t,e)=>String.prototype.localeCompare.call(t&&t.split("_").reverse().join("_"),e&&e.split("_").reverse().join("_")),"compareFrequencies"),ls=n(t=>[...new Set(t&&t.split(/\s+/))].filter(Yr).sort(kc),"parseFrequenciesList"),ft=n(t=>{if(typeof t=="object"){let{every:e,period:r,every_period:o}=t;return`${e}_${r||o}`}return typeof t=="string"?t:""},"stringifyFrequency"),qc=pt(ut(Xt(as((t,e,r)=>{if(!t)throw Error("item required");if(!e)throw Error("frequency required");let o=dt(e);if(!o)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:{item:t.public_id,offer:r,...o}}]})))),ue={fetchOffer:Rc,fetchOrders:Ac,fetchItems:Nc,createOneTime:Ic,convertOneTimeToSubscription:qc}});var Jr,L,ht=S(()=>{F();Jr=mt(),L={shopify:typeof window.Shopify!="undefined",shopify_selling_plans:typeof(Jr==null?void 0:Jr.dataset.shopifySellingPlans)!="undefined"}});function Dc(t,e){return t===e}function Fc(t,e,r){if(e===null||r===null||e.length!==r.length)return!1;for(var o=e.length,s=0;s<o;s++)if(!t(e[s],r[s]))return!1;return!0}function Uc(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Dc,r=null,o=null;return function(){return Fc(e,r,arguments)||(o=t.apply(null,arguments)),r=arguments,o}}function Lc(t){var e=Array.isArray(t[0])?t[0]:t;if(!e.every(function(o){return typeof o=="function"})){var r=e.map(function(o){return typeof o}).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, "+("instead received the following types: ["+r+"]"))}return e}function Mc(t){for(var e=arguments.length,r=Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];return function(){for(var s=arguments.length,i=Array(s),a=0;a<s;a++)i[a]=arguments[a];var c=0,l=i.pop(),p=Lc(i),f=t.apply(void 0,[function(){return c++,l.apply(null,arguments)}].concat(r)),u=t(function(){for(var h=[],P=p.length,_=0;_<P;_++)h.push(p[_].apply(null,arguments));return f.apply(null,h)});return u.resultFunc=l,u.dependencies=p,u.recomputations=function(){return c},u.resetRecomputations=function(){return c=0},u}}var K,ps=S(()=>{n(Dc,"defaultEqualityCheck");n(Fc,"areArgumentsShallowlyEqual");n(Uc,"defaultMemoize");n(Lc,"getDependencies");n(Mc,"createSelectorCreator");K=Mc(Uc)});function jc(t,e){if(t===e)return!0;if(t===null||e===null||t.length!==e.length)return!1;for(let r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}function $c(t,e,r){let o=ft(r);return L.shopify_selling_plans?ee(t,e,o):o}var z,I,gt,us,Qr,Vc,Hc,Gc,Bc,zc,Z,er,ds,tr,rr,X,or,nr,Be,Kr,H,ze,U=S(()=>{ps();z=ce(lt());de();ht();F();z.default.Cache=Map;n(jc,"arraysEqual");n($c,"resolveFrequency");I=n((t,e)=>!!(t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&t.id===e.id&&(!(Array.isArray(t.components)&&Array.isArray(e.components))||jc((t.components||[]).sort(),(e.components||[]).sort()))),"isSameProduct"),gt=n(t=>t.optedin||[],"optedinSelector"),us=n(t=>t.optedout||[],"optedoutSelector"),Qr=n(t=>t.autoshipByDefault||{},"autoshipSelector"),Vc=n(t=>t.defaultFrequencies||{},"defaultFrequenciesSelector"),Hc=n(t=>{var e;return((e=t==null?void 0:t.config)==null?void 0:e.frequencies)||[]},"sellingPlansSelector"),Gc=n(t=>{var e;return((e=t==null?void 0:t.config)==null?void 0:e.frequenciesEveryPeriod)||[]},"frequenciesEveryPeriodSelector"),Bc=n(t=>{var e;return((e=t==null?void 0:t.config)==null?void 0:e.prepaidSellingPlans)||[]},"prepaidSellingPlansSelector"),zc=n(t=>(t==null?void 0:t.prepaidShipmentsSelected)||{},"prepaidShipmentsSelectedSelector"),Z=(0,z.default)(t=>K(gt,us,Qr,(e,r,o)=>{let s=e.find(i=>I(t,i));return s||(r.find(i=>I(t,i))?!1:t&&o[t.id]?{id:t.id}:!1)}),t=>JSON.stringify(t)),er=(0,z.default)(t=>K(gt,e=>{let r=e.find(o=>I(t,o));return r||!1}),t=>JSON.stringify(t)),ds=(0,z.default)(t=>K(gt,e=>e.some(r=>I(t,r)&&r.prepaidShipments)),t=>JSON.stringify(t)),tr=(0,z.default)(t=>K(zc,e=>e[t.id]||null),t=>JSON.stringify(t)),rr=(0,z.default)(t=>K(us,e=>e.find(r=>I(t,r)))),X=(0,z.default)(t=>K(Z(t),e=>e&&e.frequency||null)),or=(0,z.default)(t=>K(Z(t),e=>e&&e.prepaidShipments||null)),nr=(0,z.default)(t=>K(Bc,e=>{var o;return(((o=e[t])==null?void 0:o.map(({numberShipments:s})=>s))||[]).sort((s,i)=>s-i)})),Be=(0,z.default)(t=>K(Vc,Hc,Gc,(e,r,o)=>e[w(t)]&&$c(r,o,e[w(t)])||null)),Kr=n(t=>t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),"kebabCase"),H=n((t,e,r,o)=>({[r]:t.config&&t.config[r]||e&&e.hasAttribute&&e.hasAttribute(Kr(r))&&e[r]||e.offer&&typeof(e.offer[r]!=="undefined")&&e.offer[r]||o}),"configSelector"),ze=n(t=>({templates:t.templates||[]}),"templatesSelector")});function sr(t){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t()}function mt(){return document.querySelector([`script[src^="https://${Yt}"]`,`script[src^="https://${Jt}"]`,`script[src^="http://${Yt}"]`,`script[src^="http://${Jt}"]`].join(","))}function Zr(){let t=mt();if(!t)return[];let e=new URL(t.src),r=e.host.startsWith(ve)?ve:Te,o=e.pathname.split("/")[1];return!r&&!o?[]:[o,r,t]}function hs(t){if(t.isReady())return;console.info("OG offers are auto initializing");let[e,r]=Zr();if(!r&&!e)return;let o=document.createElement("script");o.onload=()=>console.info("OG pull initialization chunk for merchant",e,r),o.onerror=()=>t.initialize(e,r),o.src=`${window.location.protocol}//${r===Te?Yt:Jt}/${e}/main.js?initOnly=true`,document.head.appendChild(o)}function gs(t){let e=document.cookie.match(`(^|;) ?${t}=([^;]*)(;|$)`);return e?e[2]:null}function ys(t,e,r){let o=t.querySelector(`[name="${e}"]`);if(o&&!r){o.remove();return}!o&&r&&(o=document.createElement("input"),o.type="hidden",o.name=e,t.appendChild(o)),o&&(o.value=r)}function Ye(t,e){let[[r],o]=t.reduce((s,i)=>s[I(e,i)?0:1].push(i)&&s,[[],[]]);return[r||{},o||[]]}var w,fs,Xr,ms,We,we,ir,ee,F=S(()=>{ht();j();U();n(sr,"onReady");n(mt,"getMainJs");n(Zr,"resolveEnvAndMerchant");w=n(t=>{var r;if(!t)return"";let e=`${t.id||t}`;return((r=L)==null?void 0:r.shopify_selling_plans)&&(e=e.split(":")[0]),e},"safeProductId"),fs=n((t,e)=>{var r;if(L.shopify_selling_plans){let o=(r=e.frequencies)==null?void 0:r.indexOf(t);if(o>=0&&e.frequenciesEveryPeriod[o])return e.frequenciesEveryPeriod[o]}return t},"safeOgFrequency"),Xr=n((t,e)=>{var o;if(!`${t}`.includes("_"))return t;let r=(o=e.frequenciesEveryPeriod)==null?void 0:o.indexOf(t);return r>=0&&e.frequenciesEveryPeriod[r]?e.frequencies[r]:t},"frequencyToSellingPlan");n(hs,"autoInitializeOffers");ms=n(t=>{document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`},"clearCookie");n(gs,"getCookieValue");We=n(t=>!!(t&&(t==null?void 0:t.includes("_"))),"isOgFrequency"),we=n((t=[])=>(t==null?void 0:t[0])||null,"getFirstSellingPlan"),ir=n((t=[],e=[])=>{var r;return!!(((r=L)==null?void 0:r.shopify_selling_plans)&&t.length&&e.length)},"hasShopifySellingPlans"),ee=n((t,e,r)=>{if(t.length!==e.length)return null;let o=e.findIndex(s=>s===r);return o>=0?t[o]:null},"mapFrequencyToSellingPlan");n(ys,"getOrCreateHidden");n(Ye,"getMatchingProductIfExists")});var oe,Je,bs,ar,_s,Ss,Es,eo,Wc,yt,fe,xs,cr,vs,Yc,to,ro,lr,oo,Ts,Ce,no,Jc,Os,Ps,Qc,Kc,Zc,Xc,ws,Cs,Rs,As,Ns,Is,ks,k=S(()=>{Gn();j();de();F();oe=n((t,e,r)=>({type:N,payload:{product:t,frequency:e,offer:r}}),"optinProduct"),Je=n((t,e)=>({type:q,payload:{product:t,offer:e}}),"optoutProduct"),bs=n((t,e)=>({type:st,payload:{newProduct:t,product:e}}),"productHasChangedComponents"),ar=n((t,e,r)=>({type:D,payload:{product:t,frequency:e,offer:r}}),"productChangeFrequency"),_s=n((t,e,r)=>({type:re,payload:{product:t,prepaidShipments:e,offer:r}}),"productChangePrepaidShipments"),Ss=n(t=>({type:Yn,payload:{product:t}}),"concludeUpsell"),Es=n(t=>({type:Ue,payload:t}),"setMerchantId"),eo=n(t=>({type:Le,payload:`${t}.${Math.floor(Math.random()*999999)}.${Math.round(new Date().getTime()/1e3)}`}),"createSessionId"),Wc=n(t=>({type:Bn,payload:t}),"requestAuth"),yt=n((t,e,r,o)=>({type:Ut,payload:{public_id:t,sig_field:e,ts:r,sig:o}}),"authorize"),fe=n(t=>({type:Se,payload:t}),"unauthorized"),xs=n(t=>({type:Ft,payload:t}),"setAuthUrl"),cr=n(t=>({type:Kn,payload:t}),"fetchDone"),vs=n((t=Hn)=>n(function(r,o){if(window.og&&window.og.previewMode)return r(fe({message:"Offers are running in preview mode"}));let{merchantId:s,authUrl:i}=o(),a=Wc(i);return r(a),t(i).then(({sig_field:c,ts:l,sig:p})=>r(yt(s,c,l,p)),c=>r(fe(c))).finally(()=>r(cr(a)))},"fetchAuthThunk"),"fetchAuth"),Yc=n((t,e)=>({type:zn,payload:{status:t,ordering:e}}),"requestOrders"),to=n(t=>({type:Lt,payload:t}),"receiveOrders"),ro=n(t=>({type:Mt,payload:t}),"receiveItems"),lr=n((t=1,e="place")=>n(function(o,s){let{environment:{legoUrl:i},auth:a}=s();if(!a)return o(fe("No auth set."));let c=Yc(t,e);return o(c),ue.fetchOrders(i,a,t,e).then(l=>{if(l.results){o(to(l));let p=(l.results[0]||{}).public_id;if(p)return ue.fetchItems(i,a,p).then(f=>o(ro(f)))}return o(fe(l.detail)),null},l=>o(fe(l))).finally(()=>o(cr(c)))},"fetchOrdersThunk"),"fetchOrders"),oo=n(t=>{switch(t){case Wt:return{type:je,payload:t};case ve:return{type:Me,payload:t};case Te:return{type:$e,payload:t};default:throw new Error(`${t} is not a supported environment`)}},"setEnvironment"),Ts=n(()=>(t,e)=>{let{merchantId:r,sessionId:o}=e();return(!o||r&&!o.startsWith(r))&&t(eo(r)),o},"requestSessionId"),Ce=n((t,e)=>({type:R,payload:{...t,offer:e}}),"receiveOffer"),no=n(t=>({type:Wn,payload:t}),"fetchResponseError"),Jc=n((t,e=xe,r)=>({type:J,payload:{product:t,module:e,offer:r}}),"requestOffer"),Os=n((t,e=xe,r)=>n(function(s,i){let{merchantId:a,sessionId:c,environment:{apiUrl:l}}=i(),p=Jc(t,e,r);s(p);let f=w(t);return f?ue.fetchOffer(l,a,c,f,e).then(u=>s(Ce(u,r)),u=>s(no(u))).finally(()=>s(cr(p))):null},"fetchOfferThunk"),"fetchOffer"),Ps=n(()=>({type:Ve}),"checkout"),Qc=n((t,e,r,o)=>({type:Jn,payload:{product:t,order:e,quantity:r,offerId:o}}),"requestCreateOneTime"),Kc=n(t=>({type:jt,payload:t}),"receiveCreateOneTime"),Zc=n((t,e)=>({type:Qn,payload:{item:t,frequency:e}}),"requestConvertOneTimeToSubscription"),Xc=n((t,e)=>({type:$t,payload:{response:t,product:e}}),"receiveConvertOneTime"),ws=n((t,e,r,o=!1,s=null)=>n(function(a,c){let{auth:l,config:p,environment:{legoUrl:f},previewUpsellOffer:u,offerId:h}=c();if(!l)return a(fe("No auth set."));let P=fs(s,p),_=Qc(t,e,r,h);return a(_),(u?Promise.resolve({legoUrl:f,product:t,order:e,quantity:r,offer:h}):ue.createOneTime(f,l,t.id,e,r,h)).then(m=>(a(Kc(m)),o?(a(Zc(m,P)),(u?Promise.resolve({item:m,frequency:P}):ue.convertOneTimeToSubscription(f,l,m,P,h)).then(x=>a(Xc(x,t)),x=>a(no(x)))):m),m=>a(no(m))).finally(()=>a(cr(_)))},"createIuThunk"),"createIu"),Cs=n(t=>({type:Vt,payload:t}),"setLocale"),Rs=n(t=>({type:He,payload:t}),"setConfig"),As=n((t,e,r)=>({type:Ht,payload:{selector:t,markup:e,config:r}}),"addTemplate"),Ns=n(t=>({type:Gt,payload:t}),"setTemplates"),Is=n((t,e)=>({type:Bt,payload:{product:t,firstOrderPlaceDate:e}}),"setFirstOrderPlaceDate"),ks=n((t,e)=>({type:zt,payload:{product:t,productToSubscribe:e}}),"setProductToSubscribe")});var lo,Re,Ae=S(()=>{lo=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,Re=n((t,e,r=null)=>{for(;e!==r;){let o=e.nextSibling;t.removeChild(e),e=o}},"removeNodes")});var G,po,Qs,Ke,Ne,Ks,_t,te,dr,he=S(()=>{G=`{{lit-${String(Math.random()).slice(2)}}}`,po=`<!--${G}-->`,Qs=new RegExp(`${G}|${po}`),Ke="$lit$",Ne=class{constructor(e,r){this.parts=[],this.element=r;let o=[],s=[],i=document.createTreeWalker(r.content,133,null,!1),a=0,c=-1,l=0,{strings:p,values:{length:f}}=e;for(;l<f;){let u=i.nextNode();if(u===null){i.currentNode=s.pop();continue}if(c++,u.nodeType===1){if(u.hasAttributes()){let h=u.attributes,{length:P}=h,_=0;for(let m=0;m<P;m++)Ks(h[m].name,Ke)&&_++;for(;_-- >0;){let m=p[l],x=dr.exec(m)[2],C=x.toLowerCase()+Ke,b=u.getAttribute(C);u.removeAttribute(C);let y=b.split(Qs);this.parts.push({type:"attribute",index:c,name:x,strings:y}),l+=y.length-1}}u.tagName==="TEMPLATE"&&(s.push(u),i.currentNode=u.content)}else if(u.nodeType===3){let h=u.data;if(h.indexOf(G)>=0){let P=u.parentNode,_=h.split(Qs),m=_.length-1;for(let x=0;x<m;x++){let C,b=_[x];if(b==="")C=te();else{let y=dr.exec(b);y!==null&&Ks(y[2],Ke)&&(b=b.slice(0,y.index)+y[1]+y[2].slice(0,-Ke.length)+y[3]),C=document.createTextNode(b)}P.insertBefore(C,u),this.parts.push({type:"node",index:++c})}_[m]===""?(P.insertBefore(te(),u),o.push(u)):u.data=_[m],l+=m}}else if(u.nodeType===8)if(u.data===G){let h=u.parentNode;(u.previousSibling===null||c===a)&&(c++,h.insertBefore(te(),u)),a=c,this.parts.push({type:"node",index:c}),u.nextSibling===null?u.data="":(o.push(u),c--),l++}else{let h=-1;for(;(h=u.data.indexOf(G,h+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(let u of o)u.parentNode.removeChild(u)}};n(Ne,"Template");Ks=n((t,e)=>{let r=t.length-e.length;return r>=0&&t.slice(r)===e},"endsWith"),_t=n(t=>t.index!==-1,"isTemplatePartActive"),te=n(()=>document.createComment(""),"createMarker"),dr=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/});function fo(t,e){let{element:{content:r},parts:o}=t,s=document.createTreeWalker(r,uo,null,!1),i=St(o),a=o[i],c=-1,l=0,p=[],f=null;for(;s.nextNode();){c++;let u=s.currentNode;for(u.previousSibling===f&&(f=null),e.has(u)&&(p.push(u),f===null&&(f=u)),f!==null&&l++;a!==void 0&&a.index===c;)a.index=f!==null?-1:a.index-l,i=St(o,i),a=o[i]}p.forEach(u=>u.parentNode.removeChild(u))}function Zs(t,e,r=null){let{element:{content:o},parts:s}=t;if(r==null){o.appendChild(e);return}let i=document.createTreeWalker(o,uo,null,!1),a=St(s),c=0,l=-1;for(;i.nextNode();)for(l++,i.currentNode===r&&(c=al(e),r.parentNode.insertBefore(e,r));a!==-1&&s[a].index===l;){if(c>0){for(;a!==-1;)s[a].index+=c,a=St(s,a);return}a=St(s,a)}}var uo,al,St,Xs=S(()=>{he();uo=133;n(fo,"removeNodesFromTemplate");al=n(t=>{let e=t.nodeType===11?0:1,r=document.createTreeWalker(t,uo,null,!1);for(;r.nextNode();)e++;return e},"countNodes"),St=n((t,e=-1)=>{for(let r=e+1;r<t.length;r++){let o=t[r];if(_t(o))return r}return-1},"nextActiveIndexInTemplateParts");n(Zs,"insertNodeIntoTemplate")});var cl,Ie,ho=S(()=>{cl=new WeakMap,Ie=n(t=>typeof t=="function"&&cl.has(t),"isDirective")});var $,fr,mo=S(()=>{$={},fr={}});var me,hr=S(()=>{Ae();he();me=class{constructor(e,r,o){this.__parts=[],this.template=e,this.processor=r,this.options=o}update(e){let r=0;for(let o of this.__parts)o!==void 0&&o.setValue(e[r]),r++;for(let o of this.__parts)o!==void 0&&o.commit()}_clone(){let e=lo?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),r=[],o=this.template.parts,s=document.createTreeWalker(e,133,null,!1),i=0,a=0,c,l=s.nextNode();for(;i<o.length;){if(c=o[i],!_t(c)){this.__parts.push(void 0),i++;continue}for(;a<c.index;)a++,l.nodeName==="TEMPLATE"&&(r.push(l),s.currentNode=l.content),(l=s.nextNode())===null&&(s.currentNode=r.pop(),l=s.nextNode());if(c.type==="node"){let p=this.processor.handleTextExpression(this.options);p.insertAfterNode(l.previousSibling),this.__parts.push(p)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,c.name,c.strings,this.options));i++}return lo&&(document.adoptNode(e),customElements.upgrade(e)),e}};n(me,"TemplateInstance")});var ei,pl,ne,mr=S(()=>{Ae();he();ei=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),pl=` ${G} `,ne=class{constructor(e,r,o,s){this.strings=e,this.values=r,this.type=o,this.processor=s}getHTML(){let e=this.strings.length-1,r="",o=!1;for(let s=0;s<e;s++){let i=this.strings[s],a=i.lastIndexOf("<!--");o=(a>-1||o)&&i.indexOf("-->",a+1)===-1;let c=dr.exec(i);c===null?r+=i+(o?pl:po):r+=i.substr(0,c.index)+c[1]+c[2]+Ke+c[3]+G}return r+=this.strings[e],r}getTemplateElement(){let e=document.createElement("template"),r=this.getHTML();return ei!==void 0&&(r=ei.createHTML(r)),e.innerHTML=r,e}};n(ne,"TemplateResult")});var gr,yr,Ze,Et,se,xt,vt,br,ti,Tt,ul,_r=S(()=>{ho();Ae();mo();hr();mr();he();gr=n(t=>t===null||!(typeof t=="object"||typeof t=="function"),"isPrimitive"),yr=n(t=>Array.isArray(t)||!!(t&&t[Symbol.iterator]),"isIterable"),Ze=class{constructor(e,r,o){this.dirty=!0,this.element=e,this.name=r,this.strings=o,this.parts=[];for(let s=0;s<o.length-1;s++)this.parts[s]=this._createPart()}_createPart(){return new Et(this)}_getValue(){let e=this.strings,r=e.length-1,o=this.parts;if(r===1&&e[0]===""&&e[1]===""){let i=o[0].value;if(typeof i=="symbol")return String(i);if(typeof i=="string"||!yr(i))return i}let s="";for(let i=0;i<r;i++){s+=e[i];let a=o[i];if(a!==void 0){let c=a.value;if(gr(c)||!yr(c))s+=typeof c=="string"?c:String(c);else for(let l of c)s+=typeof l=="string"?l:String(l)}}return s+=e[r],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}};n(Ze,"AttributeCommitter");Et=class{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==$&&(!gr(e)||e!==this.value)&&(this.value=e,Ie(e)||(this.committer.dirty=!0))}commit(){for(;Ie(this.value);){let e=this.value;this.value=$,e(this)}this.value!==$&&this.committer.commit()}};n(Et,"AttributePart");se=class{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(te()),this.endNode=e.appendChild(te())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=te()),e.__insert(this.endNode=te())}insertAfterPart(e){e.__insert(this.startNode=te()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;Ie(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=$,r(this)}let e=this.__pendingValue;e!==$&&(gr(e)?e!==this.value&&this.__commitText(e):e instanceof ne?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):yr(e)?this.__commitIterable(e):e===fr?(this.value=fr,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){let r=this.startNode.nextSibling;e=e??"";let o=typeof e=="string"?e:String(e);r===this.endNode.previousSibling&&r.nodeType===3?r.data=o:this.__commitNode(document.createTextNode(o)),this.value=e}__commitTemplateResult(e){let r=this.options.templateFactory(e);if(this.value instanceof me&&this.value.template===r)this.value.update(e.values);else{let o=new me(r,e.processor,this.options),s=o._clone();o.update(e.values),this.__commitNode(s),this.value=o}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());let r=this.value,o=0,s;for(let i of e)s=r[o],s===void 0&&(s=new se(this.options),r.push(s),o===0?s.appendIntoPart(this):s.insertAfterPart(r[o-1])),s.setValue(i),s.commit(),o++;o<r.length&&(r.length=o,this.clear(s&&s.endNode))}clear(e=this.startNode){Re(this.startNode.parentNode,e.nextSibling,this.endNode)}};n(se,"NodePart");xt=class{constructor(e,r,o){if(this.value=void 0,this.__pendingValue=void 0,o.length!==2||o[0]!==""||o[1]!=="")throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=r,this.strings=o}setValue(e){this.__pendingValue=e}commit(){for(;Ie(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=$,r(this)}if(this.__pendingValue===$)return;let e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=$}};n(xt,"BooleanAttributePart");vt=class extends Ze{constructor(e,r,o){super(e,r,o);this.single=o.length===2&&o[0]===""&&o[1]===""}_createPart(){return new br(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}};n(vt,"PropertyCommitter");br=class extends Et{};n(br,"PropertyPart");ti=!1;(()=>{try{let t={get capture(){return ti=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{}})();Tt=class{constructor(e,r,o){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=r,this.eventContext=o,this.__boundHandleEvent=s=>this.handleEvent(s)}setValue(e){this.__pendingValue=e}commit(){for(;Ie(this.__pendingValue);){let i=this.__pendingValue;this.__pendingValue=$,i(this)}if(this.__pendingValue===$)return;let e=this.__pendingValue,r=this.value,o=e==null||r!=null&&(e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive),s=e!=null&&(r==null||o);o&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=ul(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=$}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}};n(Tt,"EventPart");ul=n(t=>t&&(ti?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),"getOptions")});function go(t){let e=ke.get(t.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},ke.set(t.type,e));let r=e.stringsArray.get(t.strings);if(r!==void 0)return r;let o=t.strings.join(G);return r=e.keyString.get(o),r===void 0&&(r=new Ne(t,t.getTemplateElement()),e.keyString.set(o,r)),e.stringsArray.set(t.strings,r),r}var ke,Sr=S(()=>{he();n(go,"templateFactory");ke=new Map});var ge,yo,bo=S(()=>{Ae();_r();Sr();ge=new WeakMap,yo=n((t,e,r)=>{let o=ge.get(e);o===void 0&&(Re(e,e.firstChild),ge.set(e,o=new se(Object.assign({templateFactory:go},r))),o.appendInto(e)),o.setValue(t),o.commit()},"render")});var Er,_o,So=S(()=>{_r();Er=class{handleAttributeExpressions(e,r,o,s){let i=r[0];return i==="."?new vt(e,r.slice(1),o).parts:i==="@"?[new Tt(e,r.slice(1),s.eventContext)]:i==="?"?[new xt(e,r.slice(1),o)]:new Ze(e,r,o).parts}handleTextExpression(e){return new se(e)}};n(Er,"DefaultTemplateProcessor");_o=new Er});var d,Eo=S(()=>{So();mr();So();ho();Ae();mo();_r();bo();Sr();hr();mr();he();typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");d=n((t,...e)=>new ne(t,e,"html",_o),"html")});var oi,xr,fl,hl,ml,ni,gl,si,ii=S(()=>{Ae();Xs();bo();Sr();hr();he();Eo();oi=n((t,e)=>`${t}--${e}`,"getTemplateCacheKey"),xr=!0;typeof window.ShadyCSS=="undefined"?xr=!1:typeof window.ShadyCSS.prepareTemplateDom=="undefined"&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),xr=!1);fl=n(t=>e=>{let r=oi(e.type,t),o=ke.get(r);o===void 0&&(o={stringsArray:new WeakMap,keyString:new Map},ke.set(r,o));let s=o.stringsArray.get(e.strings);if(s!==void 0)return s;let i=e.strings.join(G);if(s=o.keyString.get(i),s===void 0){let a=e.getTemplateElement();xr&&window.ShadyCSS.prepareTemplateDom(a,t),s=new Ne(e,a),o.keyString.set(i,s)}return o.stringsArray.set(e.strings,s),s},"shadyTemplateFactory"),hl=["html","svg"],ml=n(t=>{hl.forEach(e=>{let r=ke.get(oi(e,t));r!==void 0&&r.keyString.forEach(o=>{let{element:{content:s}}=o,i=new Set;Array.from(s.querySelectorAll("style")).forEach(a=>{i.add(a)}),fo(o,i)})})},"removeStylesFromLitTemplates"),ni=new Set,gl=n((t,e,r)=>{ni.add(t);let o=r?r.element:document.createElement("template"),s=e.querySelectorAll("style"),{length:i}=s;if(i===0){window.ShadyCSS.prepareTemplateStyles(o,t);return}let a=document.createElement("style");for(let p=0;p<i;p++){let f=s[p];f.parentNode.removeChild(f),a.textContent+=f.textContent}ml(t);let c=o.content;r?Zs(r,a,c.firstChild):c.insertBefore(a,c.firstChild),window.ShadyCSS.prepareTemplateStyles(o,t);let l=c.querySelector("style");if(window.ShadyCSS.nativeShadow&&l!==null)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(r){c.insertBefore(a,c.firstChild);let p=new Set;p.add(a),fo(r,p)}},"prepareTemplateStyles"),si=n((t,e,r)=>{if(!r||typeof r!="object"||!r.scopeName)throw new Error("The `scopeName` option is required.");let o=r.scopeName,s=ge.has(e),i=xr&&e.nodeType===11&&!!e.host,a=i&&!ni.has(o),c=a?document.createDocumentFragment():e;if(yo(t,c,Object.assign({templateFactory:fl(o)},r)),a){let l=ge.get(c);ge.delete(c);let p=l.value instanceof me?l.value.template:void 0;gl(o,c,p),Re(e,e.firstChild),e.appendChild(c),ge.set(e,l)}!s&&i&&window.ShadyCSS.styleElement(e.host)},"render")});var ai,xo,ci,vo,To,Oo,Po,wo,Co,Ot,Ro=S(()=>{window.JSCompiler_renameProperty=(t,e)=>t;xo={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return t!==null;case Number:return t===null?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},ci=n((t,e)=>e!==t&&(e===e||t===t),"notEqual"),vo={attribute:!0,type:String,converter:xo,reflect:!1,hasChanged:ci},To=1,Oo=1<<2,Po=1<<3,wo=1<<4,Co="finalized",Ot=class extends HTMLElement{constructor(){super();this.initialize()}static get observedAttributes(){this.finalize();let e=[];return this._classProperties.forEach((r,o)=>{let s=this._attributeNameForProperty(o,r);s!==void 0&&(this._attributeToPropertyMap.set(s,o),e.push(s))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;let e=Object.getPrototypeOf(this)._classProperties;e!==void 0&&e.forEach((r,o)=>this._classProperties.set(o,r))}}static createProperty(e,r=vo){if(this._ensureClassProperties(),this._classProperties.set(e,r),r.noAccessor||this.prototype.hasOwnProperty(e))return;let o=typeof e=="symbol"?Symbol():`__${e}`,s=this.getPropertyDescriptor(e,o,r);s!==void 0&&Object.defineProperty(this.prototype,e,s)}static getPropertyDescriptor(e,r,o){return{get(){return this[r]},set(s){let i=this[e];this[r]=s,this.requestUpdateInternal(e,i,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||vo}static finalize(){let e=Object.getPrototypeOf(this);if(e.hasOwnProperty(Co)||e.finalize(),this[Co]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){let r=this.properties,o=[...Object.getOwnPropertyNames(r),...typeof Object.getOwnPropertySymbols=="function"?Object.getOwnPropertySymbols(r):[]];for(let s of o)this.createProperty(s,r[s])}}static _attributeNameForProperty(e,r){let o=r.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}static _valueHasChanged(e,r,o=ci){return o(e,r)}static _propertyValueFromAttribute(e,r){let o=r.type,s=r.converter||xo,i=typeof s=="function"?s:s.fromAttribute;return i?i(e,o):e}static _propertyValueToAttribute(e,r){if(r.reflect===void 0)return;let o=r.type,s=r.converter;return(s&&s.toAttribute||xo.toAttribute)(e,o)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,r)=>{if(this.hasOwnProperty(r)){let o=this[r];delete this[r],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(r,o)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,r)=>this[r]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){this._enableUpdatingResolver!==void 0&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,r,o){r!==o&&this._attributeToProperty(e,o)}_propertyToAttribute(e,r,o=vo){let s=this.constructor,i=s._attributeNameForProperty(e,o);if(i!==void 0){let a=s._propertyValueToAttribute(r,o);if(a===void 0)return;this._updateState=this._updateState|Po,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._updateState=this._updateState&~Po}}_attributeToProperty(e,r){if(this._updateState&Po)return;let o=this.constructor,s=o._attributeToPropertyMap.get(e);if(s!==void 0){let i=o.getPropertyOptions(s);this._updateState=this._updateState|wo,this[s]=o._propertyValueFromAttribute(r,i),this._updateState=this._updateState&~wo}}requestUpdateInternal(e,r,o){let s=!0;if(e!==void 0){let i=this.constructor;o=o||i.getPropertyOptions(e),i._valueHasChanged(this[e],r,o.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,r),o.reflect===!0&&!(this._updateState&wo)&&(this._reflectingProperties===void 0&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,o))):s=!1}!this._hasRequestedUpdate&&s&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,r){return this.requestUpdateInternal(e,r),this.updateComplete}async _enqueueUpdate(){this._updateState=this._updateState|Oo;try{await this._updatePromise}catch{}let e=this.performUpdate();return e!=null&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return this._updateState&Oo}get hasUpdated(){return this._updateState&To}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1,r=this._changedProperties;try{e=this.shouldUpdate(r),e?this.update(r):this._markUpdated()}catch(o){throw e=!1,this._markUpdated(),o}e&&(this._updateState&To||(this._updateState=this._updateState|To,this.firstUpdated(r)),this.updated(r))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~Oo}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){this._reflectingProperties!==void 0&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((r,o)=>this._propertyToAttribute(o,this[o],r)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}};n(Ot,"UpdatingElement");ai=Co;Ot[ai]=!0});var li,df,pi=S(()=>{li=Element.prototype,df=li.msMatchesSelector||li.webkitMatchesSelector});var vr,Ao,Pt,ui,yl,E,No=S(()=>{vr=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ao=Symbol(),Pt=class{constructor(e,r){if(r!==Ao)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return this._styleSheet===void 0&&(vr?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}};n(Pt,"CSSResult");ui=n(t=>new Pt(String(t),Ao),"unsafeCSS"),yl=n(t=>{if(t instanceof Pt)return t.cssText;if(typeof t=="number")return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but
12
12
  take care to ensure page security.`)},"textFromCSSResult"),E=n((t,...e)=>{let r=e.reduce((o,s,i)=>o+yl(s)+t[i+1],t[0]);return new Pt(r,Ao)},"css")});var di,v,O=S(()=>{ii();Ro();Ro();pi();Eo();No();No();(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");di={},v=class extends Ot{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;let e=this.getStyles();if(Array.isArray(e)){let r=n((i,a)=>i.reduceRight((c,l)=>Array.isArray(l)?r(l,c):(c.add(l),c),a),"addStyles"),o=r(e,new Set),s=[];o.forEach(i=>s.unshift(i)),this._styles=s}else this._styles=e===void 0?[]:[e];this._styles=this._styles.map(r=>{if(r instanceof CSSStyleSheet&&!vr){let o=Array.prototype.slice.call(r.cssRules).reduce((s,i)=>s+i.cssText,"");return ui(o)}return r})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){let e=this.constructor._styles;e.length!==0&&(window.ShadyCSS!==void 0&&!window.ShadyCSS.nativeShadow?window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(r=>r.cssText),this.localName):vr?this.renderRoot.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):this._needsShimAdoptedStyleSheets=!0)}connectedCallback(){super.connectedCallback(),this.hasUpdated&&window.ShadyCSS!==void 0&&window.ShadyCSS.styleElement(this)}update(e){let r=this.render();super.update(e),r!==di&&this.constructor.render(r,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(o=>{let s=document.createElement("style");s.textContent=o.cssText,this.renderRoot.appendChild(s)}))}render(){return di}};n(v,"LitElement");v.finalized=!0;v.render=si});var Tr=_e((vf,fi)=>{var bl={PAR_OPEN:"(".charCodeAt(0),PAR_CLOSE:")".charCodeAt(0),OP_NOT:"!".charCodeAt(0),BINARY_AND:"&".charCodeAt(0),BINARY_OR:"|".charCodeAt(0),LITERAL:"LITERAL",END:"END",LEAF:"LEAF",ATOMIC:"ATOMIC"};fi.exports=bl});var mi=_e((Tf,hi)=>{var qe=Tr(),_l=n(t=>{let e="",r=[];for(let o of t){let s=o.charCodeAt(0);switch(s){case qe.PAR_OPEN:case qe.PAR_CLOSE:case qe.OP_NOT:case qe.BINARY_AND:case qe.BINARY_OR:e&&(r.push({type:qe.LITERAL,value:e}),e=""),r.push({type:s,value:o});break;default:e+=o}}return e&&r.push({type:qe.LITERAL,value:e}),r},"Tokenizer");hi.exports=_l});var yi=_e((Of,gi)=>{var ye=Tr(),Sl=n(t=>{let e=[],r=[];return t.forEach(s=>{switch(s.type){case ye.LITERAL:e.unshift(s);break;case ye.BINARY_AND:case ye.BINARY_OR:case ye.OP_NOT:case ye.PAR_OPEN:r.push(s);break;case ye.PAR_CLOSE:for(;r.length&&r[r.length-1].type!==ye.PAR_OPEN;)e.unshift(r.pop());r.pop(),r.length&&r[r.length-1].type===ye.OP_NOT&&e.unshift(r.pop());break;default:break}}),r.length&&[...r.reverse(),...e]||e},"PolishNotation"),El=n(function*(t){for(let e=0;e<t.length-1;e++)yield t[e];return t[t.length-1]},"PolishGenerator");gi.exports={PolishNotation:Sl,PolishGenerator:El}});var _i=_e((Pf,bi)=>{var V=Tr(),W=class{constructor(e,r,o,s){this.op=e,this.left=r,this.right=o,this.literal=s}isLeaf(){return this.op===V.LEAF}isAtomic(){return this.isLeaf()||this.op===V.OP_NOT&&this.left.isLeaf()}getLiteralValue(){return this.literal}static CreateAnd(e,r){return new W(V.BINARY_AND,e,r)}static CreateNot(e){return new W(V.OP_NOT,e)}static CreateOr(e,r){return new W(V.BINARY_OR,e,r)}static CreateLiteral(e){return new W(V.LEAF,null,null,e)}};n(W,"ExpNode");var Xe=n(t=>{let e=t.next().value;switch(e.type){case V.LITERAL:return W.CreateLiteral(e.value);case V.OP_NOT:return W.CreateNot(Xe(t));case V.BINARY_AND:{let r=Xe(t),o=Xe(t);return W.CreateAnd(r,o)}case V.BINARY_OR:{let r=Xe(t),o=Xe(t);return W.CreateOr(r,o)}}return null},"make"),et=n((t,e)=>{if(t.isLeaf())return e(t.getLiteralValue());if(t.op===V.OP_NOT)return!et(t.left,e);if(t.op===V.BINARY_OR)return et(t.left,e)||et(t.right,e);if(t.op===V.BINARY_AND)return et(t.left,e)&&et(t.right,e)},"nodeEvaluator");bi.exports={make:Xe,nodeEvaluator:et}});var vi=_e((wf,xi)=>{var xl=mi(),Si=yi(),Ei=_i(),vl=n((t,e)=>{let r=xl(t),o=Si.PolishNotation(r),s=Si.PolishGenerator(o),i=Ei.make(s);return Ei.nodeEvaluator(i,e)},"parse");xi.exports={parse:vl}});var ta={};Ur(ta,{TestWizard:()=>Nr,default:()=>Xl});var Nr,Xl,ra=S(()=>{O();k();Nr=class extends v{static get styles(){return E`
13
13
  :host {
14
14
  position: fixed;
@@ -884,7 +884,7 @@ var lib=(()=>{var Aa=Object.create;var ot=Object.defineProperty;var Na=Object.ge
884
884
  </slot>
885
885
  </div>
886
886
  </span>
887
- `}};n(Ar,"Tooltip");O();U();k();var Zo=class extends A(v){constructor(){super();this.options=[],this.text="shipments"}static get properties(){return{options:{type:Array},text:{type:String},shipmentsOptedIn:{type:Number},prepaidShipmentsSelected:{type:Number}}}static get styles(){return E`
887
+ `}};n(Ar,"Tooltip");O();U();k();var Zo=class extends A(v){constructor(){super();this.options=[],this.text="shipments"}static get properties(){return{options:{type:Array},text:{type:String},shipmentsOptedIn:{type:Number},prepaidShipmentsSelected:{type:Number},defaultPrepaidShipments:{type:Number,attribute:"default-prepaid-shipments"}}}static get styles(){return E`
888
888
  og-select {
889
889
  display: inline-block;
890
890
  cursor: pointer;
@@ -901,7 +901,7 @@ var lib=(()=>{var Aa=Object.create;var ot=Object.defineProperty;var Na=Object.ge
901
901
  accent-color: var(--og-prepaid-checkbox-color, black);
902
902
  border-radius: 4px;
903
903
  }
904
- `}get checked(){return this.shipmentsOptedIn>1}handleChange(e){if(e.target.checked){let r=this.prepaidShipmentsSelected||this.options[0];this.productChangePrepaidShipments(this.product,r,this.offer)}else this.productChangePrepaidShipments(this.product,null,this.offer)}handleSelect({target:{value:e}}){let r=+e;this.productChangePrepaidShipments(this.product,r,this.offer)}render(){if(this.options.length===0)return d``;let e=this.options.map(r=>({value:r,text:`${r} ${this.text}`}));return d`
904
+ `}get checked(){return this.shipmentsOptedIn>1}get selectedShipments(){return this.prepaidShipmentsSelected||this.shipmentsOptedIn||this.getDefaultPrepaidShipments()}getDefaultPrepaidShipments(){return this.options.includes(this.defaultPrepaidShipments)?this.defaultPrepaidShipments:this.options[1]||this.options[0]}handleChange(e){e.target.checked?this.productChangePrepaidShipments(this.product,this.selectedShipments,this.offer):this.productChangePrepaidShipments(this.product,null,this.offer)}handleSelect({target:{value:e}}){let r=+e;this.productChangePrepaidShipments(this.product,r,this.offer)}render(){if(this.options.length===0)return d``;let e=this.options.map(r=>({value:r,text:`${r} ${this.text}`}));return d`
905
905
  <div>
906
906
  <input id="cbx" type="checkbox" .checked=${this.checked} @change=${this.handleChange} />
907
907
  <label for="cbx">
@@ -909,7 +909,7 @@ var lib=(()=>{var Aa=Object.create;var ot=Object.defineProperty;var Na=Object.ge
909
909
  ${this.options.length>1?d`
910
910
  <og-select
911
911
  .options=${e}
912
- .selected=${this.prepaidShipmentsSelected||this.shipmentsOptedIn}
912
+ .selected=${this.selectedShipments}
913
913
  .onChange="${r=>this.handleSelect(r)}"
914
914
  ></og-select>
915
915
  `:d`