@ordergroove/offers 2.27.7 → 2.27.8-alpha-PR-605-3.23
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/bundle-report.html +5 -5
- package/dist/offers.js +2 -2
- package/dist/offers.js.map +2 -2
- package/package.json +4 -4
- package/src/core/__tests__/api.spec.js +3 -1
- package/src/core/api.js +2 -1
package/dist/bundle-report.html
CHANGED
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
│ └ src/index.js
|
|
46
46
|
├ src/shopify/shopifyReducer.js ───────────────────────────── 3.4kb ─── 2.8%
|
|
47
47
|
│ └ src/index.js
|
|
48
|
-
├ src/make-api.js ─────────────────────────────────────────── 2.6kb ─── 2.
|
|
48
|
+
├ src/make-api.js ─────────────────────────────────────────── 2.6kb ─── 2.1%
|
|
49
49
|
│ └ src/index.js
|
|
50
|
-
├ src/core/api.js ─────────────────────────────────────────── 2.
|
|
50
|
+
├ src/core/api.js ─────────────────────────────────────────── 2.6kb ─── 2.1%
|
|
51
51
|
│ └ src/core/reducer.js
|
|
52
52
|
│ └ src/index.js
|
|
53
53
|
├ src/components/UpsellModal.js ───────────────────────────── 2.4kb ─── 2.0%
|
|
@@ -150,11 +150,11 @@
|
|
|
150
150
|
├ src/core/middleware.js ──────────────────────────────────── 951b ──── 0.8%
|
|
151
151
|
│ └ src/core/store.js
|
|
152
152
|
│ └ src/index.js
|
|
153
|
-
├
|
|
154
|
-
│ └ src/index.js
|
|
155
|
-
├ ../offers-live-editor/dist/offers-live-editor.js ────────── 921b ──── 0.7%
|
|
153
|
+
├ ../offers-live-editor/dist/offers-live-editor.js ────────── 948b ──── 0.8%
|
|
156
154
|
│ └ src/make-api.js
|
|
157
155
|
│ └ src/index.js
|
|
156
|
+
├ src/core/utils.ts ───────────────────────────────────────── 945b ──── 0.8%
|
|
157
|
+
│ └ src/index.js
|
|
158
158
|
├ src/components/Price.js ─────────────────────────────────── 904b ──── 0.7%
|
|
159
159
|
│ └ src/make-api.js
|
|
160
160
|
│ └ src/index.js
|
package/dist/offers.js
CHANGED
|
@@ -8,7 +8,7 @@ else {
|
|
|
8
8
|
window.og['offers'] = factory();
|
|
9
9
|
}
|
|
10
10
|
})(()=>{
|
|
11
|
-
var lib=(()=>{var Mi=Object.create;var Be=Object.defineProperty;var Vi=Object.getOwnPropertyDescriptor;var $i=Object.getOwnPropertyNames;var Hi=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var tn=t=>Be(t,"__esModule",{value:!0}),n=(t,e)=>Be(t,"name",{value:e,configurable:!0});var S=(t,e)=>()=>(t&&(e=t(t=0)),e);var de=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xr=(t,e)=>{tn(t);for(var r in e)Be(t,r,{get:e[r],enumerable:!0})},Bi=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of $i(e))!Gi.call(t,o)&&o!=="default"&&Be(t,o,{get:()=>e[o],enumerable:!(r=Vi(e,o))||r.enumerable});return t},ee=t=>Bi(tn(Be(t!=null?Mi(Hi(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Et=de((_t,un)=>{(function(t,e){typeof _t=="object"&&typeof un!="undefined"?e(_t):typeof define=="function"&&define.amd?define(["exports"],e):(t=t||self,e(t.throttleDebounce={}))})(_t,function(t){"use strict";function e(o,s,i,c){var a,l=!1,d=0;function h(){a&&clearTimeout(a)}n(h,"clearExistingTimeout");function p(){h(),l=!0}n(p,"cancel"),typeof s!="boolean"&&(c=i,i=s,s=void 0);function m(){for(var _=arguments.length,b=new Array(_),f=0;f<_;f++)b[f]=arguments[f];var x=this,w=Date.now()-d;if(l)return;function y(){d=Date.now(),i.apply(x,b)}n(y,"exec");function C(){a=void 0}n(C,"clear"),c&&!a&&y(),h(),c===void 0&&w>o?y():s!==!0&&(a=setTimeout(c?C:y,c===void 0?o-w:o))}return n(m,"wrapper"),m.cancel=p,m}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 dn(){return typeof window.og_auth!="undefined"?xt(window.og_auth):null}async function ta(t=100){return new Promise(e=>{setTimeout(()=>e(dn()),t)})}async function fn(t,e=Zi,r=Xi){let o;if(o=xt(dn())||xt(e()),o)return o;if(t&&typeof t=="string"){let s=await fetch(t);s.status>=200&&s.status<300&&(o=e()||await(ea(s)?s.json():Promise.resolve(r(t)).then(e)))}else o||(o=await ta());if(o=xt(o),o)return o;throw new Error("Unauthorized")}var pn,Zi,xt,Xi,ea,hn=S(()=>{pn=/^og_auth=/,Zi=n((t=pn)=>(document.cookie.split(/;\s*/).find(e=>e.match(t))||"").replace(pn,""),"c"),xt=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"),Xi=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"),ea=n(t=>(t.headers.get("content-type")||"").indexOf("application/json")!==-1,"d");n(dn,"a");n(ta,"f");n(fn,"u")});var I,U,q,St,we,P,We,Tt,vt,mn,Ot,Ce,gn,wt,Ct,yn,Pt,Rt,At,bn,_n,Nt,En,kt,Pe,xn,It,Ut,Ye,Je,qt,Dt,fe,te,Ft,Lt,Y,J,re,he,jt,me,Re,Cr,Pr,Sn,V=S(()=>{I="OPTIN_PRODUCT",U="OPTOUT_PRODUCT",q="PRODUCT_CHANGE_FREQUENCY",St="SET_MERCHANT_ID",we="REQUEST_OFFER",P="RECEIVE_OFFER",We="PRODUCT_HAS_CHANGED",Tt="CREATED_SESSION_ID",vt="SET_AUTH_URL",mn="REQUEST_AUTH",Ot="AUTHORIZE",Ce="UNAUTHORIZED",gn="REQUEST_ORDERS",wt="RECEIVE_ORDERS",Ct="RECEIVE_ORDER_ITEMS",yn="FETCH_RESPONSE_ERROR",Pt="SET_ENVIRONMENT_STAGING",Rt="SET_ENVIRONMENT_DEV",At="SET_ENVIRONMENT_PROD",bn="CONCLUDE_UPSELL",_n="REQUEST_CREATE_IU_ORDER",Nt="CREATE_ONE_TIME",En="REQUEST_CONVERT_ONE_TIME",kt="CONVERT_ONE_TIME",Pe="CHECKOUT",xn="RECEIVE_FETCH",It="SET_LOCALE",Ut="SET_CONFIG",Ye="SET_PREVIEW_STANDARD_OFFER",Je="SET_PREVIEW_UPSELL_OFFER",qt="ADD_TEMPLATE",Dt="SET_TEMPLATES",fe="LOCAL_STORAGE_CHANGE",te="LOCAL_STORAGE_CLEAR",Ft="SET_FIRST_ORDER_PLACE_DATE",Lt="SET_PRODUCT_TO_SUBSCRIBE",Y="RECEIVE_PRODUCT_PLANS",J="SETUP_PRODUCT",re="SETUP_CART",he="pdp",jt="dev",me="staging",Re="prod",Cr="static.ordergroove.com",Pr="staging.static.ordergroove.com",Sn="og-cart-updated"});var Ke=de((gu,An)=>{var ra="Expected a function",Tn="__lodash_hash_undefined__",oa="[object Function]",na="[object GeneratorFunction]",sa=/[\\^$.*+?()[\]{}|]/g,ia=/^\[object .+?Constructor\]$/,aa=typeof window=="object"&&window&&window.Object===Object&&window,ca=typeof self=="object"&&self&&self.Object===Object&&self,vn=aa||ca||Function("return this")();function la(t,e){return t==null?void 0:t[e]}n(la,"getValue");function ua(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}n(ua,"isHostObject");var pa=Array.prototype,da=Function.prototype,On=Object.prototype,Rr=vn["__core-js_shared__"],wn=function(){var t=/[^.]+$/.exec(Rr&&Rr.keys&&Rr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Cn=da.toString,Ar=On.hasOwnProperty,fa=On.toString,ha=RegExp("^"+Cn.call(Ar).replace(sa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ma=pa.splice,ga=Pn(vn,"Map"),Qe=Pn(Object,"create");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,"Hash");function ya(){this.__data__=Qe?Qe(null):{}}n(ya,"hashClear");function ba(t){return this.has(t)&&delete this.__data__[t]}n(ba,"hashDelete");function _a(t){var e=this.__data__;if(Qe){var r=e[t];return r===Tn?void 0:r}return Ar.call(e,t)?e[t]:void 0}n(_a,"hashGet");function Ea(t){var e=this.__data__;return Qe?e[t]!==void 0:Ar.call(e,t)}n(Ea,"hashHas");function xa(t,e){var r=this.__data__;return r[t]=Qe&&e===void 0?Tn:e,this}n(xa,"hashSet");ge.prototype.clear=ya;ge.prototype.delete=ba;ge.prototype.get=_a;ge.prototype.has=Ea;ge.prototype.set=xa;function Ae(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(Ae,"ListCache");function Sa(){this.__data__=[]}n(Sa,"listCacheClear");function Ta(t){var e=this.__data__,r=Mt(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():ma.call(e,r,1),!0}n(Ta,"listCacheDelete");function va(t){var e=this.__data__,r=Mt(e,t);return r<0?void 0:e[r][1]}n(va,"listCacheGet");function Oa(t){return Mt(this.__data__,t)>-1}n(Oa,"listCacheHas");function wa(t,e){var r=this.__data__,o=Mt(r,t);return o<0?r.push([t,e]):r[o][1]=e,this}n(wa,"listCacheSet");Ae.prototype.clear=Sa;Ae.prototype.delete=Ta;Ae.prototype.get=va;Ae.prototype.has=Oa;Ae.prototype.set=wa;function ye(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(ye,"MapCache");function Ca(){this.__data__={hash:new ge,map:new(ga||Ae),string:new ge}}n(Ca,"mapCacheClear");function Pa(t){return Vt(this,t).delete(t)}n(Pa,"mapCacheDelete");function Ra(t){return Vt(this,t).get(t)}n(Ra,"mapCacheGet");function Aa(t){return Vt(this,t).has(t)}n(Aa,"mapCacheHas");function Na(t,e){return Vt(this,t).set(t,e),this}n(Na,"mapCacheSet");ye.prototype.clear=Ca;ye.prototype.delete=Pa;ye.prototype.get=Ra;ye.prototype.has=Aa;ye.prototype.set=Na;function Mt(t,e){for(var r=t.length;r--;)if(Da(t[r][0],e))return r;return-1}n(Mt,"assocIndexOf");function ka(t){if(!Rn(t)||Ua(t))return!1;var e=Fa(t)||ua(t)?ha:ia;return e.test(qa(t))}n(ka,"baseIsNative");function Vt(t,e){var r=t.__data__;return Ia(e)?r[typeof e=="string"?"string":"hash"]:r.map}n(Vt,"getMapData");function Pn(t,e){var r=la(t,e);return ka(r)?r:void 0}n(Pn,"getNative");function Ia(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}n(Ia,"isKeyable");function Ua(t){return!!wn&&wn in t}n(Ua,"isMasked");function qa(t){if(t!=null){try{return Cn.call(t)}catch{}try{return t+""}catch{}}return""}n(qa,"toSource");function Nr(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(ra);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 c=t.apply(this,o);return r.cache=i.set(s,c),c},"memoized");return r.cache=new(Nr.Cache||ye),r}n(Nr,"memoize");Nr.Cache=ye;function Da(t,e){return t===e||t!==t&&e!==e}n(Da,"eq");function Fa(t){var e=Rn(t)?fa.call(t):"";return e==oa||e==na}n(Fa,"isFunction");function Rn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}n(Rn,"isObject");An.exports=Nr});var $t,kr,Ze,Xe,Ht,Nn,kn,La,ja,Ma,Va,$a,et,Ir,Ha,In,tt,Ga,oe,ne=S(()=>{$t=ee(Ke()),kr=n((...t)=>JSON.stringify(t),"memoizeKey"),Ze=n(t=>(...e)=>fetch(...t(...e)).then(r=>r.json()),"withFetchJson"),Xe=n(t=>(e,...r)=>{if(!e)throw Error("host required");let[o,s={}]=t(...r);return[`${e.replace(/\/+$/,"")}${o}`,s]},"withHost"),Ht=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"),Nn=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"),kn=n((t=[])=>(Array.isArray(t)?t:Object.entries(t)).map(([e,r])=>[e,encodeURIComponent(r)].join("=")).join("&"),"toQuery"),La=n(t=>JSON.stringify([].concat(t).map(e=>typeof e=="object"?e.id:e).filter(e=>e)),"toProductId"),ja=(0,$t.default)(Ze(Xe((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=kn([["session_id",e],["page_type",1],["p",La(r)],["module_view",JSON.stringify(["regular"])]]);return[`/offer/${t}/${o}?${s}`]})),kr),Ma=(0,$t.default)(Ze(Xe(Ht((t=1,e="place")=>[`/orders/?${kn([["status",t],["ordering",e]])}`]))),kr),Va=(0,$t.default)(Ze(Xe(Ht(t=>{if(!t)throw Error("orderId required");return[`/items/?order=${t}`]}))),kr),$a=Ze(Xe(Ht(Nn((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}}]})))),et=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"),Ir=n(t=>t.match(/^\d+_\d$/),"isFrequencyValid"),Ha=n((t,e)=>String.prototype.localeCompare.call(t&&t.split("_").reverse().join("_"),e&&e.split("_").reverse().join("_")),"compareFrequencies"),In=n(t=>[...new Set(t&&t.split(/\s+/))].filter(Ir).sort(Ha),"parseFrequenciesList"),tt=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"),Ga=Ze(Xe(Ht(Nn((t,e,r)=>{if(!t)throw Error("item required");if(!e)throw Error("frequency required");let o=et(e);if(!o)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:{item:t.public_id,offer:r,...o}}]})))),oe={fetchOffer:ja,fetchOrders:Ma,fetchItems:Va,createOneTime:$a,convertOneTimeToSubscription:Ga}});function rt(t){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t()}function ot(){return document.querySelector([`script[src^="https://${Cr}"]`,`script[src^="https://${Pr}"]`,`script[src^="http://${Cr}"]`,`script[src^="http://${Pr}"]`].join(","))}function Ur(){let t=ot();if(!t)return[];let e=new URL(t.src),r=e.host.startsWith(me)?me:Re,o=e.pathname.split("/")[1];return!r&&!o?[]:[o,r,t]}function Un(t){if(t.isReady())return;let[e,r]=Ur();!r&&!e||t.initialize(e,r)}function Dn(t){let e=document.cookie.match(`(^|;) ?${t}=([^;]*)(;|$)`);return e?e[2]:null}var R,qn,$=S(()=>{Gt();V();n(rt,"onReady");n(ot,"getMainJs");n(Ur,"resolveEnvAndMerchant");R=n(t=>{var r;let e=`${t.id||t}`;return((r=Ne)==null?void 0:r.shopify_selling_plans)&&(e=e.split(":")[0]),e},"safeProductId");n(Un,"autoInitializeOffers");qn=n(t=>{document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`},"clearCookie");n(Dn,"getCookieValue")});var ke,Ne,Gt=S(()=>{$();ke=ot(),Ne={shopify:typeof(ke==null?void 0:ke.dataset.shopifySellingPlans)!="undefined",shopify_selling_plans:typeof(ke==null?void 0:ke.dataset.shopifySellingPlans)!="undefined"}});var se,Ie,Fn,Bt,Ln,jn,Ba,za,nt,ie,Mn,zt,Vn,Wa,qr,Dr,Wt,Fr,Yt,Ue,Lr,Ya,$n,Hn,Ja,Qa,Ka,Za,Gn,Bn,zn,Wn,Yn,Jn,Qn,N=S(()=>{hn();V();ne();Gt();$();se=n((t,e,r)=>({type:I,payload:{product:t,frequency:e,offer:r}}),"optinProduct"),Ie=n((t,e)=>({type:U,payload:{product:t,offer:e}}),"optoutProduct"),Fn=n((t,e)=>({type:We,payload:{newProduct:t,product:e}}),"productHasChangedComponents"),Bt=n((t,e,r)=>({type:q,payload:{product:t,frequency:e,offer:r}}),"productChangeFrequency"),Ln=n(t=>({type:bn,payload:{product:t}}),"concludeUpsell"),jn=n(t=>({type:St,payload:t}),"setMerchantId"),Ba=n(t=>({type:Tt,payload:`${t}.${Math.floor(Math.random()*999999)}.${Math.round(new Date().getTime()/1e3)}`}),"createSessionId"),za=n(t=>({type:mn,payload:t}),"requestAuth"),nt=n((t,e,r,o)=>({type:Ot,payload:{public_id:t,sig_field:e,ts:r,sig:o}}),"authorize"),ie=n(t=>({type:Ce,payload:t}),"unauthorized"),Mn=n(t=>({type:vt,payload:t}),"setAuthUrl"),zt=n(t=>({type:xn,payload:t}),"fetchDone"),Vn=n((t=fn)=>n(function(r,o){if(window.og&&window.og.previewMode)return r(ie({message:"Offers are running in preview mode"}));let{merchantId:s,authUrl:i}=o(),c=za(i);return r(c),t(i).then(({sig_field:a,ts:l,sig:d})=>r(nt(s,a,l,d)),a=>r(ie(a))).finally(()=>r(zt(c)))},"fetchAuthThunk"),"fetchAuth"),Wa=n((t,e)=>({type:gn,payload:{status:t,ordering:e}}),"requestOrders"),qr=n(t=>({type:wt,payload:t}),"receiveOrders"),Dr=n(t=>({type:Ct,payload:t}),"receiveItems"),Wt=n((t=1,e="place")=>n(function(o,s){let{environment:{legoUrl:i},auth:c}=s();if(!c)return o(ie("No auth set."));let a=Wa(t,e);return o(a),oe.fetchOrders(i,c,t,e).then(l=>{if(l.results){o(qr(l));let d=(l.results[0]||{}).public_id;if(d)return oe.fetchItems(i,c,d).then(h=>o(Dr(h)))}return o(ie(l.detail)),null},l=>o(ie(l))).finally(()=>o(zt(a)))},"fetchOrdersThunk"),"fetchOrders"),Fr=n(t=>{switch(t){case jt:return{type:Rt,payload:t};case me:return{type:Pt,payload:t};case Re:return{type:At,payload:t};default:throw new Error(`${t} is not a supported environment`)}},"setEnvironment"),Yt=n(()=>(t,e)=>{let{merchantId:r,sessionId:o}=e();return(!o||r&&!o.startsWith(r))&&t(Ba(r)),o},"requestSessionId"),Ue=n((t,e)=>({type:P,payload:{...t,offer:e}}),"receiveOffer"),Lr=n(t=>({type:yn,payload:t}),"fetchResponseError"),Ya=n((t,e=he,r)=>({type:we,payload:{product:t,module:e,offer:r}}),"requestOffer"),$n=n((t,e=he,r)=>n(function(s,i){let{merchantId:c,sessionId:a,environment:{apiUrl:l}}=i(),d=Ya(t,e,r);s(d);let h=R(t);return oe.fetchOffer(l,c,a,h,e).then(p=>s(Ue(p,r)),p=>s(Lr(p))).finally(()=>s(zt(d)))},"fetchOfferThunk"),"fetchOffer"),Hn=n(()=>({type:Pe}),"checkout"),Ja=n((t,e,r,o)=>({type:_n,payload:{product:t,order:e,quantity:r,offerId:o}}),"requestCreateOneTime"),Qa=n(t=>({type:Nt,payload:t}),"receiveCreateOneTime"),Ka=n((t,e)=>({type:En,payload:{item:t,frequency:e}}),"requestConvertOneTimeToSubscription"),Za=n((t,e)=>({type:kt,payload:{response:t,product:e}}),"receiveConvertOneTime"),Gn=n((t,e,r,o=!1,s=null)=>n(function(c,a){let{auth:l,environment:{legoUrl:d},previewUpsellOffer:h,offerId:p}=a();if(!l)return c(ie("No auth set."));let m=Ja(t,e,r,p);return c(m),(h?Promise.resolve({legoUrl:d,product:t,order:e,quantity:r,offer:p}):oe.createOneTime(d,l,t.id,e,r,p)).then(_=>(c(Qa(_)),o?(c(Ka(_,s)),(h?Promise.resolve({item:_,frequency:s}):oe.convertOneTimeToSubscription(d,l,_,s,p)).then(b=>c(Za(b,t)),b=>c(Lr(b)))):_),_=>c(Lr(_))).finally(()=>c(zt(m)))},"createIuThunk"),"createIu"),Bn=n(t=>({type:It,payload:t}),"setLocale"),zn=n(t=>({type:Ut,payload:t}),"setConfig"),Wn=n((t,e,r)=>({type:qt,payload:{selector:t,markup:e,config:r}}),"addTemplate"),Yn=n(t=>({type:Dt,payload:t}),"setTemplates"),Jn=n((t,e)=>({type:Ft,payload:{product:t,firstOrderPlaceDate:e}}),"setFirstOrderPlaceDate"),Qn=n((t,e)=>({type:Lt,payload:{product:t,productToSubscribe:e}}),"setProductToSubscribe")});var Gr,_e,Ee=S(()=>{Gr=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,_e=n((t,e,r=null)=>{for(;e!==r;){let o=e.nextSibling;t.removeChild(e),e=o}},"removeNodes")});var j,Br,fs,Fe,xe,hs,it,W,tr,ae=S(()=>{j=`{{lit-${String(Math.random()).slice(2)}}}`,Br=`<!--${j}-->`,fs=new RegExp(`${j}|${Br}`),Fe="$lit$",xe=class{constructor(e,r){this.parts=[],this.element=r;let o=[],s=[],i=document.createTreeWalker(r.content,133,null,!1),c=0,a=-1,l=0,{strings:d,values:{length:h}}=e;for(;l<h;){let p=i.nextNode();if(p===null){i.currentNode=s.pop();continue}if(a++,p.nodeType===1){if(p.hasAttributes()){let m=p.attributes,{length:_}=m,b=0;for(let f=0;f<_;f++)hs(m[f].name,Fe)&&b++;for(;b-- >0;){let f=d[l],x=tr.exec(f)[2],w=x.toLowerCase()+Fe,y=p.getAttribute(w);p.removeAttribute(w);let C=y.split(fs);this.parts.push({type:"attribute",index:a,name:x,strings:C}),l+=C.length-1}}p.tagName==="TEMPLATE"&&(s.push(p),i.currentNode=p.content)}else if(p.nodeType===3){let m=p.data;if(m.indexOf(j)>=0){let _=p.parentNode,b=m.split(fs),f=b.length-1;for(let x=0;x<f;x++){let w,y=b[x];if(y==="")w=W();else{let C=tr.exec(y);C!==null&&hs(C[2],Fe)&&(y=y.slice(0,C.index)+C[1]+C[2].slice(0,-Fe.length)+C[3]),w=document.createTextNode(y)}_.insertBefore(w,p),this.parts.push({type:"node",index:++a})}b[f]===""?(_.insertBefore(W(),p),o.push(p)):p.data=b[f],l+=f}}else if(p.nodeType===8)if(p.data===j){let m=p.parentNode;(p.previousSibling===null||a===c)&&(a++,m.insertBefore(W(),p)),c=a,this.parts.push({type:"node",index:a}),p.nextSibling===null?p.data="":(o.push(p),a--),l++}else{let m=-1;for(;(m=p.data.indexOf(j,m+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(let p of o)p.parentNode.removeChild(p)}};n(xe,"Template");hs=n((t,e)=>{let r=t.length-e.length;return r>=0&&t.slice(r)===e},"endsWith"),it=n(t=>t.index!==-1,"isTemplatePartActive"),W=n(()=>document.createComment(""),"createMarker"),tr=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/});function Wr(t,e){let{element:{content:r},parts:o}=t,s=document.createTreeWalker(r,zr,null,!1),i=at(o),c=o[i],a=-1,l=0,d=[],h=null;for(;s.nextNode();){a++;let p=s.currentNode;for(p.previousSibling===h&&(h=null),e.has(p)&&(d.push(p),h===null&&(h=p)),h!==null&&l++;c!==void 0&&c.index===a;)c.index=h!==null?-1:c.index-l,i=at(o,i),c=o[i]}d.forEach(p=>p.parentNode.removeChild(p))}function ms(t,e,r=null){let{element:{content:o},parts:s}=t;if(r==null){o.appendChild(e);return}let i=document.createTreeWalker(o,zr,null,!1),c=at(s),a=0,l=-1;for(;i.nextNode();)for(l++,i.currentNode===r&&(a=fc(e),r.parentNode.insertBefore(e,r));c!==-1&&s[c].index===l;){if(a>0){for(;c!==-1;)s[c].index+=a,c=at(s,c);return}c=at(s,c)}}var zr,fc,at,gs=S(()=>{ae();zr=133;n(Wr,"removeNodesFromTemplate");fc=n(t=>{let e=t.nodeType===11?0:1,r=document.createTreeWalker(t,zr,null,!1);for(;r.nextNode();)e++;return e},"countNodes"),at=n((t,e=-1)=>{for(let r=e+1;r<t.length;r++){let o=t[r];if(it(o))return r}return-1},"nextActiveIndexInTemplateParts");n(ms,"insertNodeIntoTemplate")});var hc,Se,Yr=S(()=>{hc=new WeakMap,Se=n(t=>typeof t=="function"&&hc.has(t),"isDirective")});var D,rr,Jr=S(()=>{D={},rr={}});var ce,or=S(()=>{Ee();ae();ce=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=Gr?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,c=0,a,l=s.nextNode();for(;i<o.length;){if(a=o[i],!it(a)){this.__parts.push(void 0),i++;continue}for(;c<a.index;)c++,l.nodeName==="TEMPLATE"&&(r.push(l),s.currentNode=l.content),(l=s.nextNode())===null&&(s.currentNode=r.pop(),l=s.nextNode());if(a.type==="node"){let d=this.processor.handleTextExpression(this.options);d.insertAfterNode(l.previousSibling),this.__parts.push(d)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,a.name,a.strings,this.options));i++}return Gr&&(document.adoptNode(e),customElements.upgrade(e)),e}};n(ce,"TemplateInstance")});var ys,gc,K,nr=S(()=>{Ee();ae();ys=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),gc=` ${j} `,K=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],c=i.lastIndexOf("<!--");o=(c>-1||o)&&i.indexOf("-->",c+1)===-1;let a=tr.exec(i);a===null?r+=i+(o?gc:Br):r+=i.substr(0,a.index)+a[1]+a[2]+Fe+a[3]+j}return r+=this.strings[e],r}getTemplateElement(){let e=document.createElement("template"),r=this.getHTML();return ys!==void 0&&(r=ys.createHTML(r)),e.innerHTML=r,e}};n(K,"TemplateResult")});var sr,ir,Le,ct,Z,lt,ut,ar,bs,pt,yc,cr=S(()=>{Yr();Ee();Jr();or();nr();ae();sr=n(t=>t===null||!(typeof t=="object"||typeof t=="function"),"isPrimitive"),ir=n(t=>Array.isArray(t)||!!(t&&t[Symbol.iterator]),"isIterable"),Le=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 ct(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"||!ir(i))return i}let s="";for(let i=0;i<r;i++){s+=e[i];let c=o[i];if(c!==void 0){let a=c.value;if(sr(a)||!ir(a))s+=typeof a=="string"?a:String(a);else for(let l of a)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(Le,"AttributeCommitter");ct=class{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==D&&(!sr(e)||e!==this.value)&&(this.value=e,Se(e)||(this.committer.dirty=!0))}commit(){for(;Se(this.value);){let e=this.value;this.value=D,e(this)}this.value!==D&&this.committer.commit()}};n(ct,"AttributePart");Z=class{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(W()),this.endNode=e.appendChild(W())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=W()),e.__insert(this.endNode=W())}insertAfterPart(e){e.__insert(this.startNode=W()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;Se(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=D,r(this)}let e=this.__pendingValue;e!==D&&(sr(e)?e!==this.value&&this.__commitText(e):e instanceof K?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):ir(e)?this.__commitIterable(e):e===rr?(this.value=rr,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 ce&&this.value.template===r)this.value.update(e.values);else{let o=new ce(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 Z(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){_e(this.startNode.parentNode,e.nextSibling,this.endNode)}};n(Z,"NodePart");lt=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(;Se(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=D,r(this)}if(this.__pendingValue===D)return;let e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=D}};n(lt,"BooleanAttributePart");ut=class extends Le{constructor(e,r,o){super(e,r,o);this.single=o.length===2&&o[0]===""&&o[1]===""}_createPart(){return new ar(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}};n(ut,"PropertyCommitter");ar=class extends ct{};n(ar,"PropertyPart");bs=!1;(()=>{try{let t={get capture(){return bs=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{}})();pt=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(;Se(this.__pendingValue);){let i=this.__pendingValue;this.__pendingValue=D,i(this)}if(this.__pendingValue===D)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=yc(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=D}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}};n(pt,"EventPart");yc=n(t=>t&&(bs?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),"getOptions")});function Qr(t){let e=Te.get(t.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},Te.set(t.type,e));let r=e.stringsArray.get(t.strings);if(r!==void 0)return r;let o=t.strings.join(j);return r=e.keyString.get(o),r===void 0&&(r=new xe(t,t.getTemplateElement()),e.keyString.set(o,r)),e.stringsArray.set(t.strings,r),r}var Te,lr=S(()=>{ae();n(Qr,"templateFactory");Te=new Map});var le,Kr,Zr=S(()=>{Ee();cr();lr();le=new WeakMap,Kr=n((t,e,r)=>{let o=le.get(e);o===void 0&&(_e(e,e.firstChild),le.set(e,o=new Z(Object.assign({templateFactory:Qr},r))),o.appendInto(e)),o.setValue(t),o.commit()},"render")});var ur,Xr,eo=S(()=>{cr();ur=class{handleAttributeExpressions(e,r,o,s){let i=r[0];return i==="."?new ut(e,r.slice(1),o).parts:i==="@"?[new pt(e,r.slice(1),s.eventContext)]:i==="?"?[new lt(e,r.slice(1),o)]:new Le(e,r,o).parts}handleTextExpression(e){return new Z(e)}};n(ur,"DefaultTemplateProcessor");Xr=new ur});var u,to=S(()=>{eo();nr();eo();Yr();Ee();Jr();cr();Zr();lr();or();nr();ae();typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");u=n((t,...e)=>new K(t,e,"html",Xr),"html")});var Es,pr,_c,Ec,xc,xs,Sc,Ss,Ts=S(()=>{Ee();gs();Zr();lr();or();ae();to();Es=n((t,e)=>`${t}--${e}`,"getTemplateCacheKey"),pr=!0;typeof window.ShadyCSS=="undefined"?pr=!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."),pr=!1);_c=n(t=>e=>{let r=Es(e.type,t),o=Te.get(r);o===void 0&&(o={stringsArray:new WeakMap,keyString:new Map},Te.set(r,o));let s=o.stringsArray.get(e.strings);if(s!==void 0)return s;let i=e.strings.join(j);if(s=o.keyString.get(i),s===void 0){let c=e.getTemplateElement();pr&&window.ShadyCSS.prepareTemplateDom(c,t),s=new xe(e,c),o.keyString.set(i,s)}return o.stringsArray.set(e.strings,s),s},"shadyTemplateFactory"),Ec=["html","svg"],xc=n(t=>{Ec.forEach(e=>{let r=Te.get(Es(e,t));r!==void 0&&r.keyString.forEach(o=>{let{element:{content:s}}=o,i=new Set;Array.from(s.querySelectorAll("style")).forEach(c=>{i.add(c)}),Wr(o,i)})})},"removeStylesFromLitTemplates"),xs=new Set,Sc=n((t,e,r)=>{xs.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 c=document.createElement("style");for(let d=0;d<i;d++){let h=s[d];h.parentNode.removeChild(h),c.textContent+=h.textContent}xc(t);let a=o.content;r?ms(r,c,a.firstChild):a.insertBefore(c,a.firstChild),window.ShadyCSS.prepareTemplateStyles(o,t);let l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&l!==null)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(r){a.insertBefore(c,a.firstChild);let d=new Set;d.add(c),Wr(r,d)}},"prepareTemplateStyles"),Ss=n((t,e,r)=>{if(!r||typeof r!="object"||!r.scopeName)throw new Error("The `scopeName` option is required.");let o=r.scopeName,s=le.has(e),i=pr&&e.nodeType===11&&!!e.host,c=i&&!xs.has(o),a=c?document.createDocumentFragment():e;if(Kr(t,a,Object.assign({templateFactory:_c(o)},r)),c){let l=le.get(a);le.delete(a);let d=l.value instanceof ce?l.value.template:void 0;Sc(o,a,d),_e(e,e.firstChild),e.appendChild(a),le.set(e,l)}!s&&i&&window.ShadyCSS.styleElement(e.host)},"render")});var vs,ro,Os,oo,no,so,io,ao,co,dt,lo=S(()=>{window.JSCompiler_renameProperty=(t,e)=>t;ro={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}},Os=n((t,e)=>e!==t&&(e===e||t===t),"notEqual"),oo={attribute:!0,type:String,converter:ro,reflect:!1,hasChanged:Os},no=1,so=1<<2,io=1<<3,ao=1<<4,co="finalized",dt=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=oo){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)||oo}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=Os){return o(e,r)}static _propertyValueFromAttribute(e,r){let o=r.type,s=r.converter||ro,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||ro.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=oo){let s=this.constructor,i=s._attributeNameForProperty(e,o);if(i!==void 0){let c=s._propertyValueToAttribute(r,o);if(c===void 0)return;this._updateState=this._updateState|io,c==null?this.removeAttribute(i):this.setAttribute(i,c),this._updateState=this._updateState&~io}}_attributeToProperty(e,r){if(this._updateState&io)return;let o=this.constructor,s=o._attributeToPropertyMap.get(e);if(s!==void 0){let i=o.getPropertyOptions(s);this._updateState=this._updateState|ao,this[s]=o._propertyValueFromAttribute(r,i),this._updateState=this._updateState&~ao}}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&ao)&&(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|so;try{await this._updatePromise}catch{}let e=this.performUpdate();return e!=null&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return this._updateState&so}get hasUpdated(){return this._updateState&no}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&no||(this._updateState=this._updateState|no,this.firstUpdated(r)),this.updated(r))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~so}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(dt,"UpdatingElement");vs=co;dt[vs]=!0});var ws,Jp,Cs=S(()=>{ws=Element.prototype,Jp=ws.msMatchesSelector||ws.webkitMatchesSelector});var dr,uo,ft,Ps,Tc,v,po=S(()=>{dr=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,uo=Symbol(),ft=class{constructor(e,r){if(r!==uo)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return this._styleSheet===void 0&&(dr?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}};n(ft,"CSSResult");Ps=n(t=>new ft(String(t),uo),"unsafeCSS"),Tc=n(t=>{if(t instanceof ft)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 Mi=Object.create;var Be=Object.defineProperty;var Vi=Object.getOwnPropertyDescriptor;var $i=Object.getOwnPropertyNames;var Hi=Object.getPrototypeOf,Gi=Object.prototype.hasOwnProperty;var tn=t=>Be(t,"__esModule",{value:!0}),n=(t,e)=>Be(t,"name",{value:e,configurable:!0});var S=(t,e)=>()=>(t&&(e=t(t=0)),e);var de=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xr=(t,e)=>{tn(t);for(var r in e)Be(t,r,{get:e[r],enumerable:!0})},Bi=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of $i(e))!Gi.call(t,o)&&o!=="default"&&Be(t,o,{get:()=>e[o],enumerable:!(r=Vi(e,o))||r.enumerable});return t},ee=t=>Bi(tn(Be(t!=null?Mi(Hi(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var Et=de((_t,un)=>{(function(t,e){typeof _t=="object"&&typeof un!="undefined"?e(_t):typeof define=="function"&&define.amd?define(["exports"],e):(t=t||self,e(t.throttleDebounce={}))})(_t,function(t){"use strict";function e(o,s,i,c){var a,l=!1,d=0;function h(){a&&clearTimeout(a)}n(h,"clearExistingTimeout");function p(){h(),l=!0}n(p,"cancel"),typeof s!="boolean"&&(c=i,i=s,s=void 0);function m(){for(var _=arguments.length,b=new Array(_),f=0;f<_;f++)b[f]=arguments[f];var x=this,w=Date.now()-d;if(l)return;function y(){d=Date.now(),i.apply(x,b)}n(y,"exec");function C(){a=void 0}n(C,"clear"),c&&!a&&y(),h(),c===void 0&&w>o?y():s!==!0&&(a=setTimeout(c?C:y,c===void 0?o-w:o))}return n(m,"wrapper"),m.cancel=p,m}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 dn(){return typeof window.og_auth!="undefined"?xt(window.og_auth):null}async function ta(t=100){return new Promise(e=>{setTimeout(()=>e(dn()),t)})}async function fn(t,e=Zi,r=Xi){let o;if(o=xt(dn())||xt(e()),o)return o;if(t&&typeof t=="string"){let s=await fetch(t);s.status>=200&&s.status<300&&(o=e()||await(ea(s)?s.json():Promise.resolve(r(t)).then(e)))}else o||(o=await ta());if(o=xt(o),o)return o;throw new Error("Unauthorized")}var pn,Zi,xt,Xi,ea,hn=S(()=>{pn=/^og_auth=/,Zi=n((t=pn)=>(document.cookie.split(/;\s*/).find(e=>e.match(t))||"").replace(pn,""),"c"),xt=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"),Xi=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"),ea=n(t=>(t.headers.get("content-type")||"").indexOf("application/json")!==-1,"d");n(dn,"a");n(ta,"f");n(fn,"u")});var I,U,q,St,we,P,We,Tt,vt,mn,Ot,Ce,gn,wt,Ct,yn,Pt,Rt,At,bn,_n,Nt,En,kt,Pe,xn,It,Ut,Ye,Je,qt,Dt,fe,te,Ft,Lt,Y,J,re,he,jt,me,Re,Cr,Pr,Sn,V=S(()=>{I="OPTIN_PRODUCT",U="OPTOUT_PRODUCT",q="PRODUCT_CHANGE_FREQUENCY",St="SET_MERCHANT_ID",we="REQUEST_OFFER",P="RECEIVE_OFFER",We="PRODUCT_HAS_CHANGED",Tt="CREATED_SESSION_ID",vt="SET_AUTH_URL",mn="REQUEST_AUTH",Ot="AUTHORIZE",Ce="UNAUTHORIZED",gn="REQUEST_ORDERS",wt="RECEIVE_ORDERS",Ct="RECEIVE_ORDER_ITEMS",yn="FETCH_RESPONSE_ERROR",Pt="SET_ENVIRONMENT_STAGING",Rt="SET_ENVIRONMENT_DEV",At="SET_ENVIRONMENT_PROD",bn="CONCLUDE_UPSELL",_n="REQUEST_CREATE_IU_ORDER",Nt="CREATE_ONE_TIME",En="REQUEST_CONVERT_ONE_TIME",kt="CONVERT_ONE_TIME",Pe="CHECKOUT",xn="RECEIVE_FETCH",It="SET_LOCALE",Ut="SET_CONFIG",Ye="SET_PREVIEW_STANDARD_OFFER",Je="SET_PREVIEW_UPSELL_OFFER",qt="ADD_TEMPLATE",Dt="SET_TEMPLATES",fe="LOCAL_STORAGE_CHANGE",te="LOCAL_STORAGE_CLEAR",Ft="SET_FIRST_ORDER_PLACE_DATE",Lt="SET_PRODUCT_TO_SUBSCRIBE",Y="RECEIVE_PRODUCT_PLANS",J="SETUP_PRODUCT",re="SETUP_CART",he="pdp",jt="dev",me="staging",Re="prod",Cr="static.ordergroove.com",Pr="staging.static.ordergroove.com",Sn="og-cart-updated"});var Ke=de((gu,An)=>{var ra="Expected a function",Tn="__lodash_hash_undefined__",oa="[object Function]",na="[object GeneratorFunction]",sa=/[\\^$.*+?()[\]{}|]/g,ia=/^\[object .+?Constructor\]$/,aa=typeof window=="object"&&window&&window.Object===Object&&window,ca=typeof self=="object"&&self&&self.Object===Object&&self,vn=aa||ca||Function("return this")();function la(t,e){return t==null?void 0:t[e]}n(la,"getValue");function ua(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}n(ua,"isHostObject");var pa=Array.prototype,da=Function.prototype,On=Object.prototype,Rr=vn["__core-js_shared__"],wn=function(){var t=/[^.]+$/.exec(Rr&&Rr.keys&&Rr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Cn=da.toString,Ar=On.hasOwnProperty,fa=On.toString,ha=RegExp("^"+Cn.call(Ar).replace(sa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ma=pa.splice,ga=Pn(vn,"Map"),Qe=Pn(Object,"create");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,"Hash");function ya(){this.__data__=Qe?Qe(null):{}}n(ya,"hashClear");function ba(t){return this.has(t)&&delete this.__data__[t]}n(ba,"hashDelete");function _a(t){var e=this.__data__;if(Qe){var r=e[t];return r===Tn?void 0:r}return Ar.call(e,t)?e[t]:void 0}n(_a,"hashGet");function Ea(t){var e=this.__data__;return Qe?e[t]!==void 0:Ar.call(e,t)}n(Ea,"hashHas");function xa(t,e){var r=this.__data__;return r[t]=Qe&&e===void 0?Tn:e,this}n(xa,"hashSet");ge.prototype.clear=ya;ge.prototype.delete=ba;ge.prototype.get=_a;ge.prototype.has=Ea;ge.prototype.set=xa;function Ae(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(Ae,"ListCache");function Sa(){this.__data__=[]}n(Sa,"listCacheClear");function Ta(t){var e=this.__data__,r=Mt(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():ma.call(e,r,1),!0}n(Ta,"listCacheDelete");function va(t){var e=this.__data__,r=Mt(e,t);return r<0?void 0:e[r][1]}n(va,"listCacheGet");function Oa(t){return Mt(this.__data__,t)>-1}n(Oa,"listCacheHas");function wa(t,e){var r=this.__data__,o=Mt(r,t);return o<0?r.push([t,e]):r[o][1]=e,this}n(wa,"listCacheSet");Ae.prototype.clear=Sa;Ae.prototype.delete=Ta;Ae.prototype.get=va;Ae.prototype.has=Oa;Ae.prototype.set=wa;function ye(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(ye,"MapCache");function Ca(){this.__data__={hash:new ge,map:new(ga||Ae),string:new ge}}n(Ca,"mapCacheClear");function Pa(t){return Vt(this,t).delete(t)}n(Pa,"mapCacheDelete");function Ra(t){return Vt(this,t).get(t)}n(Ra,"mapCacheGet");function Aa(t){return Vt(this,t).has(t)}n(Aa,"mapCacheHas");function Na(t,e){return Vt(this,t).set(t,e),this}n(Na,"mapCacheSet");ye.prototype.clear=Ca;ye.prototype.delete=Pa;ye.prototype.get=Ra;ye.prototype.has=Aa;ye.prototype.set=Na;function Mt(t,e){for(var r=t.length;r--;)if(Da(t[r][0],e))return r;return-1}n(Mt,"assocIndexOf");function ka(t){if(!Rn(t)||Ua(t))return!1;var e=Fa(t)||ua(t)?ha:ia;return e.test(qa(t))}n(ka,"baseIsNative");function Vt(t,e){var r=t.__data__;return Ia(e)?r[typeof e=="string"?"string":"hash"]:r.map}n(Vt,"getMapData");function Pn(t,e){var r=la(t,e);return ka(r)?r:void 0}n(Pn,"getNative");function Ia(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}n(Ia,"isKeyable");function Ua(t){return!!wn&&wn in t}n(Ua,"isMasked");function qa(t){if(t!=null){try{return Cn.call(t)}catch{}try{return t+""}catch{}}return""}n(qa,"toSource");function Nr(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(ra);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 c=t.apply(this,o);return r.cache=i.set(s,c),c},"memoized");return r.cache=new(Nr.Cache||ye),r}n(Nr,"memoize");Nr.Cache=ye;function Da(t,e){return t===e||t!==t&&e!==e}n(Da,"eq");function Fa(t){var e=Rn(t)?fa.call(t):"";return e==oa||e==na}n(Fa,"isFunction");function Rn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}n(Rn,"isObject");An.exports=Nr});var $t,kr,Ze,Xe,Ht,Nn,kn,La,ja,Ma,Va,$a,et,Ir,Ha,In,tt,Ga,oe,ne=S(()=>{$t=ee(Ke()),kr=n((...t)=>JSON.stringify(t),"memoizeKey"),Ze=n(t=>(...e)=>fetch(...t(...e)).then(r=>r.json()),"withFetchJson"),Xe=n(t=>(e,...r)=>{if(!e)throw Error("host required");let[o,s={}]=t(...r);return[`${e.replace(/\/+$/,"")}${o}`,s]},"withHost"),Ht=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"),Nn=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"),kn=n((t=[])=>(Array.isArray(t)?t:Object.entries(t)).map(([e,r])=>[e,encodeURIComponent(r)].join("=")).join("&"),"toQuery"),La=n(t=>JSON.stringify([].concat(t).map(e=>typeof e=="object"?e.id:e).filter(e=>e)),"toProductId"),ja=(0,$t.default)(Ze(Xe((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=kn([["session_id",e],["page_type",1],["p",La(r)],["module_view",JSON.stringify(["regular"])]]);return[`/offer/${t}/${o}?${s}`]})),kr),Ma=(0,$t.default)(Ze(Xe(Ht((t=1,e="place")=>[`/orders/?${kn([["status",t],["ordering",e],["exclude_prepaid_orders","true"]])}`]))),kr),Va=(0,$t.default)(Ze(Xe(Ht(t=>{if(!t)throw Error("orderId required");return[`/items/?order=${t}`]}))),kr),$a=Ze(Xe(Ht(Nn((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}}]})))),et=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"),Ir=n(t=>t.match(/^\d+_\d$/),"isFrequencyValid"),Ha=n((t,e)=>String.prototype.localeCompare.call(t&&t.split("_").reverse().join("_"),e&&e.split("_").reverse().join("_")),"compareFrequencies"),In=n(t=>[...new Set(t&&t.split(/\s+/))].filter(Ir).sort(Ha),"parseFrequenciesList"),tt=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"),Ga=Ze(Xe(Ht(Nn((t,e,r)=>{if(!t)throw Error("item required");if(!e)throw Error("frequency required");let o=et(e);if(!o)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:{item:t.public_id,offer:r,...o}}]})))),oe={fetchOffer:ja,fetchOrders:Ma,fetchItems:Va,createOneTime:$a,convertOneTimeToSubscription:Ga}});function rt(t){document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t()}function ot(){return document.querySelector([`script[src^="https://${Cr}"]`,`script[src^="https://${Pr}"]`,`script[src^="http://${Cr}"]`,`script[src^="http://${Pr}"]`].join(","))}function Ur(){let t=ot();if(!t)return[];let e=new URL(t.src),r=e.host.startsWith(me)?me:Re,o=e.pathname.split("/")[1];return!r&&!o?[]:[o,r,t]}function Un(t){if(t.isReady())return;let[e,r]=Ur();!r&&!e||t.initialize(e,r)}function Dn(t){let e=document.cookie.match(`(^|;) ?${t}=([^;]*)(;|$)`);return e?e[2]:null}var R,qn,$=S(()=>{Gt();V();n(rt,"onReady");n(ot,"getMainJs");n(Ur,"resolveEnvAndMerchant");R=n(t=>{var r;let e=`${t.id||t}`;return((r=Ne)==null?void 0:r.shopify_selling_plans)&&(e=e.split(":")[0]),e},"safeProductId");n(Un,"autoInitializeOffers");qn=n(t=>{document.cookie=`${t}=; expires=Thu, 01 Jan 1970 00:00:01 GMT;`},"clearCookie");n(Dn,"getCookieValue")});var ke,Ne,Gt=S(()=>{$();ke=ot(),Ne={shopify:typeof(ke==null?void 0:ke.dataset.shopifySellingPlans)!="undefined",shopify_selling_plans:typeof(ke==null?void 0:ke.dataset.shopifySellingPlans)!="undefined"}});var se,Ie,Fn,Bt,Ln,jn,Ba,za,nt,ie,Mn,zt,Vn,Wa,qr,Dr,Wt,Fr,Yt,Ue,Lr,Ya,$n,Hn,Ja,Qa,Ka,Za,Gn,Bn,zn,Wn,Yn,Jn,Qn,N=S(()=>{hn();V();ne();Gt();$();se=n((t,e,r)=>({type:I,payload:{product:t,frequency:e,offer:r}}),"optinProduct"),Ie=n((t,e)=>({type:U,payload:{product:t,offer:e}}),"optoutProduct"),Fn=n((t,e)=>({type:We,payload:{newProduct:t,product:e}}),"productHasChangedComponents"),Bt=n((t,e,r)=>({type:q,payload:{product:t,frequency:e,offer:r}}),"productChangeFrequency"),Ln=n(t=>({type:bn,payload:{product:t}}),"concludeUpsell"),jn=n(t=>({type:St,payload:t}),"setMerchantId"),Ba=n(t=>({type:Tt,payload:`${t}.${Math.floor(Math.random()*999999)}.${Math.round(new Date().getTime()/1e3)}`}),"createSessionId"),za=n(t=>({type:mn,payload:t}),"requestAuth"),nt=n((t,e,r,o)=>({type:Ot,payload:{public_id:t,sig_field:e,ts:r,sig:o}}),"authorize"),ie=n(t=>({type:Ce,payload:t}),"unauthorized"),Mn=n(t=>({type:vt,payload:t}),"setAuthUrl"),zt=n(t=>({type:xn,payload:t}),"fetchDone"),Vn=n((t=fn)=>n(function(r,o){if(window.og&&window.og.previewMode)return r(ie({message:"Offers are running in preview mode"}));let{merchantId:s,authUrl:i}=o(),c=za(i);return r(c),t(i).then(({sig_field:a,ts:l,sig:d})=>r(nt(s,a,l,d)),a=>r(ie(a))).finally(()=>r(zt(c)))},"fetchAuthThunk"),"fetchAuth"),Wa=n((t,e)=>({type:gn,payload:{status:t,ordering:e}}),"requestOrders"),qr=n(t=>({type:wt,payload:t}),"receiveOrders"),Dr=n(t=>({type:Ct,payload:t}),"receiveItems"),Wt=n((t=1,e="place")=>n(function(o,s){let{environment:{legoUrl:i},auth:c}=s();if(!c)return o(ie("No auth set."));let a=Wa(t,e);return o(a),oe.fetchOrders(i,c,t,e).then(l=>{if(l.results){o(qr(l));let d=(l.results[0]||{}).public_id;if(d)return oe.fetchItems(i,c,d).then(h=>o(Dr(h)))}return o(ie(l.detail)),null},l=>o(ie(l))).finally(()=>o(zt(a)))},"fetchOrdersThunk"),"fetchOrders"),Fr=n(t=>{switch(t){case jt:return{type:Rt,payload:t};case me:return{type:Pt,payload:t};case Re:return{type:At,payload:t};default:throw new Error(`${t} is not a supported environment`)}},"setEnvironment"),Yt=n(()=>(t,e)=>{let{merchantId:r,sessionId:o}=e();return(!o||r&&!o.startsWith(r))&&t(Ba(r)),o},"requestSessionId"),Ue=n((t,e)=>({type:P,payload:{...t,offer:e}}),"receiveOffer"),Lr=n(t=>({type:yn,payload:t}),"fetchResponseError"),Ya=n((t,e=he,r)=>({type:we,payload:{product:t,module:e,offer:r}}),"requestOffer"),$n=n((t,e=he,r)=>n(function(s,i){let{merchantId:c,sessionId:a,environment:{apiUrl:l}}=i(),d=Ya(t,e,r);s(d);let h=R(t);return oe.fetchOffer(l,c,a,h,e).then(p=>s(Ue(p,r)),p=>s(Lr(p))).finally(()=>s(zt(d)))},"fetchOfferThunk"),"fetchOffer"),Hn=n(()=>({type:Pe}),"checkout"),Ja=n((t,e,r,o)=>({type:_n,payload:{product:t,order:e,quantity:r,offerId:o}}),"requestCreateOneTime"),Qa=n(t=>({type:Nt,payload:t}),"receiveCreateOneTime"),Ka=n((t,e)=>({type:En,payload:{item:t,frequency:e}}),"requestConvertOneTimeToSubscription"),Za=n((t,e)=>({type:kt,payload:{response:t,product:e}}),"receiveConvertOneTime"),Gn=n((t,e,r,o=!1,s=null)=>n(function(c,a){let{auth:l,environment:{legoUrl:d},previewUpsellOffer:h,offerId:p}=a();if(!l)return c(ie("No auth set."));let m=Ja(t,e,r,p);return c(m),(h?Promise.resolve({legoUrl:d,product:t,order:e,quantity:r,offer:p}):oe.createOneTime(d,l,t.id,e,r,p)).then(_=>(c(Qa(_)),o?(c(Ka(_,s)),(h?Promise.resolve({item:_,frequency:s}):oe.convertOneTimeToSubscription(d,l,_,s,p)).then(b=>c(Za(b,t)),b=>c(Lr(b)))):_),_=>c(Lr(_))).finally(()=>c(zt(m)))},"createIuThunk"),"createIu"),Bn=n(t=>({type:It,payload:t}),"setLocale"),zn=n(t=>({type:Ut,payload:t}),"setConfig"),Wn=n((t,e,r)=>({type:qt,payload:{selector:t,markup:e,config:r}}),"addTemplate"),Yn=n(t=>({type:Dt,payload:t}),"setTemplates"),Jn=n((t,e)=>({type:Ft,payload:{product:t,firstOrderPlaceDate:e}}),"setFirstOrderPlaceDate"),Qn=n((t,e)=>({type:Lt,payload:{product:t,productToSubscribe:e}}),"setProductToSubscribe")});var Gr,_e,Ee=S(()=>{Gr=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,_e=n((t,e,r=null)=>{for(;e!==r;){let o=e.nextSibling;t.removeChild(e),e=o}},"removeNodes")});var j,Br,fs,Fe,xe,hs,it,W,tr,ae=S(()=>{j=`{{lit-${String(Math.random()).slice(2)}}}`,Br=`<!--${j}-->`,fs=new RegExp(`${j}|${Br}`),Fe="$lit$",xe=class{constructor(e,r){this.parts=[],this.element=r;let o=[],s=[],i=document.createTreeWalker(r.content,133,null,!1),c=0,a=-1,l=0,{strings:d,values:{length:h}}=e;for(;l<h;){let p=i.nextNode();if(p===null){i.currentNode=s.pop();continue}if(a++,p.nodeType===1){if(p.hasAttributes()){let m=p.attributes,{length:_}=m,b=0;for(let f=0;f<_;f++)hs(m[f].name,Fe)&&b++;for(;b-- >0;){let f=d[l],x=tr.exec(f)[2],w=x.toLowerCase()+Fe,y=p.getAttribute(w);p.removeAttribute(w);let C=y.split(fs);this.parts.push({type:"attribute",index:a,name:x,strings:C}),l+=C.length-1}}p.tagName==="TEMPLATE"&&(s.push(p),i.currentNode=p.content)}else if(p.nodeType===3){let m=p.data;if(m.indexOf(j)>=0){let _=p.parentNode,b=m.split(fs),f=b.length-1;for(let x=0;x<f;x++){let w,y=b[x];if(y==="")w=W();else{let C=tr.exec(y);C!==null&&hs(C[2],Fe)&&(y=y.slice(0,C.index)+C[1]+C[2].slice(0,-Fe.length)+C[3]),w=document.createTextNode(y)}_.insertBefore(w,p),this.parts.push({type:"node",index:++a})}b[f]===""?(_.insertBefore(W(),p),o.push(p)):p.data=b[f],l+=f}}else if(p.nodeType===8)if(p.data===j){let m=p.parentNode;(p.previousSibling===null||a===c)&&(a++,m.insertBefore(W(),p)),c=a,this.parts.push({type:"node",index:a}),p.nextSibling===null?p.data="":(o.push(p),a--),l++}else{let m=-1;for(;(m=p.data.indexOf(j,m+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(let p of o)p.parentNode.removeChild(p)}};n(xe,"Template");hs=n((t,e)=>{let r=t.length-e.length;return r>=0&&t.slice(r)===e},"endsWith"),it=n(t=>t.index!==-1,"isTemplatePartActive"),W=n(()=>document.createComment(""),"createMarker"),tr=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/});function Wr(t,e){let{element:{content:r},parts:o}=t,s=document.createTreeWalker(r,zr,null,!1),i=at(o),c=o[i],a=-1,l=0,d=[],h=null;for(;s.nextNode();){a++;let p=s.currentNode;for(p.previousSibling===h&&(h=null),e.has(p)&&(d.push(p),h===null&&(h=p)),h!==null&&l++;c!==void 0&&c.index===a;)c.index=h!==null?-1:c.index-l,i=at(o,i),c=o[i]}d.forEach(p=>p.parentNode.removeChild(p))}function ms(t,e,r=null){let{element:{content:o},parts:s}=t;if(r==null){o.appendChild(e);return}let i=document.createTreeWalker(o,zr,null,!1),c=at(s),a=0,l=-1;for(;i.nextNode();)for(l++,i.currentNode===r&&(a=fc(e),r.parentNode.insertBefore(e,r));c!==-1&&s[c].index===l;){if(a>0){for(;c!==-1;)s[c].index+=a,c=at(s,c);return}c=at(s,c)}}var zr,fc,at,gs=S(()=>{ae();zr=133;n(Wr,"removeNodesFromTemplate");fc=n(t=>{let e=t.nodeType===11?0:1,r=document.createTreeWalker(t,zr,null,!1);for(;r.nextNode();)e++;return e},"countNodes"),at=n((t,e=-1)=>{for(let r=e+1;r<t.length;r++){let o=t[r];if(it(o))return r}return-1},"nextActiveIndexInTemplateParts");n(ms,"insertNodeIntoTemplate")});var hc,Se,Yr=S(()=>{hc=new WeakMap,Se=n(t=>typeof t=="function"&&hc.has(t),"isDirective")});var D,rr,Jr=S(()=>{D={},rr={}});var ce,or=S(()=>{Ee();ae();ce=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=Gr?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,c=0,a,l=s.nextNode();for(;i<o.length;){if(a=o[i],!it(a)){this.__parts.push(void 0),i++;continue}for(;c<a.index;)c++,l.nodeName==="TEMPLATE"&&(r.push(l),s.currentNode=l.content),(l=s.nextNode())===null&&(s.currentNode=r.pop(),l=s.nextNode());if(a.type==="node"){let d=this.processor.handleTextExpression(this.options);d.insertAfterNode(l.previousSibling),this.__parts.push(d)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,a.name,a.strings,this.options));i++}return Gr&&(document.adoptNode(e),customElements.upgrade(e)),e}};n(ce,"TemplateInstance")});var ys,gc,K,nr=S(()=>{Ee();ae();ys=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),gc=` ${j} `,K=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],c=i.lastIndexOf("<!--");o=(c>-1||o)&&i.indexOf("-->",c+1)===-1;let a=tr.exec(i);a===null?r+=i+(o?gc:Br):r+=i.substr(0,a.index)+a[1]+a[2]+Fe+a[3]+j}return r+=this.strings[e],r}getTemplateElement(){let e=document.createElement("template"),r=this.getHTML();return ys!==void 0&&(r=ys.createHTML(r)),e.innerHTML=r,e}};n(K,"TemplateResult")});var sr,ir,Le,ct,Z,lt,ut,ar,bs,pt,yc,cr=S(()=>{Yr();Ee();Jr();or();nr();ae();sr=n(t=>t===null||!(typeof t=="object"||typeof t=="function"),"isPrimitive"),ir=n(t=>Array.isArray(t)||!!(t&&t[Symbol.iterator]),"isIterable"),Le=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 ct(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"||!ir(i))return i}let s="";for(let i=0;i<r;i++){s+=e[i];let c=o[i];if(c!==void 0){let a=c.value;if(sr(a)||!ir(a))s+=typeof a=="string"?a:String(a);else for(let l of a)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(Le,"AttributeCommitter");ct=class{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==D&&(!sr(e)||e!==this.value)&&(this.value=e,Se(e)||(this.committer.dirty=!0))}commit(){for(;Se(this.value);){let e=this.value;this.value=D,e(this)}this.value!==D&&this.committer.commit()}};n(ct,"AttributePart");Z=class{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(W()),this.endNode=e.appendChild(W())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=W()),e.__insert(this.endNode=W())}insertAfterPart(e){e.__insert(this.startNode=W()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;Se(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=D,r(this)}let e=this.__pendingValue;e!==D&&(sr(e)?e!==this.value&&this.__commitText(e):e instanceof K?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):ir(e)?this.__commitIterable(e):e===rr?(this.value=rr,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 ce&&this.value.template===r)this.value.update(e.values);else{let o=new ce(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 Z(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){_e(this.startNode.parentNode,e.nextSibling,this.endNode)}};n(Z,"NodePart");lt=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(;Se(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=D,r(this)}if(this.__pendingValue===D)return;let e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=D}};n(lt,"BooleanAttributePart");ut=class extends Le{constructor(e,r,o){super(e,r,o);this.single=o.length===2&&o[0]===""&&o[1]===""}_createPart(){return new ar(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}};n(ut,"PropertyCommitter");ar=class extends ct{};n(ar,"PropertyPart");bs=!1;(()=>{try{let t={get capture(){return bs=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{}})();pt=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(;Se(this.__pendingValue);){let i=this.__pendingValue;this.__pendingValue=D,i(this)}if(this.__pendingValue===D)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=yc(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=D}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}};n(pt,"EventPart");yc=n(t=>t&&(bs?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),"getOptions")});function Qr(t){let e=Te.get(t.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},Te.set(t.type,e));let r=e.stringsArray.get(t.strings);if(r!==void 0)return r;let o=t.strings.join(j);return r=e.keyString.get(o),r===void 0&&(r=new xe(t,t.getTemplateElement()),e.keyString.set(o,r)),e.stringsArray.set(t.strings,r),r}var Te,lr=S(()=>{ae();n(Qr,"templateFactory");Te=new Map});var le,Kr,Zr=S(()=>{Ee();cr();lr();le=new WeakMap,Kr=n((t,e,r)=>{let o=le.get(e);o===void 0&&(_e(e,e.firstChild),le.set(e,o=new Z(Object.assign({templateFactory:Qr},r))),o.appendInto(e)),o.setValue(t),o.commit()},"render")});var ur,Xr,eo=S(()=>{cr();ur=class{handleAttributeExpressions(e,r,o,s){let i=r[0];return i==="."?new ut(e,r.slice(1),o).parts:i==="@"?[new pt(e,r.slice(1),s.eventContext)]:i==="?"?[new lt(e,r.slice(1),o)]:new Le(e,r,o).parts}handleTextExpression(e){return new Z(e)}};n(ur,"DefaultTemplateProcessor");Xr=new ur});var u,to=S(()=>{eo();nr();eo();Yr();Ee();Jr();cr();Zr();lr();or();nr();ae();typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");u=n((t,...e)=>new K(t,e,"html",Xr),"html")});var Es,pr,_c,Ec,xc,xs,Sc,Ss,Ts=S(()=>{Ee();gs();Zr();lr();or();ae();to();Es=n((t,e)=>`${t}--${e}`,"getTemplateCacheKey"),pr=!0;typeof window.ShadyCSS=="undefined"?pr=!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."),pr=!1);_c=n(t=>e=>{let r=Es(e.type,t),o=Te.get(r);o===void 0&&(o={stringsArray:new WeakMap,keyString:new Map},Te.set(r,o));let s=o.stringsArray.get(e.strings);if(s!==void 0)return s;let i=e.strings.join(j);if(s=o.keyString.get(i),s===void 0){let c=e.getTemplateElement();pr&&window.ShadyCSS.prepareTemplateDom(c,t),s=new xe(e,c),o.keyString.set(i,s)}return o.stringsArray.set(e.strings,s),s},"shadyTemplateFactory"),Ec=["html","svg"],xc=n(t=>{Ec.forEach(e=>{let r=Te.get(Es(e,t));r!==void 0&&r.keyString.forEach(o=>{let{element:{content:s}}=o,i=new Set;Array.from(s.querySelectorAll("style")).forEach(c=>{i.add(c)}),Wr(o,i)})})},"removeStylesFromLitTemplates"),xs=new Set,Sc=n((t,e,r)=>{xs.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 c=document.createElement("style");for(let d=0;d<i;d++){let h=s[d];h.parentNode.removeChild(h),c.textContent+=h.textContent}xc(t);let a=o.content;r?ms(r,c,a.firstChild):a.insertBefore(c,a.firstChild),window.ShadyCSS.prepareTemplateStyles(o,t);let l=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&l!==null)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(r){a.insertBefore(c,a.firstChild);let d=new Set;d.add(c),Wr(r,d)}},"prepareTemplateStyles"),Ss=n((t,e,r)=>{if(!r||typeof r!="object"||!r.scopeName)throw new Error("The `scopeName` option is required.");let o=r.scopeName,s=le.has(e),i=pr&&e.nodeType===11&&!!e.host,c=i&&!xs.has(o),a=c?document.createDocumentFragment():e;if(Kr(t,a,Object.assign({templateFactory:_c(o)},r)),c){let l=le.get(a);le.delete(a);let d=l.value instanceof ce?l.value.template:void 0;Sc(o,a,d),_e(e,e.firstChild),e.appendChild(a),le.set(e,l)}!s&&i&&window.ShadyCSS.styleElement(e.host)},"render")});var vs,ro,Os,oo,no,so,io,ao,co,dt,lo=S(()=>{window.JSCompiler_renameProperty=(t,e)=>t;ro={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}},Os=n((t,e)=>e!==t&&(e===e||t===t),"notEqual"),oo={attribute:!0,type:String,converter:ro,reflect:!1,hasChanged:Os},no=1,so=1<<2,io=1<<3,ao=1<<4,co="finalized",dt=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=oo){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)||oo}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=Os){return o(e,r)}static _propertyValueFromAttribute(e,r){let o=r.type,s=r.converter||ro,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||ro.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=oo){let s=this.constructor,i=s._attributeNameForProperty(e,o);if(i!==void 0){let c=s._propertyValueToAttribute(r,o);if(c===void 0)return;this._updateState=this._updateState|io,c==null?this.removeAttribute(i):this.setAttribute(i,c),this._updateState=this._updateState&~io}}_attributeToProperty(e,r){if(this._updateState&io)return;let o=this.constructor,s=o._attributeToPropertyMap.get(e);if(s!==void 0){let i=o.getPropertyOptions(s);this._updateState=this._updateState|ao,this[s]=o._propertyValueFromAttribute(r,i),this._updateState=this._updateState&~ao}}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&ao)&&(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|so;try{await this._updatePromise}catch{}let e=this.performUpdate();return e!=null&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return this._updateState&so}get hasUpdated(){return this._updateState&no}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&no||(this._updateState=this._updateState|no,this.firstUpdated(r)),this.updated(r))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~so}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(dt,"UpdatingElement");vs=co;dt[vs]=!0});var ws,Jp,Cs=S(()=>{ws=Element.prototype,Jp=ws.msMatchesSelector||ws.webkitMatchesSelector});var dr,uo,ft,Ps,Tc,v,po=S(()=>{dr=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,uo=Symbol(),ft=class{constructor(e,r){if(r!==uo)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return this._styleSheet===void 0&&(dr?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}};n(ft,"CSSResult");Ps=n(t=>new ft(String(t),uo),"unsafeCSS"),Tc=n(t=>{if(t instanceof ft)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"),v=n((t,...e)=>{let r=e.reduce((o,s,i)=>o+Tc(s)+t[i+1],t[0]);return new ft(r,uo)},"css")});var Rs,T,O=S(()=>{Ts();lo();lo();Cs();to();po();po();(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");Rs={},T=class extends dt{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,c)=>i.reduceRight((a,l)=>Array.isArray(l)?r(l,a):(a.add(l),a),c),"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&&!dr){let o=Array.prototype.slice.call(r.cssRules).reduce((s,i)=>s+i.cssText,"");return Ps(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):dr?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!==Rs&&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 Rs}};n(T,"LitElement");T.finalized=!0;T.render=Ss});var fr=de((id,As)=>{var vc={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"};As.exports=vc});var ks=de((ad,Ns)=>{var ve=fr(),Oc=n(t=>{let e="",r=[];for(let o of t){let s=o.charCodeAt(0);switch(s){case ve.PAR_OPEN:case ve.PAR_CLOSE:case ve.OP_NOT:case ve.BINARY_AND:case ve.BINARY_OR:e&&(r.push({type:ve.LITERAL,value:e}),e=""),r.push({type:s,value:o});break;default:e+=o}}return e&&r.push({type:ve.LITERAL,value:e}),r},"Tokenizer");Ns.exports=Oc});var Us=de((cd,Is)=>{var ue=fr(),wc=n(t=>{let e=[],r=[];return t.forEach(s=>{switch(s.type){case ue.LITERAL:e.unshift(s);break;case ue.BINARY_AND:case ue.BINARY_OR:case ue.OP_NOT:case ue.PAR_OPEN:r.push(s);break;case ue.PAR_CLOSE:for(;r.length&&r[r.length-1].type!==ue.PAR_OPEN;)e.unshift(r.pop());r.pop(),r.length&&r[r.length-1].type===ue.OP_NOT&&e.unshift(r.pop());break;default:break}}),r.length&&[...r.reverse(),...e]||e},"PolishNotation"),Cc=n(function*(t){for(let e=0;e<t.length-1;e++)yield t[e];return t[t.length-1]},"PolishGenerator");Is.exports={PolishNotation:wc,PolishGenerator:Cc}});var Ds=de((ld,qs)=>{var F=fr(),G=class{constructor(e,r,o,s){this.op=e,this.left=r,this.right=o,this.literal=s}isLeaf(){return this.op===F.LEAF}isAtomic(){return this.isLeaf()||this.op===F.OP_NOT&&this.left.isLeaf()}getLiteralValue(){return this.literal}static CreateAnd(e,r){return new G(F.BINARY_AND,e,r)}static CreateNot(e){return new G(F.OP_NOT,e)}static CreateOr(e,r){return new G(F.BINARY_OR,e,r)}static CreateLiteral(e){return new G(F.LEAF,null,null,e)}};n(G,"ExpNode");var je=n(t=>{let e=t.next().value;switch(e.type){case F.LITERAL:return G.CreateLiteral(e.value);case F.OP_NOT:return G.CreateNot(je(t));case F.BINARY_AND:{let r=je(t),o=je(t);return G.CreateAnd(r,o)}case F.BINARY_OR:{let r=je(t),o=je(t);return G.CreateOr(r,o)}}return null},"make"),Me=n((t,e)=>{if(t.isLeaf())return e(t.getLiteralValue());if(t.op===F.OP_NOT)return!Me(t.left,e);if(t.op===F.BINARY_OR)return Me(t.left,e)||Me(t.right,e);if(t.op===F.BINARY_AND)return Me(t.left,e)&&Me(t.right,e)},"nodeEvaluator");qs.exports={make:je,nodeEvaluator:Me}});var Ms=de((ud,js)=>{var Pc=ks(),Fs=Us(),Ls=Ds(),Rc=n((t,e)=>{let r=Pc(t),o=Fs.PolishNotation(r),s=Fs.PolishGenerator(o),i=Ls.make(s);return Ls.nodeEvaluator(i,e)},"parse");js.exports={parse:Rc}});var yi={};xr(yi,{TestWizard:()=>Er,default:()=>Zc});var Er,Zc,bi=S(()=>{O();N();Er=class extends T{static get styles(){return v`
|
|
13
13
|
:host {
|
|
14
14
|
position: fixed;
|
|
@@ -107,7 +107,7 @@ var lib=(()=>{var Mi=Object.create;var Be=Object.defineProperty;var Vi=Object.ge
|
|
|
107
107
|
`}
|
|
108
108
|
<button ?disabled=${this.disabled} @click="${this.runTests.bind(this)}" class="primary">Run Test</button>
|
|
109
109
|
</div>
|
|
110
|
-
`}};n(Er,"TestWizard");Zc=Er});var iu={};xr(iu,{addOptinChangedCallback:()=>jl,addTemplate:()=>Ml,clear:()=>Vl,config:()=>$l,default:()=>su,disableOptinChangedCallbacks:()=>Hl,getOptins:()=>Gl,getProductsForPurchasePost:()=>Bl,initialize:()=>zl,isReady:()=>Ll,offers:()=>E,platform:()=>Ne,previewMode:()=>Wl,register:()=>Yl,resolveSettings:()=>Jl,setAuthUrl:()=>Ql,setEnvironment:()=>Kl,setLocale:()=>Zl,setMerchantId:()=>Xl,setPublicPath:()=>eu,setTemplates:()=>tu,setupCart:()=>ru,setupProduct:()=>ou,setupProducts:()=>nu,store:()=>Fi});function Sr(t){var e,r=t.Symbol;return typeof r=="function"?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}n(Sr,"symbolObservablePonyfill");var Oe;typeof self!="undefined"?Oe=self:typeof window!="undefined"||typeof window!="undefined"?Oe=window:typeof module!="undefined"?Oe=module:Oe=Function("return this")();var zi=Sr(Oe),Tr=zi;var vr=n(function(){return Math.random().toString(36).substring(7).split("").join(".")},"randomString"),ze={INIT:"@@redux/INIT"+vr(),REPLACE:"@@redux/REPLACE"+vr(),PROBE_UNKNOWN_ACTION:n(function(){return"@@redux/PROBE_UNKNOWN_ACTION"+vr()},"PROBE_UNKNOWN_ACTION")};function Wi(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}n(Wi,"isPlainObject");function Or(t,e,r){var o;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if(typeof e=="function"&&typeof r=="undefined"&&(r=e,e=void 0),typeof r!="undefined"){if(typeof r!="function")throw new Error("Expected the enhancer to be a function.");return r(Or)(t,e)}if(typeof t!="function")throw new Error("Expected the reducer to be a function.");var s=t,i=e,c=[],a=c,l=!1;function d(){a===c&&(a=c.slice())}n(d,"ensureCanMutateNextListeners");function h(){if(l)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}n(h,"getState");function p(f){if(typeof f!="function")throw new Error("Expected the listener to be a function.");if(l)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var x=!0;return d(),a.push(f),n(function(){if(!!x){if(l)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");x=!1,d();var y=a.indexOf(f);a.splice(y,1),c=null}},"unsubscribe")}n(p,"subscribe");function m(f){if(!Wi(f))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(typeof f.type=="undefined")throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(l)throw new Error("Reducers may not dispatch actions.");try{l=!0,i=s(i,f)}finally{l=!1}for(var x=c=a,w=0;w<x.length;w++){var y=x[w];y()}return f}n(m,"dispatch");function _(f){if(typeof f!="function")throw new Error("Expected the nextReducer to be a function.");s=f,m({type:ze.REPLACE})}n(_,"replaceReducer");function b(){var f,x=p;return f={subscribe:n(function(y){if(typeof y!="object"||y===null)throw new TypeError("Expected the observer to be an object.");function C(){y.next&&y.next(h())}n(C,"observeState"),C();var L=x(C);return{unsubscribe:L}},"subscribe")},f[Tr]=function(){return this},f}return n(b,"observable"),m({type:ze.INIT}),o={dispatch:m,subscribe:p,getState:h,replaceReducer:_},o[Tr]=b,o}n(Or,"createStore");function Yi(t,e){var r=e&&e.type,o=r&&'action "'+String(r)+'"'||"an action";return"Given "+o+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}n(Yi,"getUndefinedStateErrorMessage");function Ji(t){Object.keys(t).forEach(function(e){var r=t[e],o=r(void 0,{type:ze.INIT});if(typeof o=="undefined")throw new Error('Reducer "'+e+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:ze.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error('Reducer "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle "+ze.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}n(Ji,"assertReducerShape");function bt(t){for(var e=Object.keys(t),r={},o=0;o<e.length;o++){var s=e[o];typeof t[s]=="function"&&(r[s]=t[s])}var i=Object.keys(r),c,a;try{Ji(r)}catch(l){a=l}return n(function(d,h){if(d===void 0&&(d={}),a)throw a;if(!1)var p;for(var m=!1,_={},b=0;b<i.length;b++){var f=i[b],x=r[f],w=d[f],y=x(w,h);if(typeof y=="undefined"){var C=Yi(f,h);throw new Error(C)}_[f]=y,m=m||y!==w}return m=m||i.length!==Object.keys(d).length,m?_:d},"combination")}n(bt,"combineReducers");function rn(t,e){return function(){return e(t.apply(this,arguments))}}n(rn,"bindActionCreator");function on(t,e){if(typeof t=="function")return rn(t,e);if(typeof t!="object"||t===null)throw new Error("bindActionCreators expected an object or a function, instead received "+(t===null?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var r={};for(var o in t){var s=t[o];typeof s=="function"&&(r[o]=rn(s,e))}return r}n(on,"bindActionCreators");function Qi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n(Qi,"_defineProperty");function nn(t,e){var r=Object.keys(t);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(t)),e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r}n(nn,"ownKeys");function Ki(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?nn(r,!0).forEach(function(o){Qi(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nn(r).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}n(Ki,"_objectSpread2");function wr(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(o){return o}:e.length===1?e[0]:e.reduce(function(o,s){return function(){return o(s.apply(void 0,arguments))}})}n(wr,"compose");function sn(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(o){return function(){var s=o.apply(void 0,arguments),i=n(function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},"dispatch"),c={getState:s.getState,dispatch:n(function(){return i.apply(void 0,arguments)},"dispatch")},a=e.map(function(l){return l(c)});return i=wr.apply(void 0,a)(s.dispatch),Ki({},s,{dispatch:i})}}}n(sn,"applyMiddleware");function an(t){var e=n(function(o){var s=o.dispatch,i=o.getState;return function(c){return function(a){return typeof a=="function"?a(s,i,t):c(a)}}},"middleware");return e}n(an,"createThunkMiddleware");var cn=an();cn.withExtraArgument=an;var ln=cn;var Kn=ee(Et());N();V();var st="OG_STATE",Zn=n(t=>{try{return t===null?void 0:JSON.parse(t)}catch{return}},"safeParseState"),jr=n(()=>window.og&&window.og.previewMode,"isPreviewMode"),Xn=n(()=>jr()?{}:Zn(localStorage.getItem(st)),"loadState"),Xa=n(t=>!t||!t.sessionId?!1:JSON.stringify({sessionId:t.sessionId,optedin:t.optedin,optedout:t.optedout,productOffer:t.productOffer,firstOrderPlaceDate:t.firstOrderPlaceDate,productToSubscribe:t.productToSubscribe}),"serializeState"),es=n(t=>{if(jr())return;let e=Xa(t);e&&localStorage.getItem(st)!==e&&localStorage.setItem(st,e)},"saveState"),ts=n(t=>(0,Kn.throttle)(500,e=>{if(jr())return;let{key:r,newValue:o}=e;r===st&&o===null?(t.dispatch({type:te}),setTimeout(()=>t.dispatch(Yt()),0)):r===st&&t.dispatch({type:fe,newValue:Zn(o)})}),"listenLocalStorageChanges");var os=ee(Et());V();function ec(t,e){return t===e}n(ec,"defaultEqualityCheck");function tc(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}n(tc,"areArgumentsShallowlyEqual");function rc(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ec,r=null,o=null;return function(){return tc(e,r,arguments)||(o=t.apply(null,arguments)),r=arguments,o}}n(rc,"defaultMemoize");function oc(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}n(oc,"getDependencies");function nc(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),c=0;c<s;c++)i[c]=arguments[c];var a=0,l=i.pop(),d=oc(i),h=t.apply(void 0,[function(){return a++,l.apply(null,arguments)}].concat(r)),p=t(function(){for(var m=[],_=d.length,b=0;b<_;b++)m.push(d[b].apply(null,arguments));return h.apply(null,m)});return p.resultFunc=l,p.dependencies=d,p.recomputations=function(){return a},p.resetRecomputations=function(){return a=0},p}}n(nc,"createSelectorCreator");var qe=nc(rc);var be=ee(Ke());ne();be.default.Cache=Map;function sc(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}n(sc,"arraysEqual");var A=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))||sc((t.components||[]).sort(),(e.components||[]).sort()))),"isSameProduct"),Jt=n(t=>t.optedin||[],"optedinSelector"),rs=n(t=>t.optedout||[],"optedoutSelector"),Mr=n(t=>t.autoshipByDefault||{},"autoshipSelector"),ic=n(t=>t.defaultFrequencies||{},"defaultFrequenciesSelector"),Q=(0,be.default)(t=>qe(Jt,rs,Mr,(e,r,o)=>{let s=e.find(i=>A(t,i));return s||(r.find(i=>A(t,i))?!1:t&&o[t.id]?{id:t.id}:!1)}),t=>JSON.stringify(t)),Qt=(0,be.default)(t=>qe(Jt,e=>{let r=e.find(o=>A(t,o));return r||!1}),t=>JSON.stringify(t)),Kt=(0,be.default)(t=>qe(rs,e=>e.find(r=>A(t,r))));var z=(0,be.default)(t=>qe(Q(t),e=>e&&e.frequency||null)),Zt=(0,be.default)(t=>qe(ic,e=>e[t]&&tt(e[t])||null)),Vr=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(Vr(r))&&e[r]||e.offer&&typeof(e.offer[r]!=="undefined")&&e.offer[r]||o}),"configSelector"),De=n(t=>({templates:t.templates||[]}),"templatesSelector");var ac=n((t,e,r=document)=>r.dispatchEvent(new CustomEvent(t,{detail:e})),"dispatchEvent"),ns=n(t=>({payload:{product:{id:e,components:r}={}}={}}={})=>setTimeout(()=>ac("optin-changed",{productId:e,components:r,optedIn:t}),0),"dispatchOptinChangedEvent"),cc=[{expressions:[({type:t}={})=>t===I,({type:t}={})=>t===q],fn:ns(!0)},{expressions:[({type:t}={})=>t===U],fn:ns(!1)}],ss=n(t=>e=>r=>{let o=t.getState();cc.forEach(s=>{s.expressions.some(i=>i(r,o))&&s.fn(r)}),e(r)},"dispatchMiddleware"),is=n(t=>e=>r=>{var s;let o;switch(r.type){case P:case U:case I:case q:o=new CustomEvent(`og-${r.type.toLowerCase().replace(/_/g,"-")}`,{bubbles:!0,cancelable:!0,detail:r.payload}),(((s=r.payload)==null?void 0:s.offer)||document).dispatchEvent(o);break;default:}(o==null?void 0:o.defaultPrevented)||e(r)},"offerEvents"),as=n(t=>e=>r=>{e(r);let o=(0,os.throttle)(500,()=>{es({...t.getState()})});r.type!==fe&&o()},"localStorageMiddleware");function cs(t,...e){if(window.og&&window.og.store)return window.og.store;let r=window.og&&window.og.previewMode,o=typeof window=="object"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):wr,s=[ln,ss,is],i={};if(!r)try{i=Xn(),s.push(as)}catch{}let c=o(sn(...s,...e)),a=Or(t,i,c);return window.og=window.og||{},window.og.store=a,a}n(cs,"makeStore");var lc=Object.defineProperty,Xt=n((t,e)=>lc(t,"name",{value:e,configurable:!0}),"i"),uc=Xt(t=>e=>t.indexOf(e.origin)>=0,"createIsMessageAllowed"),ls=["https://rc3.ordergroove.com","https://rc3.stg.ordergroove.com","http://localhost:3000",window.location.origin],us=Xt(t=>(e,r)=>{ls.forEach(o=>t.postMessage({ogType:e,...r},o))},"createBroadcastMessage");function $r(t=window.opener,e=window.og){let r=Xt(o=>{let s=uc(ls),i=us(o.source),c=o.data.options||{};if(s(o)&&o.data.ogType==="READY"){let a="//static.ordergroove.com/@ordergroove/offers-live-editor/0.6.0/dist/";a.startsWith("//")&&(a=window.location.protocol+a),a.endsWith("/")||(a+="/"),import(`${a}client.js`).then(({initializeClient:l})=>{l({isMessageAllowed:s,broadcastMessage:i,options:c,og:e}),window.removeEventListener("message",r)})}},"handleReady");t&&t!==window&&(window.addEventListener("message",r),us(t)("READY"))}n($r,"f");Xt($r,"offersLiveEditor");var er=null,pc=n(t=>({dispatch:t}),"defaultMapDispatchToProps"),ps=n(t=>{if(!er)throw new Error("Missing redux store.");return er},"resolveStore"),dc=n((t,e)=>r=>{let{getState:o,dispatch:s}=ps(r),i=t?t(o(),r):{},c=e(s,r);Object.assign(r,i,c)},"createRecalcProps"),g=n((t,e=pc)=>r=>{let s=dc(t,typeof e=="function"?e:i=>on(e,i));return class extends r{get store(){return er}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=ps(this).subscribe(()=>s(this)),s(this)}attributeChangedCallback(i,c,a){super.attributeChangedCallback&&super.attributeChangedCallback(i,c,a),this._storeUnsubscribe&&c!==a&&s(this)}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}}},"connect"),ds=n(t=>{er=t},"setStore");ne();var Hr=n((t={},e=[])=>(t.optedin||[]).map(r=>{let o={product:r.id,subscription_info:{components:r.components||[]},tracking_override:{offer:((t.productOffer||{})[r.id]||[])[0],...et(r.frequency)}};return t.firstOrderPlaceDate&&t.firstOrderPlaceDate[r.id]&&(o.subscription_info.first_order_place_date=t.firstOrderPlaceDate[r.id]),t.productToSubscribe&&t.productToSubscribe[r.id]&&(o.tracking_override.product=t.productToSubscribe[r.id]),o}).filter(r=>r.tracking_override.offer).filter(r=>e.length?e.includes(r.product):r),"getProductsForPurchasePost");N();O();var Ys=ee(Ms());O();var Ac=n(t=>{let e=String(t||"").trim().match(/(\d+)\s*([dwm])/);return e?`${e[1]}_${{d:1,w:2,m:3}[e[2]]}`:t},"sanitizeFrequencyString"),Vs=n(t=>t.hasAttribute("product")&&{id:t.getAttribute("product"),...t.hasAttribute("product-components")&&{components:JSON.parse(t.getAttribute("product-components"))}},"buildProduct");var fo=n(t=>{let e=Vs(t);if(!e){let r=t.offer;r&&(e=Vs(r))}return e},"resolveProduct"),Nc=n(t=>{let e=t;for(;e;){if(e.tagName==="OG-OFFER")return e;e=e.nodeType===11?e.host:e.parentNode}},"resolveOffer"),ho=n(t=>class extends t{get offer(){return Nc(this)}connectedCallback(){super.connectedCallback(),this.offersChangeTemplate=this.offersChangeTemplate.bind(this),this.offer&&this.offer.addEventListener("template-changed",this.offersChangeTemplate)}disconnectedCallback(){super.disconnectedCallback(),this.offer&&this.offer.removeEventListener("template-changed",this.offersChangeTemplate)}offersChangeTemplate(){this._enqueueUpdate()}},"withOfferTemplate"),k=n(t=>class extends ho(t){get product(){return fo(this)}},"withProduct"),hr=n(t=>class extends t{get childOptions(){let e=[],r=null;return this.querySelectorAll("option").forEach(o=>{let s=Ac(o.value),i=o.innerText.trim();e.push({value:s,text:i}),!r&&o.selected&&(r=s)}),{options:e,isSelected:r}}},"withChildOptions");var mr={};xr(mr,{autoshipByDefault:()=>kc,eligibilityGroups:()=>Gs,eligible:()=>$s,hasUpcomingOrder:()=>zs,hasUpsellGroup:()=>Bs,inStock:()=>mo,optedout:()=>Uc,regularEligible:()=>Dc,subscribed:()=>Ic,subscriptionEligible:()=>Hs,upcomingOrderContainsProduct:()=>qc,upsellEligible:()=>Ws});var mo=n((t,e)=>(t.inStock||{})[(e.product||{}).id],"inStock"),$s=n((t,e)=>(t.autoshipEligible||{})[(e.product||{}).id]||!1,"eligible"),kc=n((t,e)=>(t.autoshipByDefault||{})[(e.product||{}).id]||!1,"autoshipByDefault"),Hs=n((t,e)=>(t.offerId&&t.offerId!=="0"||!1)&&$s(t,e)&&mo(t,e),"subscriptionEligible"),Gs=n((t,e)=>(t.eligibilityGroups||{})[(e.product||{}).id]||null,"eligibilityGroups"),Bs=n((t,e)=>{let r=Gs(t,e);return r===null||!!r.find(o=>o==="upsell"||o==="impulse_upsell")},"hasUpsellGroup"),Ic=n((t,e)=>Qt(e.product)(t),"subscribed"),Uc=n((t,e)=>Kt(e.product)(t),"optedout"),zs=n(t=>!!(t.nextUpcomingOrder&&t.nextUpcomingOrder.public_id),"hasUpcomingOrder"),qc=n((t,e)=>(t.nextUpcomingOrder&&t.nextUpcomingOrder.products||[]).includes((e.product||{}).id),"upcomingOrderContainsProduct"),Ws=n((t,e)=>!e.offer.isCart&&t.offerId&&t.offerId!=="0"&&t.auth&&mo(t,e)&&zs(t)&&Bs(t,e),"upsellEligible"),Dc=n((t,e)=>Hs(t,e)&&!Ws(t,e),"regularEligible");var Fc=n(t=>t.replace(/(\r\n|\n|\r|\s)+/gm,""),"removeWhitespace"),go=class extends k(T){static get properties(){return{...super.properties,state:{type:Object,attribute:!1},test:{type:String}}}render(){return this.test&&Ys.default.parse(Fc(this.test),r=>mr[r]&&mr[r](this.state,this))?u`
|
|
110
|
+
`}};n(Er,"TestWizard");Zc=Er});var iu={};xr(iu,{addOptinChangedCallback:()=>jl,addTemplate:()=>Ml,clear:()=>Vl,config:()=>$l,default:()=>su,disableOptinChangedCallbacks:()=>Hl,getOptins:()=>Gl,getProductsForPurchasePost:()=>Bl,initialize:()=>zl,isReady:()=>Ll,offers:()=>E,platform:()=>Ne,previewMode:()=>Wl,register:()=>Yl,resolveSettings:()=>Jl,setAuthUrl:()=>Ql,setEnvironment:()=>Kl,setLocale:()=>Zl,setMerchantId:()=>Xl,setPublicPath:()=>eu,setTemplates:()=>tu,setupCart:()=>ru,setupProduct:()=>ou,setupProducts:()=>nu,store:()=>Fi});function Sr(t){var e,r=t.Symbol;return typeof r=="function"?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}n(Sr,"symbolObservablePonyfill");var Oe;typeof self!="undefined"?Oe=self:typeof window!="undefined"||typeof window!="undefined"?Oe=window:typeof module!="undefined"?Oe=module:Oe=Function("return this")();var zi=Sr(Oe),Tr=zi;var vr=n(function(){return Math.random().toString(36).substring(7).split("").join(".")},"randomString"),ze={INIT:"@@redux/INIT"+vr(),REPLACE:"@@redux/REPLACE"+vr(),PROBE_UNKNOWN_ACTION:n(function(){return"@@redux/PROBE_UNKNOWN_ACTION"+vr()},"PROBE_UNKNOWN_ACTION")};function Wi(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}n(Wi,"isPlainObject");function Or(t,e,r){var o;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if(typeof e=="function"&&typeof r=="undefined"&&(r=e,e=void 0),typeof r!="undefined"){if(typeof r!="function")throw new Error("Expected the enhancer to be a function.");return r(Or)(t,e)}if(typeof t!="function")throw new Error("Expected the reducer to be a function.");var s=t,i=e,c=[],a=c,l=!1;function d(){a===c&&(a=c.slice())}n(d,"ensureCanMutateNextListeners");function h(){if(l)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}n(h,"getState");function p(f){if(typeof f!="function")throw new Error("Expected the listener to be a function.");if(l)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var x=!0;return d(),a.push(f),n(function(){if(!!x){if(l)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");x=!1,d();var y=a.indexOf(f);a.splice(y,1),c=null}},"unsubscribe")}n(p,"subscribe");function m(f){if(!Wi(f))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(typeof f.type=="undefined")throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(l)throw new Error("Reducers may not dispatch actions.");try{l=!0,i=s(i,f)}finally{l=!1}for(var x=c=a,w=0;w<x.length;w++){var y=x[w];y()}return f}n(m,"dispatch");function _(f){if(typeof f!="function")throw new Error("Expected the nextReducer to be a function.");s=f,m({type:ze.REPLACE})}n(_,"replaceReducer");function b(){var f,x=p;return f={subscribe:n(function(y){if(typeof y!="object"||y===null)throw new TypeError("Expected the observer to be an object.");function C(){y.next&&y.next(h())}n(C,"observeState"),C();var L=x(C);return{unsubscribe:L}},"subscribe")},f[Tr]=function(){return this},f}return n(b,"observable"),m({type:ze.INIT}),o={dispatch:m,subscribe:p,getState:h,replaceReducer:_},o[Tr]=b,o}n(Or,"createStore");function Yi(t,e){var r=e&&e.type,o=r&&'action "'+String(r)+'"'||"an action";return"Given "+o+', reducer "'+t+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}n(Yi,"getUndefinedStateErrorMessage");function Ji(t){Object.keys(t).forEach(function(e){var r=t[e],o=r(void 0,{type:ze.INIT});if(typeof o=="undefined")throw new Error('Reducer "'+e+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:ze.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error('Reducer "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle "+ze.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}n(Ji,"assertReducerShape");function bt(t){for(var e=Object.keys(t),r={},o=0;o<e.length;o++){var s=e[o];typeof t[s]=="function"&&(r[s]=t[s])}var i=Object.keys(r),c,a;try{Ji(r)}catch(l){a=l}return n(function(d,h){if(d===void 0&&(d={}),a)throw a;if(!1)var p;for(var m=!1,_={},b=0;b<i.length;b++){var f=i[b],x=r[f],w=d[f],y=x(w,h);if(typeof y=="undefined"){var C=Yi(f,h);throw new Error(C)}_[f]=y,m=m||y!==w}return m=m||i.length!==Object.keys(d).length,m?_:d},"combination")}n(bt,"combineReducers");function rn(t,e){return function(){return e(t.apply(this,arguments))}}n(rn,"bindActionCreator");function on(t,e){if(typeof t=="function")return rn(t,e);if(typeof t!="object"||t===null)throw new Error("bindActionCreators expected an object or a function, instead received "+(t===null?"null":typeof t)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var r={};for(var o in t){var s=t[o];typeof s=="function"&&(r[o]=rn(s,e))}return r}n(on,"bindActionCreators");function Qi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n(Qi,"_defineProperty");function nn(t,e){var r=Object.keys(t);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(t)),e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r}n(nn,"ownKeys");function Ki(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?nn(r,!0).forEach(function(o){Qi(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nn(r).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}n(Ki,"_objectSpread2");function wr(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(o){return o}:e.length===1?e[0]:e.reduce(function(o,s){return function(){return o(s.apply(void 0,arguments))}})}n(wr,"compose");function sn(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(o){return function(){var s=o.apply(void 0,arguments),i=n(function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},"dispatch"),c={getState:s.getState,dispatch:n(function(){return i.apply(void 0,arguments)},"dispatch")},a=e.map(function(l){return l(c)});return i=wr.apply(void 0,a)(s.dispatch),Ki({},s,{dispatch:i})}}}n(sn,"applyMiddleware");function an(t){var e=n(function(o){var s=o.dispatch,i=o.getState;return function(c){return function(a){return typeof a=="function"?a(s,i,t):c(a)}}},"middleware");return e}n(an,"createThunkMiddleware");var cn=an();cn.withExtraArgument=an;var ln=cn;var Kn=ee(Et());N();V();var st="OG_STATE",Zn=n(t=>{try{return t===null?void 0:JSON.parse(t)}catch{return}},"safeParseState"),jr=n(()=>window.og&&window.og.previewMode,"isPreviewMode"),Xn=n(()=>jr()?{}:Zn(localStorage.getItem(st)),"loadState"),Xa=n(t=>!t||!t.sessionId?!1:JSON.stringify({sessionId:t.sessionId,optedin:t.optedin,optedout:t.optedout,productOffer:t.productOffer,firstOrderPlaceDate:t.firstOrderPlaceDate,productToSubscribe:t.productToSubscribe}),"serializeState"),es=n(t=>{if(jr())return;let e=Xa(t);e&&localStorage.getItem(st)!==e&&localStorage.setItem(st,e)},"saveState"),ts=n(t=>(0,Kn.throttle)(500,e=>{if(jr())return;let{key:r,newValue:o}=e;r===st&&o===null?(t.dispatch({type:te}),setTimeout(()=>t.dispatch(Yt()),0)):r===st&&t.dispatch({type:fe,newValue:Zn(o)})}),"listenLocalStorageChanges");var os=ee(Et());V();function ec(t,e){return t===e}n(ec,"defaultEqualityCheck");function tc(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}n(tc,"areArgumentsShallowlyEqual");function rc(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ec,r=null,o=null;return function(){return tc(e,r,arguments)||(o=t.apply(null,arguments)),r=arguments,o}}n(rc,"defaultMemoize");function oc(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}n(oc,"getDependencies");function nc(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),c=0;c<s;c++)i[c]=arguments[c];var a=0,l=i.pop(),d=oc(i),h=t.apply(void 0,[function(){return a++,l.apply(null,arguments)}].concat(r)),p=t(function(){for(var m=[],_=d.length,b=0;b<_;b++)m.push(d[b].apply(null,arguments));return h.apply(null,m)});return p.resultFunc=l,p.dependencies=d,p.recomputations=function(){return a},p.resetRecomputations=function(){return a=0},p}}n(nc,"createSelectorCreator");var qe=nc(rc);var be=ee(Ke());ne();be.default.Cache=Map;function sc(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}n(sc,"arraysEqual");var A=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))||sc((t.components||[]).sort(),(e.components||[]).sort()))),"isSameProduct"),Jt=n(t=>t.optedin||[],"optedinSelector"),rs=n(t=>t.optedout||[],"optedoutSelector"),Mr=n(t=>t.autoshipByDefault||{},"autoshipSelector"),ic=n(t=>t.defaultFrequencies||{},"defaultFrequenciesSelector"),Q=(0,be.default)(t=>qe(Jt,rs,Mr,(e,r,o)=>{let s=e.find(i=>A(t,i));return s||(r.find(i=>A(t,i))?!1:t&&o[t.id]?{id:t.id}:!1)}),t=>JSON.stringify(t)),Qt=(0,be.default)(t=>qe(Jt,e=>{let r=e.find(o=>A(t,o));return r||!1}),t=>JSON.stringify(t)),Kt=(0,be.default)(t=>qe(rs,e=>e.find(r=>A(t,r))));var z=(0,be.default)(t=>qe(Q(t),e=>e&&e.frequency||null)),Zt=(0,be.default)(t=>qe(ic,e=>e[t]&&tt(e[t])||null)),Vr=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(Vr(r))&&e[r]||e.offer&&typeof(e.offer[r]!=="undefined")&&e.offer[r]||o}),"configSelector"),De=n(t=>({templates:t.templates||[]}),"templatesSelector");var ac=n((t,e,r=document)=>r.dispatchEvent(new CustomEvent(t,{detail:e})),"dispatchEvent"),ns=n(t=>({payload:{product:{id:e,components:r}={}}={}}={})=>setTimeout(()=>ac("optin-changed",{productId:e,components:r,optedIn:t}),0),"dispatchOptinChangedEvent"),cc=[{expressions:[({type:t}={})=>t===I,({type:t}={})=>t===q],fn:ns(!0)},{expressions:[({type:t}={})=>t===U],fn:ns(!1)}],ss=n(t=>e=>r=>{let o=t.getState();cc.forEach(s=>{s.expressions.some(i=>i(r,o))&&s.fn(r)}),e(r)},"dispatchMiddleware"),is=n(t=>e=>r=>{var s;let o;switch(r.type){case P:case U:case I:case q:o=new CustomEvent(`og-${r.type.toLowerCase().replace(/_/g,"-")}`,{bubbles:!0,cancelable:!0,detail:r.payload}),(((s=r.payload)==null?void 0:s.offer)||document).dispatchEvent(o);break;default:}(o==null?void 0:o.defaultPrevented)||e(r)},"offerEvents"),as=n(t=>e=>r=>{e(r);let o=(0,os.throttle)(500,()=>{es({...t.getState()})});r.type!==fe&&o()},"localStorageMiddleware");function cs(t,...e){if(window.og&&window.og.store)return window.og.store;let r=window.og&&window.og.previewMode,o=typeof window=="object"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):wr,s=[ln,ss,is],i={};if(!r)try{i=Xn(),s.push(as)}catch{}let c=o(sn(...s,...e)),a=Or(t,i,c);return window.og=window.og||{},window.og.store=a,a}n(cs,"makeStore");var lc=Object.defineProperty,Xt=n((t,e)=>lc(t,"name",{value:e,configurable:!0}),"i"),uc=Xt(t=>e=>t.indexOf(e.origin)>=0,"createIsMessageAllowed"),ls=["https://rc3.ordergroove.com","https://rc3.stg.ordergroove.com","http://localhost:3000",window.location.origin],us=Xt(t=>(e,r)=>{ls.forEach(o=>t.postMessage({ogType:e,...r},o))},"createBroadcastMessage");function $r(t=window.opener,e=window.og){let r=Xt(o=>{let s=uc(ls),i=us(o.source),c=o.data.options||{};if(s(o)&&o.data.ogType==="READY"){let a="//static.ordergroove.com/@ordergroove/offers-live-editor/0.6.1-alpha-PR-605-3.33+53158044/dist/";a.startsWith("//")&&(a=window.location.protocol+a),a.endsWith("/")||(a+="/"),import(`${a}client.js`).then(({initializeClient:l})=>{l({isMessageAllowed:s,broadcastMessage:i,options:c,og:e}),window.removeEventListener("message",r)})}},"handleReady");t&&t!==window&&(window.addEventListener("message",r),us(t)("READY"))}n($r,"f");Xt($r,"offersLiveEditor");var er=null,pc=n(t=>({dispatch:t}),"defaultMapDispatchToProps"),ps=n(t=>{if(!er)throw new Error("Missing redux store.");return er},"resolveStore"),dc=n((t,e)=>r=>{let{getState:o,dispatch:s}=ps(r),i=t?t(o(),r):{},c=e(s,r);Object.assign(r,i,c)},"createRecalcProps"),g=n((t,e=pc)=>r=>{let s=dc(t,typeof e=="function"?e:i=>on(e,i));return class extends r{get store(){return er}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=ps(this).subscribe(()=>s(this)),s(this)}attributeChangedCallback(i,c,a){super.attributeChangedCallback&&super.attributeChangedCallback(i,c,a),this._storeUnsubscribe&&c!==a&&s(this)}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}}},"connect"),ds=n(t=>{er=t},"setStore");ne();var Hr=n((t={},e=[])=>(t.optedin||[]).map(r=>{let o={product:r.id,subscription_info:{components:r.components||[]},tracking_override:{offer:((t.productOffer||{})[r.id]||[])[0],...et(r.frequency)}};return t.firstOrderPlaceDate&&t.firstOrderPlaceDate[r.id]&&(o.subscription_info.first_order_place_date=t.firstOrderPlaceDate[r.id]),t.productToSubscribe&&t.productToSubscribe[r.id]&&(o.tracking_override.product=t.productToSubscribe[r.id]),o}).filter(r=>r.tracking_override.offer).filter(r=>e.length?e.includes(r.product):r),"getProductsForPurchasePost");N();O();var Ys=ee(Ms());O();var Ac=n(t=>{let e=String(t||"").trim().match(/(\d+)\s*([dwm])/);return e?`${e[1]}_${{d:1,w:2,m:3}[e[2]]}`:t},"sanitizeFrequencyString"),Vs=n(t=>t.hasAttribute("product")&&{id:t.getAttribute("product"),...t.hasAttribute("product-components")&&{components:JSON.parse(t.getAttribute("product-components"))}},"buildProduct");var fo=n(t=>{let e=Vs(t);if(!e){let r=t.offer;r&&(e=Vs(r))}return e},"resolveProduct"),Nc=n(t=>{let e=t;for(;e;){if(e.tagName==="OG-OFFER")return e;e=e.nodeType===11?e.host:e.parentNode}},"resolveOffer"),ho=n(t=>class extends t{get offer(){return Nc(this)}connectedCallback(){super.connectedCallback(),this.offersChangeTemplate=this.offersChangeTemplate.bind(this),this.offer&&this.offer.addEventListener("template-changed",this.offersChangeTemplate)}disconnectedCallback(){super.disconnectedCallback(),this.offer&&this.offer.removeEventListener("template-changed",this.offersChangeTemplate)}offersChangeTemplate(){this._enqueueUpdate()}},"withOfferTemplate"),k=n(t=>class extends ho(t){get product(){return fo(this)}},"withProduct"),hr=n(t=>class extends t{get childOptions(){let e=[],r=null;return this.querySelectorAll("option").forEach(o=>{let s=Ac(o.value),i=o.innerText.trim();e.push({value:s,text:i}),!r&&o.selected&&(r=s)}),{options:e,isSelected:r}}},"withChildOptions");var mr={};xr(mr,{autoshipByDefault:()=>kc,eligibilityGroups:()=>Gs,eligible:()=>$s,hasUpcomingOrder:()=>zs,hasUpsellGroup:()=>Bs,inStock:()=>mo,optedout:()=>Uc,regularEligible:()=>Dc,subscribed:()=>Ic,subscriptionEligible:()=>Hs,upcomingOrderContainsProduct:()=>qc,upsellEligible:()=>Ws});var mo=n((t,e)=>(t.inStock||{})[(e.product||{}).id],"inStock"),$s=n((t,e)=>(t.autoshipEligible||{})[(e.product||{}).id]||!1,"eligible"),kc=n((t,e)=>(t.autoshipByDefault||{})[(e.product||{}).id]||!1,"autoshipByDefault"),Hs=n((t,e)=>(t.offerId&&t.offerId!=="0"||!1)&&$s(t,e)&&mo(t,e),"subscriptionEligible"),Gs=n((t,e)=>(t.eligibilityGroups||{})[(e.product||{}).id]||null,"eligibilityGroups"),Bs=n((t,e)=>{let r=Gs(t,e);return r===null||!!r.find(o=>o==="upsell"||o==="impulse_upsell")},"hasUpsellGroup"),Ic=n((t,e)=>Qt(e.product)(t),"subscribed"),Uc=n((t,e)=>Kt(e.product)(t),"optedout"),zs=n(t=>!!(t.nextUpcomingOrder&&t.nextUpcomingOrder.public_id),"hasUpcomingOrder"),qc=n((t,e)=>(t.nextUpcomingOrder&&t.nextUpcomingOrder.products||[]).includes((e.product||{}).id),"upcomingOrderContainsProduct"),Ws=n((t,e)=>!e.offer.isCart&&t.offerId&&t.offerId!=="0"&&t.auth&&mo(t,e)&&zs(t)&&Bs(t,e),"upsellEligible"),Dc=n((t,e)=>Hs(t,e)&&!Ws(t,e),"regularEligible");var Fc=n(t=>t.replace(/(\r\n|\n|\r|\s)+/gm,""),"removeWhitespace"),go=class extends k(T){static get properties(){return{...super.properties,state:{type:Object,attribute:!1},test:{type:String}}}render(){return this.test&&Ys.default.parse(Fc(this.test),r=>mr[r]&&mr[r](this.state,this))?u`
|
|
111
111
|
<slot></slot>
|
|
112
112
|
`:u``}shouldUpdate(e){return e.size&&this.product&&this.product.id in this.state.autoshipEligible&&this.product.id in this.state.inStock}};n(go,"When");var Lc=n(t=>({state:t}),"mapStateToProps"),Js=g(Lc)(go);O();N();O();ne();var Qs={type:Object,converter:{toAttribute(t){return t==null?t:JSON.stringify(t)},fromAttribute(t){return t&&t.match(/[{[]/)?JSON.parse(t):{id:t}}}},pe={type:String,attribute:"default-frequency",converter:{fromAttribute(t){return t&&Ir(t)?t:null}}},gr={type:Boolean,attribute:!0,reflect:!0},Ve={type:Object,attribute:!1};O();var jc=n(t=>class extends t{getOption(e,r=e){let o=Vr(e);if(this.hasAttribute(o)){let s=this.getAttribute(o);return s.toString().toLowerCase()==="true"?!0:s.toString().toLowerCase()==="false"?!1:s}if(this.template&&this.template.config&&typeof this.template.config[r]!="undefined")return this.template.config[r];if(this.config&&typeof this.config[r]!="undefined")return this.config[r]}applyTemplate(e){this.template=e;let r=typeof e.markup=="undefined"?this.constructor.initialTemplate:e.markup;r&&this._templateMarkup!==r&&(this._templateMarkup=r,this.innerHTML=r)}refreshTemplate(){if(this._templates&&this._templates.length){let e=this._templates.find(({selector:r})=>{try{return this.matches(r)}catch{return!1}});this.applyTemplate(e||{})}}set templates(e){this._templates=e,this.refreshTemplate()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.constructor.initialTemplate&&!this.innerHTML.trim()&&(this.innerHTML=this.constructor.initialTemplate)}},"withTemplate"),M=jc(T);var B=class extends k(M){static get properties(){return{subscribed:gr,frequencyMatch:{type:Boolean,reflect:!0,attribute:"frequency-match"}}}static get styles(){return v`
|
|
113
113
|
:host {
|