@ordergroove/offers 2.25.2 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/offers.js CHANGED
@@ -8,8 +8,8 @@ else {
8
8
  window.og['offers'] = factory();
9
9
  }
10
10
  })(()=>{
11
- var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.defineProperties,di=Object.getOwnPropertyDescriptor,fi=Object.getOwnPropertyDescriptors,hi=Object.getOwnPropertyNames,xo=Object.getOwnPropertySymbols,mi=Object.getPrototypeOf,Eo=Object.prototype.hasOwnProperty,gi=Object.prototype.propertyIsEnumerable;var So=(t,e,r)=>e in t?xe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,l=(t,e)=>{for(var r in e||(e={}))Eo.call(e,r)&&So(t,r,e[r]);if(xo)for(var r of xo(e))gi.call(e,r)&&So(t,r,e[r]);return t},h=(t,e)=>pi(t,fi(e)),vo=t=>xe(t,"__esModule",{value:!0}),n=(t,e)=>xe(t,"name",{value:e,configurable:!0}),ne=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var w=(t,e)=>()=>(t&&(e=t(t=0)),e);var se=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),nr=(t,e)=>{vo(t);for(var r in e)xe(t,r,{get:e[r],enumerable:!0})},yi=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of hi(e))!Eo.call(t,o)&&o!=="default"&&xe(t,o,{get:()=>e[o],enumerable:!(r=di(e,o))||r.enumerable});return t},Ee=t=>yi(vo(xe(t!=null?ui(mi(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var ie,ae,ce,at,jo,D,Le,ct,lt,Mo,ut,ve,Vo,pt,dt,$o,ft,ht,mt,Bo,Ho,gt,zo,yt,we,Go,bt,_t,je,Me,xt,Et,le,Y,St,vt,wt,ue=w(()=>{ie="OPTIN_PRODUCT",ae="OPTOUT_PRODUCT",ce="PRODUCT_CHANGE_FREQUENCY",at="SET_MERCHANT_ID",jo="REQUEST_OFFER",D="RECEIVE_OFFER",Le="PRODUCT_HAS_CHANGED",ct="CREATED_SESSION_ID",lt="SET_AUTH_URL",Mo="REQUEST_AUTH",ut="AUTHORIZE",ve="UNAUTHORIZED",Vo="REQUEST_ORDERS",pt="RECEIVE_ORDERS",dt="RECEIVE_ORDER_ITEMS",$o="FETCH_RESPONSE_ERROR",ft="SET_ENVIRONMENT_STAGING",ht="SET_ENVIRONMENT_DEV",mt="SET_ENVIRONMENT_PROD",Bo="CONCLUDE_UPSELL",Ho="REQUEST_CREATE_IU_ORDER",gt="CREATE_ONE_TIME",zo="REQUEST_CONVERT_ONE_TIME",yt="CONVERT_ONE_TIME",we="CHECKOUT",Go="RECEIVE_FETCH",bt="SET_LOCALE",_t="SET_CONFIG",je="SET_PREVIEW_STANDARD_OFFER",Me="SET_PREVIEW_UPSELL_OFFER",xt="ADD_TEMPLATE",Et="SET_TEMPLATES",le="LOCAL_STORAGE_CHANGE",Y="LOCAL_STORAGE_CLEAR",St="SET_FIRST_ORDER_PLACE_DATE",vt="SET_PRODUCT_TO_SUBSCRIBE",wt="RECEIVE_PRODUCT_PLANS"});var Ct=se((bl,en)=>{var $i="Expected a function",Wo="__lodash_hash_undefined__",Bi="[object Function]",Hi="[object GeneratorFunction]",zi=/[\\^$.*+?()[\]{}|]/g,Gi=/^\[object .+?Constructor\]$/,Wi=typeof window=="object"&&window&&window.Object===Object&&window,Yi=typeof self=="object"&&self&&self.Object===Object&&self,Yo=Wi||Yi||Function("return this")();function Qi(t,e){return t==null?void 0:t[e]}n(Qi,"getValue");function Ji(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch(r){}return e}n(Ji,"isHostObject");var Ki=Array.prototype,Zi=Function.prototype,Qo=Object.prototype,dr=Yo["__core-js_shared__"],Jo=function(){var t=/[^.]+$/.exec(dr&&dr.keys&&dr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ko=Zi.toString,fr=Qo.hasOwnProperty,Xi=Qo.toString,ea=RegExp("^"+Ko.call(fr).replace(zi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ta=Ki.splice,ra=Zo(Yo,"Map"),Ve=Zo(Object,"create");function pe(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var o=t[e];this.set(o[0],o[1])}}n(pe,"Hash");function oa(){this.__data__=Ve?Ve(null):{}}n(oa,"hashClear");function na(t){return this.has(t)&&delete this.__data__[t]}n(na,"hashDelete");function sa(t){var e=this.__data__;if(Ve){var r=e[t];return r===Wo?void 0:r}return fr.call(e,t)?e[t]:void 0}n(sa,"hashGet");function ia(t){var e=this.__data__;return Ve?e[t]!==void 0:fr.call(e,t)}n(ia,"hashHas");function aa(t,e){var r=this.__data__;return r[t]=Ve&&e===void 0?Wo:e,this}n(aa,"hashSet");pe.prototype.clear=oa;pe.prototype.delete=na;pe.prototype.get=sa;pe.prototype.has=ia;pe.prototype.set=aa;function Te(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(Te,"ListCache");function ca(){this.__data__=[]}n(ca,"listCacheClear");function la(t){var e=this.__data__,r=Ot(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():ta.call(e,r,1),!0}n(la,"listCacheDelete");function ua(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]}n(ua,"listCacheGet");function pa(t){return Ot(this.__data__,t)>-1}n(pa,"listCacheHas");function da(t,e){var r=this.__data__,o=Ot(r,t);return o<0?r.push([t,e]):r[o][1]=e,this}n(da,"listCacheSet");Te.prototype.clear=ca;Te.prototype.delete=la;Te.prototype.get=ua;Te.prototype.has=pa;Te.prototype.set=da;function de(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(de,"MapCache");function fa(){this.__data__={hash:new pe,map:new(ra||Te),string:new pe}}n(fa,"mapCacheClear");function ha(t){return Tt(this,t).delete(t)}n(ha,"mapCacheDelete");function ma(t){return Tt(this,t).get(t)}n(ma,"mapCacheGet");function ga(t){return Tt(this,t).has(t)}n(ga,"mapCacheHas");function ya(t,e){return Tt(this,t).set(t,e),this}n(ya,"mapCacheSet");de.prototype.clear=fa;de.prototype.delete=ha;de.prototype.get=ma;de.prototype.has=ga;de.prototype.set=ya;function Ot(t,e){for(var r=t.length;r--;)if(Sa(t[r][0],e))return r;return-1}n(Ot,"assocIndexOf");function ba(t){if(!Xo(t)||xa(t))return!1;var e=va(t)||Ji(t)?ea:Gi;return e.test(Ea(t))}n(ba,"baseIsNative");function Tt(t,e){var r=t.__data__;return _a(e)?r[typeof e=="string"?"string":"hash"]:r.map}n(Tt,"getMapData");function Zo(t,e){var r=Qi(t,e);return ba(r)?r:void 0}n(Zo,"getNative");function _a(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}n(_a,"isKeyable");function xa(t){return!!Jo&&Jo in t}n(xa,"isMasked");function Ea(t){if(t!=null){try{return Ko.call(t)}catch(e){}try{return t+""}catch(e){}}return""}n(Ea,"toSource");function hr(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError($i);var r=n(function(){var o=arguments,s=e?e.apply(this,o):o[0],i=r.cache;if(i.has(s))return i.get(s);var a=t.apply(this,o);return r.cache=i.set(s,a),a},"memoized");return r.cache=new(hr.Cache||de),r}n(hr,"memoize");hr.Cache=de;function Sa(t,e){return t===e||t!==t&&e!==e}n(Sa,"eq");function va(t){var e=Xo(t)?Xi.call(t):"";return e==Bi||e==Hi}n(va,"isFunction");function Xo(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}n(Xo,"isObject");en.exports=hr});var Pt,mr,$e,Be,Rt,tn,rn,wa,Oa,Ta,Ca,Pa,He,gr,Ra,on,ze,Aa,Q,J=w(()=>{Pt=Ee(Ct()),mr=n((...t)=>JSON.stringify(t),"memoizeKey"),$e=n(t=>(...e)=>fetch(...t(...e)).then(r=>r.json()),"withFetchJson"),Be=n(t=>(e,...r)=>{if(!e)throw Error("host required");let[o,s={}]=t(...r);return[`${e.replace(/\/+$/,"")}${o}`,s]},"withHost"),Rt=n(t=>(e,...r)=>{if(!e)throw Error("auth required");let[o,s={}]=t(...r);return[o,h(l({},s),{headers:l({Authorization:JSON.stringify(e)},s.headers)})]},"withAuth"),tn=n(t=>(...e)=>{let[r,o={}]=t(...e);return[r,h(l({method:"POST"},o),{body:JSON.stringify(o.body),headers:l({"Content-type":"application/json"},o.headers)})]},"withJsonBody"),rn=n((t=[])=>(Array.isArray(t)?t:Object.entries(t)).map(([e,r])=>[e,encodeURIComponent(r)].join("=")).join("&"),"toQuery"),wa=n(t=>JSON.stringify([].concat(t).map(e=>typeof e=="object"?e.id:e).filter(e=>e)),"toProductId"),Oa=(0,Pt.default)($e(Be((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=rn([["session_id",e],["page_type",1],["p",wa(r)],["module_view",JSON.stringify(["regular"])]]);return[`/offer/${t}/${o}?${s}`]})),mr),Ta=(0,Pt.default)($e(Be(Rt((t=1,e="place")=>[`/orders/?${rn([["status",t],["ordering",e]])}`]))),mr),Ca=(0,Pt.default)($e(Be(Rt(t=>{if(!t)throw Error("orderId required");return[`/items/?order=${t}`]}))),mr),Pa=$e(Be(Rt(tn((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}}]})))),He=n(t=>{if(typeof t=="object")return l({},t);let[e,r]=(t||"").split(/_/).map(o=>parseInt(o,10));return e&&r&&{every:e,every_period:r}},"parseFrequency"),gr=n(t=>t.match(/^\d+_\d$/),"isFrequencyValid"),Ra=n((t,e)=>String.prototype.localeCompare.call(t&&t.split("_").reverse().join("_"),e&&e.split("_").reverse().join("_")),"compareFrequencies"),on=n(t=>[...new Set(t&&t.split(/\s+/))].filter(gr).sort(Ra),"parseFrequenciesList"),ze=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"),Aa=$e(Be(Rt(tn((t,e,r)=>{if(!t)throw Error("item required");if(!e)throw Error("frequency required");let o=He(e);if(!o)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:l({item:t.public_id,offer:r},o)}]})))),Q={fetchOffer:Oa,fetchOrders:Ta,fetchItems:Ca,createOneTime:Pa,convertOneTimeToSubscription:Aa}});var xr=se((kt,un)=>{(function(t,e){typeof kt=="object"&&typeof un!="undefined"?e(kt):typeof define=="function"&&define.amd?define(["exports"],e):(t=t||self,e(t.throttleDebounce={}))})(kt,function(t){"use strict";function e(o,s,i,a){var c,u=!1,f=0;function b(){c&&clearTimeout(c)}n(b,"clearExistingTimeout");function d(){b(),u=!0}n(d,"cancel"),typeof s!="boolean"&&(a=i,i=s,s=void 0);function y(){for(var v=arguments.length,_=new Array(v),m=0;m<v;m++)_[m]=arguments[m];var C=this,P=Date.now()-f;if(u)return;function x(){f=Date.now(),i.apply(C,_)}n(x,"exec");function A(){c=void 0}n(A,"clear"),a&&!c&&x(),b(),a===void 0&&P>o?x():s!==!0&&(c=setTimeout(a?A:x,a===void 0?o-P:o))}return n(y,"wrapper"),y.cancel=d,y}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"?It(window.og_auth):null}async function ic(t=100){return new Promise(e=>{setTimeout(()=>e(dn()),t)})}async function fn(t,e=oc,r=nc){let o;if(o=It(dn())||It(e()),o)return o;if(t&&typeof t=="string"){let s=await fetch(t);s.status>=200&&s.status<300&&(o=e()||await(sc(s)?s.json():Promise.resolve(r(t)).then(e)))}else o||(o=await ic());if(o=It(o),o)return o;throw new Error("Unauthorized")}var pn,oc,It,nc,sc,hn=w(()=>{pn=/^og_auth=/,oc=n((t=pn)=>(document.cookie.split(/;\s*/).find(e=>e.match(t))||"").replace(pn,""),"c"),It=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"),nc=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"),sc=n(t=>(t.headers.get("content-type")||"").indexOf("application/json")!==-1,"d");n(dn,"a");n(ic,"f");n(fn,"u")});var K,Pe,mn,qt,gn,yn,ac,cc,Er,Z,bn,Ut,_n,lc,Sr,vr,Dt,wr,Ft,Re,Or,uc,xn,En,pc,dc,fc,hc,Sn,vn,wn,On,Tn,Cn,Pn,I=w(()=>{hn();ue();J();K=n((t,e)=>({type:ie,payload:{product:t,frequency:e}}),"optinProduct"),Pe=n(t=>({type:ae,payload:{product:t}}),"optoutProduct"),mn=n((t,e)=>({type:Le,payload:{newProduct:t,product:e}}),"productHasChangedComponents"),qt=n((t,e)=>({type:ce,payload:{product:t,frequency:e}}),"productChangeFrequency"),gn=n(t=>({type:Bo,payload:{product:t}}),"concludeUpsell"),yn=n(t=>({type:at,payload:t}),"setMerchantId"),ac=n(t=>({type:ct,payload:`${t}.${Math.floor(Math.random()*999999)}.${Math.round(new Date().getTime()/1e3)}`}),"createSessionId"),cc=n(t=>({type:Mo,payload:t}),"requestAuth"),Er=n((t,e,r,o)=>({type:ut,payload:{public_id:t,sig_field:e,ts:r,sig:o}}),"authorize"),Z=n(t=>({type:ve,payload:t}),"unauthorized"),bn=n(t=>({type:lt,payload:t}),"setAuthUrl"),Ut=n(t=>({type:Go,payload:t}),"fetchDone"),_n=n((t=fn)=>n(function(r,o){if(window.og&&window.og.previewMode)return r(Z({message:"Offers are running in preview mode"}));let{merchantId:s,authUrl:i}=o(),a=cc(i);return r(a),t(i).then(({sig_field:c,ts:u,sig:f})=>r(Er(s,c,u,f)),c=>r(Z(c))).finally(()=>r(Ut(a)))},"fetchAuthThunk"),"fetchAuth"),lc=n((t,e)=>({type:Vo,payload:{status:t,ordering:e}}),"requestOrders"),Sr=n(t=>({type:pt,payload:t}),"receiveOrders"),vr=n(t=>({type:dt,payload:t}),"receiveItems"),Dt=n((t=1,e="place")=>n(function(o,s){let{environment:{legoUrl:i},auth:a}=s();if(!a)return o(Z("No auth set."));let c=lc(t,e);return o(c),Q.fetchOrders(i,a,t,e).then(u=>{if(u.results){o(Sr(u));let f=(u.results[0]||{}).public_id;if(f)return Q.fetchItems(i,a,f).then(b=>o(vr(b)))}return o(Z(u.detail)),null},u=>o(Z(u))).finally(()=>o(Ut(c)))},"fetchOrdersThunk"),"fetchOrders"),wr=n(t=>{switch(t){case"dev":return{type:ht,payload:t};case"staging":return{type:ft,payload:t};case"prod":return{type:mt,payload:t};default:throw new Error(`${t} is not a supported environment`)}},"setEnvironment"),Ft=n(()=>(t,e)=>{let{merchantId:r,sessionId:o}=e();return(!o||r&&!o.startsWith(r))&&t(ac(r)),o},"requestSessionId"),Re=n(t=>({type:D,payload:t}),"receiveOffer"),Or=n(t=>({type:$o,payload:t}),"fetchResponseError"),uc=n((t,e="pdp")=>({type:jo,payload:{product:t,module:e}}),"requestOffer"),xn=n((t,e="pdp")=>n(function(o,s){let{merchantId:i,sessionId:a,environment:{apiUrl:c}}=s(),u=uc(t,e);return o(u),Q.fetchOffer(c,i,a,t,e).then(f=>o(Re(f)),f=>o(Or(f))).finally(()=>o(Ut(u)))},"fetchOfferThunk"),"fetchOffer"),En=n(()=>({type:we}),"checkout"),pc=n((t,e,r,o)=>({type:Ho,payload:{product:t,order:e,quantity:r,offerId:o}}),"requestCreateOneTime"),dc=n(t=>({type:gt,payload:t}),"receiveCreateOneTime"),fc=n((t,e)=>({type:zo,payload:{item:t,frequency:e}}),"requestConvertOneTimeToSubscription"),hc=n((t,e)=>({type:yt,payload:{response:t,product:e}}),"receiveConvertOneTime"),Sn=n((t,e,r,o=!1,s=null)=>n(function(a,c){let{auth:u,environment:{legoUrl:f},previewUpsellOffer:b,offerId:d}=c();if(!u)return a(Z("No auth set."));let y=pc(t,e,r,d);return a(y),(b?Promise.resolve({legoUrl:f,product:t,order:e,quantity:r,offer:d}):Q.createOneTime(f,u,t.id,e,r,d)).then(v=>(a(dc(v)),o?(a(fc(v,s)),(b?Promise.resolve({item:v,frequency:s}):Q.convertOneTimeToSubscription(f,u,v,s,d)).then(_=>a(hc(_,t)),_=>a(Or(_)))):v),v=>a(Or(v))).finally(()=>a(Ut(y)))},"createIuThunk"),"createIu"),vn=n(t=>({type:bt,payload:t}),"setLocale"),wn=n(t=>({type:_t,payload:t}),"setConfig"),On=n((t,e,r)=>({type:xt,payload:{selector:t,markup:e,config:r}}),"addTemplate"),Tn=n(t=>({type:Et,payload:t}),"setTemplates"),Cn=n((t,e)=>({type:St,payload:{product:t,firstOrderPlaceDate:e}}),"setFirstOrderPlaceDate"),Pn=n((t,e)=>({type:vt,payload:{product:t,productToSubscribe:e}}),"setProductToSubscribe")});var Pr,he,me=w(()=>{Pr=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,he=n((t,e,r=null)=>{for(;e!==r;){let o=e.nextSibling;t.removeChild(e),e=o}},"removeNodes")});var F,Rr,jn,Ae,ge,Mn,We,$,Lt,X=w(()=>{F=`{{lit-${String(Math.random()).slice(2)}}}`,Rr=`<!--${F}-->`,jn=new RegExp(`${F}|${Rr}`),Ae="$lit$",ge=class{constructor(e,r){this.parts=[],this.element=r;let o=[],s=[],i=document.createTreeWalker(r.content,133,null,!1),a=0,c=-1,u=0,{strings:f,values:{length:b}}=e;for(;u<b;){let d=i.nextNode();if(d===null){i.currentNode=s.pop();continue}if(c++,d.nodeType===1){if(d.hasAttributes()){let y=d.attributes,{length:v}=y,_=0;for(let m=0;m<v;m++)Mn(y[m].name,Ae)&&_++;for(;_-- >0;){let m=f[u],C=Lt.exec(m)[2],P=C.toLowerCase()+Ae,x=d.getAttribute(P);d.removeAttribute(P);let A=x.split(jn);this.parts.push({type:"attribute",index:c,name:C,strings:A}),u+=A.length-1}}d.tagName==="TEMPLATE"&&(s.push(d),i.currentNode=d.content)}else if(d.nodeType===3){let y=d.data;if(y.indexOf(F)>=0){let v=d.parentNode,_=y.split(jn),m=_.length-1;for(let C=0;C<m;C++){let P,x=_[C];if(x==="")P=$();else{let A=Lt.exec(x);A!==null&&Mn(A[2],Ae)&&(x=x.slice(0,A.index)+A[1]+A[2].slice(0,-Ae.length)+A[3]),P=document.createTextNode(x)}v.insertBefore(P,d),this.parts.push({type:"node",index:++c})}_[m]===""?(v.insertBefore($(),d),o.push(d)):d.data=_[m],u+=m}}else if(d.nodeType===8)if(d.data===F){let y=d.parentNode;(d.previousSibling===null||c===a)&&(c++,y.insertBefore($(),d)),a=c,this.parts.push({type:"node",index:c}),d.nextSibling===null?d.data="":(o.push(d),c--),u++}else{let y=-1;for(;(y=d.data.indexOf(F,y+1))!==-1;)this.parts.push({type:"node",index:-1}),u++}}for(let d of o)d.parentNode.removeChild(d)}};n(ge,"Template");Mn=n((t,e)=>{let r=t.length-e.length;return r>=0&&t.slice(r)===e},"endsWith"),We=n(t=>t.index!==-1,"isTemplatePartActive"),$=n(()=>document.createComment(""),"createMarker"),Lt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/});function Nr(t,e){let{element:{content:r},parts:o}=t,s=document.createTreeWalker(r,Ar,null,!1),i=Ye(o),a=o[i],c=-1,u=0,f=[],b=null;for(;s.nextNode();){c++;let d=s.currentNode;for(d.previousSibling===b&&(b=null),e.has(d)&&(f.push(d),b===null&&(b=d)),b!==null&&u++;a!==void 0&&a.index===c;)a.index=b!==null?-1:a.index-u,i=Ye(o,i),a=o[i]}f.forEach(d=>d.parentNode.removeChild(d))}function Vn(t,e,r=null){let{element:{content:o},parts:s}=t;if(r==null){o.appendChild(e);return}let i=document.createTreeWalker(o,Ar,null,!1),a=Ye(s),c=0,u=-1;for(;i.nextNode();)for(u++,i.currentNode===r&&(c=bc(e),r.parentNode.insertBefore(e,r));a!==-1&&s[a].index===u;){if(c>0){for(;a!==-1;)s[a].index+=c,a=Ye(s,a);return}a=Ye(s,a)}}var Ar,bc,Ye,$n=w(()=>{X();Ar=133;n(Nr,"removeNodesFromTemplate");bc=n(t=>{let e=t.nodeType===11?0:1,r=document.createTreeWalker(t,Ar,null,!1);for(;r.nextNode();)e++;return e},"countNodes"),Ye=n((t,e=-1)=>{for(let r=e+1;r<t.length;r++){let o=t[r];if(We(o))return r}return-1},"nextActiveIndexInTemplateParts");n(Vn,"insertNodeIntoTemplate")});var _c,ye,kr=w(()=>{_c=new WeakMap,ye=n(t=>typeof t=="function"&&_c.has(t),"isDirective")});var q,jt,Ir=w(()=>{q={},jt={}});var ee,Mt=w(()=>{me();X();ee=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=Pr?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),r=[],o=this.template.parts,s=document.createTreeWalker(e,133,null,!1),i=0,a=0,c,u=s.nextNode();for(;i<o.length;){if(c=o[i],!We(c)){this.__parts.push(void 0),i++;continue}for(;a<c.index;)a++,u.nodeName==="TEMPLATE"&&(r.push(u),s.currentNode=u.content),(u=s.nextNode())===null&&(s.currentNode=r.pop(),u=s.nextNode());if(c.type==="node"){let f=this.processor.handleTextExpression(this.options);f.insertAfterNode(u.previousSibling),this.__parts.push(f)}else this.__parts.push(...this.processor.handleAttributeExpressions(u,c.name,c.strings,this.options));i++}return Pr&&(document.adoptNode(e),customElements.upgrade(e)),e}};n(ee,"TemplateInstance")});var Bn,Ec,z,Vt=w(()=>{me();X();Bn=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),Ec=` ${F} `,z=class{constructor(e,r,o,s){this.strings=e,this.values=r,this.type=o,this.processor=s}getHTML(){let e=this.strings.length-1,r="",o=!1;for(let s=0;s<e;s++){let i=this.strings[s],a=i.lastIndexOf("<!--");o=(a>-1||o)&&i.indexOf("-->",a+1)===-1;let c=Lt.exec(i);c===null?r+=i+(o?Ec:Rr):r+=i.substr(0,c.index)+c[1]+c[2]+Ae+c[3]+F}return r+=this.strings[e],r}getTemplateElement(){let e=document.createElement("template"),r=this.getHTML();return Bn!==void 0&&(r=Bn.createHTML(r)),e.innerHTML=r,e}};n(z,"TemplateResult")});var $t,Bt,Ne,Qe,G,Je,Ke,Ht,Hn,Ze,Sc,zt=w(()=>{kr();me();Ir();Mt();Vt();X();$t=n(t=>t===null||!(typeof t=="object"||typeof t=="function"),"isPrimitive"),Bt=n(t=>Array.isArray(t)||!!(t&&t[Symbol.iterator]),"isIterable"),Ne=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 Qe(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"||!Bt(i))return i}let s="";for(let i=0;i<r;i++){s+=e[i];let a=o[i];if(a!==void 0){let c=a.value;if($t(c)||!Bt(c))s+=typeof c=="string"?c:String(c);else for(let u of c)s+=typeof u=="string"?u:String(u)}}return s+=e[r],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}};n(Ne,"AttributeCommitter");Qe=class{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==q&&(!$t(e)||e!==this.value)&&(this.value=e,ye(e)||(this.committer.dirty=!0))}commit(){for(;ye(this.value);){let e=this.value;this.value=q,e(this)}this.value!==q&&this.committer.commit()}};n(Qe,"AttributePart");G=class{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild($()),this.endNode=e.appendChild($())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=$()),e.__insert(this.endNode=$())}insertAfterPart(e){e.__insert(this.startNode=$()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;ye(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=q,r(this)}let e=this.__pendingValue;e!==q&&($t(e)?e!==this.value&&this.__commitText(e):e instanceof z?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):Bt(e)?this.__commitIterable(e):e===jt?(this.value=jt,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==null?"":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 ee&&this.value.template===r)this.value.update(e.values);else{let o=new ee(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 G(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){he(this.startNode.parentNode,e.nextSibling,this.endNode)}};n(G,"NodePart");Je=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(;ye(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=q,r(this)}if(this.__pendingValue===q)return;let e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=q}};n(Je,"BooleanAttributePart");Ke=class extends Ne{constructor(e,r,o){super(e,r,o);this.single=o.length===2&&o[0]===""&&o[1]===""}_createPart(){return new Ht(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}};n(Ke,"PropertyCommitter");Ht=class extends Qe{};n(Ht,"PropertyPart");Hn=!1;(()=>{try{let t={get capture(){return Hn=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}})();Ze=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(;ye(this.__pendingValue);){let i=this.__pendingValue;this.__pendingValue=q,i(this)}if(this.__pendingValue===q)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=Sc(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=q}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}};n(Ze,"EventPart");Sc=n(t=>t&&(Hn?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),"getOptions")});function qr(t){let e=be.get(t.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},be.set(t.type,e));let r=e.stringsArray.get(t.strings);if(r!==void 0)return r;let o=t.strings.join(F);return r=e.keyString.get(o),r===void 0&&(r=new ge(t,t.getTemplateElement()),e.keyString.set(o,r)),e.stringsArray.set(t.strings,r),r}var be,Gt=w(()=>{X();n(qr,"templateFactory");be=new Map});var te,Ur,Dr=w(()=>{me();zt();Gt();te=new WeakMap,Ur=n((t,e,r)=>{let o=te.get(e);o===void 0&&(he(e,e.firstChild),te.set(e,o=new G(Object.assign({templateFactory:qr},r))),o.appendInto(e)),o.setValue(t),o.commit()},"render")});var Wt,Fr,Lr=w(()=>{zt();Wt=class{handleAttributeExpressions(e,r,o,s){let i=r[0];return i==="."?new Ke(e,r.slice(1),o).parts:i==="@"?[new Ze(e,r.slice(1),s.eventContext)]:i==="?"?[new Je(e,r.slice(1),o)]:new Ne(e,r,o).parts}handleTextExpression(e){return new G(e)}};n(Wt,"DefaultTemplateProcessor");Fr=new Wt});var p,jr=w(()=>{Lr();Vt();Lr();kr();me();Ir();zt();Dr();Gt();Mt();Vt();X();typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");p=n((t,...e)=>new z(t,e,"html",Fr),"html")});var Gn,Yt,wc,Oc,Tc,Wn,Cc,Yn,Qn=w(()=>{me();$n();Dr();Gt();Mt();X();jr();Gn=n((t,e)=>`${t}--${e}`,"getTemplateCacheKey"),Yt=!0;typeof window.ShadyCSS=="undefined"?Yt=!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."),Yt=!1);wc=n(t=>e=>{let r=Gn(e.type,t),o=be.get(r);o===void 0&&(o={stringsArray:new WeakMap,keyString:new Map},be.set(r,o));let s=o.stringsArray.get(e.strings);if(s!==void 0)return s;let i=e.strings.join(F);if(s=o.keyString.get(i),s===void 0){let a=e.getTemplateElement();Yt&&window.ShadyCSS.prepareTemplateDom(a,t),s=new ge(e,a),o.keyString.set(i,s)}return o.stringsArray.set(e.strings,s),s},"shadyTemplateFactory"),Oc=["html","svg"],Tc=n(t=>{Oc.forEach(e=>{let r=be.get(Gn(e,t));r!==void 0&&r.keyString.forEach(o=>{let{element:{content:s}}=o,i=new Set;Array.from(s.querySelectorAll("style")).forEach(a=>{i.add(a)}),Nr(o,i)})})},"removeStylesFromLitTemplates"),Wn=new Set,Cc=n((t,e,r)=>{Wn.add(t);let o=r?r.element:document.createElement("template"),s=e.querySelectorAll("style"),{length:i}=s;if(i===0){window.ShadyCSS.prepareTemplateStyles(o,t);return}let a=document.createElement("style");for(let f=0;f<i;f++){let b=s[f];b.parentNode.removeChild(b),a.textContent+=b.textContent}Tc(t);let c=o.content;r?Vn(r,a,c.firstChild):c.insertBefore(a,c.firstChild),window.ShadyCSS.prepareTemplateStyles(o,t);let u=c.querySelector("style");if(window.ShadyCSS.nativeShadow&&u!==null)e.insertBefore(u.cloneNode(!0),e.firstChild);else if(r){c.insertBefore(a,c.firstChild);let f=new Set;f.add(a),Nr(r,f)}},"prepareTemplateStyles"),Yn=n((t,e,r)=>{if(!r||typeof r!="object"||!r.scopeName)throw new Error("The `scopeName` option is required.");let o=r.scopeName,s=te.has(e),i=Yt&&e.nodeType===11&&!!e.host,a=i&&!Wn.has(o),c=a?document.createDocumentFragment():e;if(Ur(t,c,Object.assign({templateFactory:wc(o)},r)),a){let u=te.get(c);te.delete(c);let f=u.value instanceof ee?u.value.template:void 0;Cc(o,c,f),he(e,e.firstChild),e.appendChild(c),te.set(e,u)}!s&&i&&window.ShadyCSS.styleElement(e.host)},"render")});var Jn,Mr,Kn,Vr,$r,Br,Hr,zr,Gr,Xe,Wr=w(()=>{window.JSCompiler_renameProperty=(t,e)=>t;Mr={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}},Kn=n((t,e)=>e!==t&&(e===e||t===t),"notEqual"),Vr={attribute:!0,type:String,converter:Mr,reflect:!1,hasChanged:Kn},$r=1,Br=1<<2,Hr=1<<3,zr=1<<4,Gr="finalized",Xe=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=Vr){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)||Vr}static finalize(){let e=Object.getPrototypeOf(this);if(e.hasOwnProperty(Gr)||e.finalize(),this[Gr]=!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=Kn){return o(e,r)}static _propertyValueFromAttribute(e,r){let o=r.type,s=r.converter||Mr,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||Mr.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=Vr){let s=this.constructor,i=s._attributeNameForProperty(e,o);if(i!==void 0){let a=s._propertyValueToAttribute(r,o);if(a===void 0)return;this._updateState=this._updateState|Hr,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._updateState=this._updateState&~Hr}}_attributeToProperty(e,r){if(this._updateState&Hr)return;let o=this.constructor,s=o._attributeToPropertyMap.get(e);if(s!==void 0){let i=o.getPropertyOptions(s);this._updateState=this._updateState|zr,this[s]=o._propertyValueFromAttribute(r,i),this._updateState=this._updateState&~zr}}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&zr)&&(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|Br;try{await this._updatePromise}catch(r){}let e=this.performUpdate();return e!=null&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return this._updateState&Br}get hasUpdated(){return this._updateState&$r}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&$r||(this._updateState=this._updateState|$r,this.firstUpdated(r)),this.updated(r))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~Br}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(Xe,"UpdatingElement");Jn=Gr;Xe[Jn]=!0});var Zn,Gu,Xn=w(()=>{Zn=Element.prototype,Gu=Zn.msMatchesSelector||Zn.webkitMatchesSelector});var Qt,Yr,et,es,Pc,T,Qr=w(()=>{Qt=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yr=Symbol(),et=class{constructor(e,r){if(r!==Yr)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return this._styleSheet===void 0&&(Qt?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}};n(et,"CSSResult");es=n(t=>new et(String(t),Yr),"unsafeCSS"),Pc=n(t=>{if(t instanceof et)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
- take care to ensure page security.`)},"textFromCSSResult"),T=n((t,...e)=>{let r=e.reduce((o,s,i)=>o+Pc(s)+t[i+1],t[0]);return new et(r,Yr)},"css")});var ts,S,O=w(()=>{Qn();Wr();Wr();Xn();jr();Qr();Qr();(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");ts={},S=class extends Xe{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;let e=this.getStyles();if(Array.isArray(e)){let r=n((i,a)=>i.reduceRight((c,u)=>Array.isArray(u)?r(u,c):(c.add(u),c),a),"addStyles"),o=r(e,new Set),s=[];o.forEach(i=>s.unshift(i)),this._styles=s}else this._styles=e===void 0?[]:[e];this._styles=this._styles.map(r=>{if(r instanceof CSSStyleSheet&&!Qt){let o=Array.prototype.slice.call(r.cssRules).reduce((s,i)=>s+i.cssText,"");return es(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):Qt?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!==ts&&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 ts}};n(S,"LitElement");S.finalized=!0;S.render=Yn});var Jt=se((op,rs)=>{var Rc={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"};rs.exports=Rc});var ns=se((np,os)=>{var _e=Jt(),Ac=n(t=>{let e="",r=[];for(let o of t){let s=o.charCodeAt(0);switch(s){case _e.PAR_OPEN:case _e.PAR_CLOSE:case _e.OP_NOT:case _e.BINARY_AND:case _e.BINARY_OR:e&&(r.push({type:_e.LITERAL,value:e}),e=""),r.push({type:s,value:o});break;default:e+=o}}return e&&r.push({type:_e.LITERAL,value:e}),r},"Tokenizer");os.exports=Ac});var is=se((sp,ss)=>{var re=Jt(),Nc=n(t=>{let e=[],r=[];return t.forEach(s=>{switch(s.type){case re.LITERAL:e.unshift(s);break;case re.BINARY_AND:case re.BINARY_OR:case re.OP_NOT:case re.PAR_OPEN:r.push(s);break;case re.PAR_CLOSE:for(;r.length&&r[r.length-1].type!==re.PAR_OPEN;)e.unshift(r.pop());r.pop(),r.length&&r[r.length-1].type===re.OP_NOT&&e.unshift(r.pop());break;default:break}}),r.length&&[...r.reverse(),...e]||e},"PolishNotation"),kc=n(function*(t){for(let e=0;e<t.length-1;e++)yield t[e];return t[t.length-1]},"PolishGenerator");ss.exports={PolishNotation:Nc,PolishGenerator:kc}});var cs=se((ip,as)=>{var U=Jt(),j=class{constructor(e,r,o,s){this.op=e,this.left=r,this.right=o,this.literal=s}isLeaf(){return this.op===U.LEAF}isAtomic(){return this.isLeaf()||this.op===U.OP_NOT&&this.left.isLeaf()}getLiteralValue(){return this.literal}static CreateAnd(e,r){return new j(U.BINARY_AND,e,r)}static CreateNot(e){return new j(U.OP_NOT,e)}static CreateOr(e,r){return new j(U.BINARY_OR,e,r)}static CreateLiteral(e){return new j(U.LEAF,null,null,e)}};n(j,"ExpNode");var ke=n(t=>{let e=t.next().value;switch(e.type){case U.LITERAL:return j.CreateLiteral(e.value);case U.OP_NOT:return j.CreateNot(ke(t));case U.BINARY_AND:{let r=ke(t),o=ke(t);return j.CreateAnd(r,o)}case U.BINARY_OR:{let r=ke(t),o=ke(t);return j.CreateOr(r,o)}}return null},"make"),Ie=n((t,e)=>{if(t.isLeaf())return e(t.getLiteralValue());if(t.op===U.OP_NOT)return!Ie(t.left,e);if(t.op===U.BINARY_OR)return Ie(t.left,e)||Ie(t.right,e);if(t.op===U.BINARY_AND)return Ie(t.left,e)&&Ie(t.right,e)},"nodeEvaluator");as.exports={make:ke,nodeEvaluator:Ie}});var ds=se((ap,ps)=>{var Ic=ns(),ls=is(),us=cs(),qc=n((t,e)=>{let r=Ic(t),o=ls.PolishNotation(r),s=ls.PolishGenerator(o),i=us.make(s);return us.nodeEvaluator(i,e)},"parse");ps.exports={parse:qc}});var Bs={};nr(Bs,{TestWizard:()=>or,default:()=>tl});var or,tl,Hs=w(()=>{O();I();or=class extends S{static get styles(){return T`
11
+ var lib=(()=>{var ei=Object.create;var ke=Object.defineProperty;var ti=Object.getOwnPropertyDescriptor;var ri=Object.getOwnPropertyNames;var oi=Object.getPrototypeOf,ni=Object.prototype.hasOwnProperty;var yo=t=>ke(t,"__esModule",{value:!0}),n=(t,e)=>ke(t,"name",{value:e,configurable:!0}),si=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var S=(t,e)=>()=>(t&&(e=t(t=0)),e);var re=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),tr=(t,e)=>{yo(t);for(var r in e)ke(t,r,{get:e[r],enumerable:!0})},ii=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ri(e))!ni.call(t,o)&&o!=="default"&&ke(t,o,{get:()=>e[o],enumerable:!(r=ti(e,o))||r.enumerable});return t},oe=t=>ii(yo(ke(t!=null?ei(oi(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var ne,se,ie,ot,Ao,q,qe,nt,st,No,it,_e,ko,at,ct,Io,lt,ut,pt,qo,Uo,dt,Do,ft,xe,Fo,ht,mt,Ue,De,gt,yt,ae,G,bt,_t,xt,ce=S(()=>{ne="OPTIN_PRODUCT",se="OPTOUT_PRODUCT",ie="PRODUCT_CHANGE_FREQUENCY",ot="SET_MERCHANT_ID",Ao="REQUEST_OFFER",q="RECEIVE_OFFER",qe="PRODUCT_HAS_CHANGED",nt="CREATED_SESSION_ID",st="SET_AUTH_URL",No="REQUEST_AUTH",it="AUTHORIZE",_e="UNAUTHORIZED",ko="REQUEST_ORDERS",at="RECEIVE_ORDERS",ct="RECEIVE_ORDER_ITEMS",Io="FETCH_RESPONSE_ERROR",lt="SET_ENVIRONMENT_STAGING",ut="SET_ENVIRONMENT_DEV",pt="SET_ENVIRONMENT_PROD",qo="CONCLUDE_UPSELL",Uo="REQUEST_CREATE_IU_ORDER",dt="CREATE_ONE_TIME",Do="REQUEST_CONVERT_ONE_TIME",ft="CONVERT_ONE_TIME",xe="CHECKOUT",Fo="RECEIVE_FETCH",ht="SET_LOCALE",mt="SET_CONFIG",Ue="SET_PREVIEW_STANDARD_OFFER",De="SET_PREVIEW_UPSELL_OFFER",gt="ADD_TEMPLATE",yt="SET_TEMPLATES",ae="LOCAL_STORAGE_CHANGE",G="LOCAL_STORAGE_CLEAR",bt="SET_FIRST_ORDER_PLACE_DATE",_t="SET_PRODUCT_TO_SUBSCRIBE",xt="RECEIVE_PRODUCT_PLANS"});var vt=re((el,zo)=>{var Si="Expected a function",Lo="__lodash_hash_undefined__",vi="[object Function]",wi="[object GeneratorFunction]",Ti=/[\\^$.*+?()[\]{}|]/g,Oi=/^\[object .+?Constructor\]$/,Ci=typeof window=="object"&&window&&window.Object===Object&&window,Pi=typeof self=="object"&&self&&self.Object===Object&&self,jo=Ci||Pi||Function("return this")();function Ri(t,e){return t==null?void 0:t[e]}n(Ri,"getValue");function Ai(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}n(Ai,"isHostObject");var Ni=Array.prototype,ki=Function.prototype,Mo=Object.prototype,lr=jo["__core-js_shared__"],Vo=function(){var t=/[^.]+$/.exec(lr&&lr.keys&&lr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),$o=ki.toString,ur=Mo.hasOwnProperty,Ii=Mo.toString,qi=RegExp("^"+$o.call(ur).replace(Ti,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ui=Ni.splice,Di=Bo(jo,"Map"),Fe=Bo(Object,"create");function le(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(le,"Hash");function Fi(){this.__data__=Fe?Fe(null):{}}n(Fi,"hashClear");function Li(t){return this.has(t)&&delete this.__data__[t]}n(Li,"hashDelete");function ji(t){var e=this.__data__;if(Fe){var r=e[t];return r===Lo?void 0:r}return ur.call(e,t)?e[t]:void 0}n(ji,"hashGet");function Mi(t){var e=this.__data__;return Fe?e[t]!==void 0:ur.call(e,t)}n(Mi,"hashHas");function Vi(t,e){var r=this.__data__;return r[t]=Fe&&e===void 0?Lo:e,this}n(Vi,"hashSet");le.prototype.clear=Fi;le.prototype.delete=Li;le.prototype.get=ji;le.prototype.has=Mi;le.prototype.set=Vi;function Se(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(Se,"ListCache");function $i(){this.__data__=[]}n($i,"listCacheClear");function Bi(t){var e=this.__data__,r=Et(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():Ui.call(e,r,1),!0}n(Bi,"listCacheDelete");function Hi(t){var e=this.__data__,r=Et(e,t);return r<0?void 0:e[r][1]}n(Hi,"listCacheGet");function zi(t){return Et(this.__data__,t)>-1}n(zi,"listCacheHas");function Gi(t,e){var r=this.__data__,o=Et(r,t);return o<0?r.push([t,e]):r[o][1]=e,this}n(Gi,"listCacheSet");Se.prototype.clear=$i;Se.prototype.delete=Bi;Se.prototype.get=Hi;Se.prototype.has=zi;Se.prototype.set=Gi;function ue(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(ue,"MapCache");function Wi(){this.__data__={hash:new le,map:new(Di||Se),string:new le}}n(Wi,"mapCacheClear");function Yi(t){return St(this,t).delete(t)}n(Yi,"mapCacheDelete");function Qi(t){return St(this,t).get(t)}n(Qi,"mapCacheGet");function Ji(t){return St(this,t).has(t)}n(Ji,"mapCacheHas");function Ki(t,e){return St(this,t).set(t,e),this}n(Ki,"mapCacheSet");ue.prototype.clear=Wi;ue.prototype.delete=Yi;ue.prototype.get=Qi;ue.prototype.has=Ji;ue.prototype.set=Ki;function Et(t,e){for(var r=t.length;r--;)if(ra(t[r][0],e))return r;return-1}n(Et,"assocIndexOf");function Zi(t){if(!Ho(t)||ea(t))return!1;var e=oa(t)||Ai(t)?qi:Oi;return e.test(ta(t))}n(Zi,"baseIsNative");function St(t,e){var r=t.__data__;return Xi(e)?r[typeof e=="string"?"string":"hash"]:r.map}n(St,"getMapData");function Bo(t,e){var r=Ri(t,e);return Zi(r)?r:void 0}n(Bo,"getNative");function Xi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}n(Xi,"isKeyable");function ea(t){return!!Vo&&Vo in t}n(ea,"isMasked");function ta(t){if(t!=null){try{return $o.call(t)}catch{}try{return t+""}catch{}}return""}n(ta,"toSource");function pr(t,e){if(typeof t!="function"||e&&typeof e!="function")throw new TypeError(Si);var r=n(function(){var o=arguments,s=e?e.apply(this,o):o[0],i=r.cache;if(i.has(s))return i.get(s);var a=t.apply(this,o);return r.cache=i.set(s,a),a},"memoized");return r.cache=new(pr.Cache||ue),r}n(pr,"memoize");pr.Cache=ue;function ra(t,e){return t===e||t!==t&&e!==e}n(ra,"eq");function oa(t){var e=Ho(t)?Ii.call(t):"";return e==vi||e==wi}n(oa,"isFunction");function Ho(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}n(Ho,"isObject");zo.exports=pr});var wt,dr,Le,je,Tt,Go,Wo,na,sa,ia,aa,ca,Me,fr,la,Yo,Ve,ua,W,Y=S(()=>{wt=oe(vt()),dr=n((...t)=>JSON.stringify(t),"memoizeKey"),Le=n(t=>(...e)=>fetch(...t(...e)).then(r=>r.json()),"withFetchJson"),je=n(t=>(e,...r)=>{if(!e)throw Error("host required");let[o,s={}]=t(...r);return[`${e.replace(/\/+$/,"")}${o}`,s]},"withHost"),Tt=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"),Go=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"),Wo=n((t=[])=>(Array.isArray(t)?t:Object.entries(t)).map(([e,r])=>[e,encodeURIComponent(r)].join("=")).join("&"),"toQuery"),na=n(t=>JSON.stringify([].concat(t).map(e=>typeof e=="object"?e.id:e).filter(e=>e)),"toProductId"),sa=(0,wt.default)(Le(je((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=Wo([["session_id",e],["page_type",1],["p",na(r)],["module_view",JSON.stringify(["regular"])]]);return[`/offer/${t}/${o}?${s}`]})),dr),ia=(0,wt.default)(Le(je(Tt((t=1,e="place")=>[`/orders/?${Wo([["status",t],["ordering",e]])}`]))),dr),aa=(0,wt.default)(Le(je(Tt(t=>{if(!t)throw Error("orderId required");return[`/items/?order=${t}`]}))),dr),ca=Le(je(Tt(Go((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}}]})))),Me=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"),fr=n(t=>t.match(/^\d+_\d$/),"isFrequencyValid"),la=n((t,e)=>String.prototype.localeCompare.call(t&&t.split("_").reverse().join("_"),e&&e.split("_").reverse().join("_")),"compareFrequencies"),Yo=n(t=>[...new Set(t&&t.split(/\s+/))].filter(fr).sort(la),"parseFrequenciesList"),Ve=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"),ua=Le(je(Tt(Go((t,e,r)=>{if(!t)throw Error("item required");if(!e)throw Error("frequency required");let o=Me(e);if(!o)throw Error("invalid frequency");return["/subscriptions/create_from_item/",{body:{item:t.public_id,offer:r,...o}}]})))),W={fetchOffer:sa,fetchOrders:ia,fetchItems:aa,createOneTime:ca,convertOneTimeToSubscription:ua}});var yr=re((Rt,Xo)=>{(function(t,e){typeof Rt=="object"&&typeof Xo!="undefined"?e(Rt):typeof define=="function"&&define.amd?define(["exports"],e):(t=t||self,e(t.throttleDebounce={}))})(Rt,function(t){"use strict";function e(o,s,i,a){var c,l=!1,d=0;function g(){c&&clearTimeout(c)}n(g,"clearExistingTimeout");function p(){g(),l=!0}n(p,"cancel"),typeof s!="boolean"&&(a=i,i=s,s=void 0);function m(){for(var E=arguments.length,y=new Array(E),f=0;f<E;f++)y[f]=arguments[f];var T=this,O=Date.now()-d;if(l)return;function b(){d=Date.now(),i.apply(T,y)}n(b,"exec");function P(){c=void 0}n(P,"clear"),a&&!c&&b(),g(),a===void 0&&O>o?b():s!==!0&&(c=setTimeout(a?P:b,a===void 0?o-O: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 tn(){return typeof window.og_auth!="undefined"?At(window.og_auth):null}async function Ma(t=100){return new Promise(e=>{setTimeout(()=>e(tn()),t)})}async function rn(t,e=Fa,r=La){let o;if(o=At(tn())||At(e()),o)return o;if(t&&typeof t=="string"){let s=await fetch(t);s.status>=200&&s.status<300&&(o=e()||await(ja(s)?s.json():Promise.resolve(r(t)).then(e)))}else o||(o=await Ma());if(o=At(o),o)return o;throw new Error("Unauthorized")}var en,Fa,At,La,ja,on=S(()=>{en=/^og_auth=/,Fa=n((t=en)=>(document.cookie.split(/;\s*/).find(e=>e.match(t))||"").replace(en,""),"c"),At=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"),La=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"),ja=n(t=>(t.headers.get("content-type")||"").indexOf("application/json")!==-1,"d");n(tn,"a");n(Ma,"f");n(rn,"u")});var Q,we,nn,Nt,sn,an,Va,$a,br,J,cn,kt,ln,Ba,_r,xr,It,Er,qt,Te,Sr,Ha,un,pn,za,Ga,Wa,Ya,dn,fn,hn,mn,gn,yn,bn,N=S(()=>{on();ce();Y();Q=n((t,e)=>({type:ne,payload:{product:t,frequency:e}}),"optinProduct"),we=n(t=>({type:se,payload:{product:t}}),"optoutProduct"),nn=n((t,e)=>({type:qe,payload:{newProduct:t,product:e}}),"productHasChangedComponents"),Nt=n((t,e)=>({type:ie,payload:{product:t,frequency:e}}),"productChangeFrequency"),sn=n(t=>({type:qo,payload:{product:t}}),"concludeUpsell"),an=n(t=>({type:ot,payload:t}),"setMerchantId"),Va=n(t=>({type:nt,payload:`${t}.${Math.floor(Math.random()*999999)}.${Math.round(new Date().getTime()/1e3)}`}),"createSessionId"),$a=n(t=>({type:No,payload:t}),"requestAuth"),br=n((t,e,r,o)=>({type:it,payload:{public_id:t,sig_field:e,ts:r,sig:o}}),"authorize"),J=n(t=>({type:_e,payload:t}),"unauthorized"),cn=n(t=>({type:st,payload:t}),"setAuthUrl"),kt=n(t=>({type:Fo,payload:t}),"fetchDone"),ln=n((t=rn)=>n(function(r,o){if(window.og&&window.og.previewMode)return r(J({message:"Offers are running in preview mode"}));let{merchantId:s,authUrl:i}=o(),a=$a(i);return r(a),t(i).then(({sig_field:c,ts:l,sig:d})=>r(br(s,c,l,d)),c=>r(J(c))).finally(()=>r(kt(a)))},"fetchAuthThunk"),"fetchAuth"),Ba=n((t,e)=>({type:ko,payload:{status:t,ordering:e}}),"requestOrders"),_r=n(t=>({type:at,payload:t}),"receiveOrders"),xr=n(t=>({type:ct,payload:t}),"receiveItems"),It=n((t=1,e="place")=>n(function(o,s){let{environment:{legoUrl:i},auth:a}=s();if(!a)return o(J("No auth set."));let c=Ba(t,e);return o(c),W.fetchOrders(i,a,t,e).then(l=>{if(l.results){o(_r(l));let d=(l.results[0]||{}).public_id;if(d)return W.fetchItems(i,a,d).then(g=>o(xr(g)))}return o(J(l.detail)),null},l=>o(J(l))).finally(()=>o(kt(c)))},"fetchOrdersThunk"),"fetchOrders"),Er=n(t=>{switch(t){case"dev":return{type:ut,payload:t};case"staging":return{type:lt,payload:t};case"prod":return{type:pt,payload:t};default:throw new Error(`${t} is not a supported environment`)}},"setEnvironment"),qt=n(()=>(t,e)=>{let{merchantId:r,sessionId:o}=e();return(!o||r&&!o.startsWith(r))&&t(Va(r)),o},"requestSessionId"),Te=n(t=>({type:q,payload:t}),"receiveOffer"),Sr=n(t=>({type:Io,payload:t}),"fetchResponseError"),Ha=n((t,e="pdp")=>({type:Ao,payload:{product:t,module:e}}),"requestOffer"),un=n((t,e="pdp")=>n(function(o,s){let{merchantId:i,sessionId:a,environment:{apiUrl:c}}=s(),l=Ha(t,e);return o(l),W.fetchOffer(c,i,a,t,e).then(d=>o(Te(d)),d=>o(Sr(d))).finally(()=>o(kt(l)))},"fetchOfferThunk"),"fetchOffer"),pn=n(()=>({type:xe}),"checkout"),za=n((t,e,r,o)=>({type:Uo,payload:{product:t,order:e,quantity:r,offerId:o}}),"requestCreateOneTime"),Ga=n(t=>({type:dt,payload:t}),"receiveCreateOneTime"),Wa=n((t,e)=>({type:Do,payload:{item:t,frequency:e}}),"requestConvertOneTimeToSubscription"),Ya=n((t,e)=>({type:ft,payload:{response:t,product:e}}),"receiveConvertOneTime"),dn=n((t,e,r,o=!1,s=null)=>n(function(a,c){let{auth:l,environment:{legoUrl:d},previewUpsellOffer:g,offerId:p}=c();if(!l)return a(J("No auth set."));let m=za(t,e,r,p);return a(m),(g?Promise.resolve({legoUrl:d,product:t,order:e,quantity:r,offer:p}):W.createOneTime(d,l,t.id,e,r,p)).then(E=>(a(Ga(E)),o?(a(Wa(E,s)),(g?Promise.resolve({item:E,frequency:s}):W.convertOneTimeToSubscription(d,l,E,s,p)).then(y=>a(Ya(y,t)),y=>a(Sr(y)))):E),E=>a(Sr(E))).finally(()=>a(kt(m)))},"createIuThunk"),"createIu"),fn=n(t=>({type:ht,payload:t}),"setLocale"),hn=n(t=>({type:mt,payload:t}),"setConfig"),mn=n((t,e,r)=>({type:gt,payload:{selector:t,markup:e,config:r}}),"addTemplate"),gn=n(t=>({type:yt,payload:t}),"setTemplates"),yn=n((t,e)=>({type:bt,payload:{product:t,firstOrderPlaceDate:e}}),"setFirstOrderPlaceDate"),bn=n((t,e)=>({type:_t,payload:{product:t,productToSubscribe:e}}),"setProductToSubscribe")});var Tr,de,fe=S(()=>{Tr=typeof window!="undefined"&&window.customElements!=null&&window.customElements.polyfillWrapFlushCallback!==void 0,de=n((t,e,r=null)=>{for(;e!==r;){let o=e.nextSibling;t.removeChild(e),e=o}},"removeNodes")});var U,Or,Rn,Oe,he,An,Be,M,Ut,K=S(()=>{U=`{{lit-${String(Math.random()).slice(2)}}}`,Or=`<!--${U}-->`,Rn=new RegExp(`${U}|${Or}`),Oe="$lit$",he=class{constructor(e,r){this.parts=[],this.element=r;let o=[],s=[],i=document.createTreeWalker(r.content,133,null,!1),a=0,c=-1,l=0,{strings:d,values:{length:g}}=e;for(;l<g;){let p=i.nextNode();if(p===null){i.currentNode=s.pop();continue}if(c++,p.nodeType===1){if(p.hasAttributes()){let m=p.attributes,{length:E}=m,y=0;for(let f=0;f<E;f++)An(m[f].name,Oe)&&y++;for(;y-- >0;){let f=d[l],T=Ut.exec(f)[2],O=T.toLowerCase()+Oe,b=p.getAttribute(O);p.removeAttribute(O);let P=b.split(Rn);this.parts.push({type:"attribute",index:c,name:T,strings:P}),l+=P.length-1}}p.tagName==="TEMPLATE"&&(s.push(p),i.currentNode=p.content)}else if(p.nodeType===3){let m=p.data;if(m.indexOf(U)>=0){let E=p.parentNode,y=m.split(Rn),f=y.length-1;for(let T=0;T<f;T++){let O,b=y[T];if(b==="")O=M();else{let P=Ut.exec(b);P!==null&&An(P[2],Oe)&&(b=b.slice(0,P.index)+P[1]+P[2].slice(0,-Oe.length)+P[3]),O=document.createTextNode(b)}E.insertBefore(O,p),this.parts.push({type:"node",index:++c})}y[f]===""?(E.insertBefore(M(),p),o.push(p)):p.data=y[f],l+=f}}else if(p.nodeType===8)if(p.data===U){let m=p.parentNode;(p.previousSibling===null||c===a)&&(c++,m.insertBefore(M(),p)),a=c,this.parts.push({type:"node",index:c}),p.nextSibling===null?p.data="":(o.push(p),c--),l++}else{let m=-1;for(;(m=p.data.indexOf(U,m+1))!==-1;)this.parts.push({type:"node",index:-1}),l++}}for(let p of o)p.parentNode.removeChild(p)}};n(he,"Template");An=n((t,e)=>{let r=t.length-e.length;return r>=0&&t.slice(r)===e},"endsWith"),Be=n(t=>t.index!==-1,"isTemplatePartActive"),M=n(()=>document.createComment(""),"createMarker"),Ut=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/});function Pr(t,e){let{element:{content:r},parts:o}=t,s=document.createTreeWalker(r,Cr,null,!1),i=He(o),a=o[i],c=-1,l=0,d=[],g=null;for(;s.nextNode();){c++;let p=s.currentNode;for(p.previousSibling===g&&(g=null),e.has(p)&&(d.push(p),g===null&&(g=p)),g!==null&&l++;a!==void 0&&a.index===c;)a.index=g!==null?-1:a.index-l,i=He(o,i),a=o[i]}d.forEach(p=>p.parentNode.removeChild(p))}function Nn(t,e,r=null){let{element:{content:o},parts:s}=t;if(r==null){o.appendChild(e);return}let i=document.createTreeWalker(o,Cr,null,!1),a=He(s),c=0,l=-1;for(;i.nextNode();)for(l++,i.currentNode===r&&(c=Za(e),r.parentNode.insertBefore(e,r));a!==-1&&s[a].index===l;){if(c>0){for(;a!==-1;)s[a].index+=c,a=He(s,a);return}a=He(s,a)}}var Cr,Za,He,kn=S(()=>{K();Cr=133;n(Pr,"removeNodesFromTemplate");Za=n(t=>{let e=t.nodeType===11?0:1,r=document.createTreeWalker(t,Cr,null,!1);for(;r.nextNode();)e++;return e},"countNodes"),He=n((t,e=-1)=>{for(let r=e+1;r<t.length;r++){let o=t[r];if(Be(o))return r}return-1},"nextActiveIndexInTemplateParts");n(Nn,"insertNodeIntoTemplate")});var Xa,me,Rr=S(()=>{Xa=new WeakMap,me=n(t=>typeof t=="function"&&Xa.has(t),"isDirective")});var k,Dt,Ar=S(()=>{k={},Dt={}});var Z,Ft=S(()=>{fe();K();Z=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=Tr?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),r=[],o=this.template.parts,s=document.createTreeWalker(e,133,null,!1),i=0,a=0,c,l=s.nextNode();for(;i<o.length;){if(c=o[i],!Be(c)){this.__parts.push(void 0),i++;continue}for(;a<c.index;)a++,l.nodeName==="TEMPLATE"&&(r.push(l),s.currentNode=l.content),(l=s.nextNode())===null&&(s.currentNode=r.pop(),l=s.nextNode());if(c.type==="node"){let d=this.processor.handleTextExpression(this.options);d.insertAfterNode(l.previousSibling),this.__parts.push(d)}else this.__parts.push(...this.processor.handleAttributeExpressions(l,c.name,c.strings,this.options));i++}return Tr&&(document.adoptNode(e),customElements.upgrade(e)),e}};n(Z,"TemplateInstance")});var In,tc,B,Lt=S(()=>{fe();K();In=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:t=>t}),tc=` ${U} `,B=class{constructor(e,r,o,s){this.strings=e,this.values=r,this.type=o,this.processor=s}getHTML(){let e=this.strings.length-1,r="",o=!1;for(let s=0;s<e;s++){let i=this.strings[s],a=i.lastIndexOf("<!--");o=(a>-1||o)&&i.indexOf("-->",a+1)===-1;let c=Ut.exec(i);c===null?r+=i+(o?tc:Or):r+=i.substr(0,c.index)+c[1]+c[2]+Oe+c[3]+U}return r+=this.strings[e],r}getTemplateElement(){let e=document.createElement("template"),r=this.getHTML();return In!==void 0&&(r=In.createHTML(r)),e.innerHTML=r,e}};n(B,"TemplateResult")});var jt,Mt,Ce,ze,H,Ge,We,Vt,qn,Ye,rc,$t=S(()=>{Rr();fe();Ar();Ft();Lt();K();jt=n(t=>t===null||!(typeof t=="object"||typeof t=="function"),"isPrimitive"),Mt=n(t=>Array.isArray(t)||!!(t&&t[Symbol.iterator]),"isIterable"),Ce=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 ze(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"||!Mt(i))return i}let s="";for(let i=0;i<r;i++){s+=e[i];let a=o[i];if(a!==void 0){let c=a.value;if(jt(c)||!Mt(c))s+=typeof c=="string"?c:String(c);else for(let l of c)s+=typeof l=="string"?l:String(l)}}return s+=e[r],s}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}};n(Ce,"AttributeCommitter");ze=class{constructor(e){this.value=void 0,this.committer=e}setValue(e){e!==k&&(!jt(e)||e!==this.value)&&(this.value=e,me(e)||(this.committer.dirty=!0))}commit(){for(;me(this.value);){let e=this.value;this.value=k,e(this)}this.value!==k&&this.committer.commit()}};n(ze,"AttributePart");H=class{constructor(e){this.value=void 0,this.__pendingValue=void 0,this.options=e}appendInto(e){this.startNode=e.appendChild(M()),this.endNode=e.appendChild(M())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=M()),e.__insert(this.endNode=M())}insertAfterPart(e){e.__insert(this.startNode=M()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(this.startNode.parentNode===null)return;for(;me(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=k,r(this)}let e=this.__pendingValue;e!==k&&(jt(e)?e!==this.value&&this.__commitText(e):e instanceof B?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):Mt(e)?this.__commitIterable(e):e===Dt?(this.value=Dt,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 Z&&this.value.template===r)this.value.update(e.values);else{let o=new Z(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 H(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){de(this.startNode.parentNode,e.nextSibling,this.endNode)}};n(H,"NodePart");Ge=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(;me(this.__pendingValue);){let r=this.__pendingValue;this.__pendingValue=k,r(this)}if(this.__pendingValue===k)return;let e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=k}};n(Ge,"BooleanAttributePart");We=class extends Ce{constructor(e,r,o){super(e,r,o);this.single=o.length===2&&o[0]===""&&o[1]===""}_createPart(){return new Vt(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}};n(We,"PropertyCommitter");Vt=class extends ze{};n(Vt,"PropertyPart");qn=!1;(()=>{try{let t={get capture(){return qn=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch{}})();Ye=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(;me(this.__pendingValue);){let i=this.__pendingValue;this.__pendingValue=k,i(this)}if(this.__pendingValue===k)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=rc(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=k}handleEvent(e){typeof this.value=="function"?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}};n(Ye,"EventPart");rc=n(t=>t&&(qn?{capture:t.capture,passive:t.passive,once:t.once}:t.capture),"getOptions")});function Nr(t){let e=ge.get(t.type);e===void 0&&(e={stringsArray:new WeakMap,keyString:new Map},ge.set(t.type,e));let r=e.stringsArray.get(t.strings);if(r!==void 0)return r;let o=t.strings.join(U);return r=e.keyString.get(o),r===void 0&&(r=new he(t,t.getTemplateElement()),e.keyString.set(o,r)),e.stringsArray.set(t.strings,r),r}var ge,Bt=S(()=>{K();n(Nr,"templateFactory");ge=new Map});var X,kr,Ir=S(()=>{fe();$t();Bt();X=new WeakMap,kr=n((t,e,r)=>{let o=X.get(e);o===void 0&&(de(e,e.firstChild),X.set(e,o=new H(Object.assign({templateFactory:Nr},r))),o.appendInto(e)),o.setValue(t),o.commit()},"render")});var Ht,qr,Ur=S(()=>{$t();Ht=class{handleAttributeExpressions(e,r,o,s){let i=r[0];return i==="."?new We(e,r.slice(1),o).parts:i==="@"?[new Ye(e,r.slice(1),s.eventContext)]:i==="?"?[new Ge(e,r.slice(1),o)]:new Ce(e,r,o).parts}handleTextExpression(e){return new H(e)}};n(Ht,"DefaultTemplateProcessor");qr=new Ht});var u,Dr=S(()=>{Ur();Lt();Ur();Rr();fe();Ar();$t();Ir();Bt();Ft();Lt();K();typeof window!="undefined"&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");u=n((t,...e)=>new B(t,e,"html",qr),"html")});var Dn,zt,nc,sc,ic,Fn,ac,Ln,jn=S(()=>{fe();kn();Ir();Bt();Ft();K();Dr();Dn=n((t,e)=>`${t}--${e}`,"getTemplateCacheKey"),zt=!0;typeof window.ShadyCSS=="undefined"?zt=!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."),zt=!1);nc=n(t=>e=>{let r=Dn(e.type,t),o=ge.get(r);o===void 0&&(o={stringsArray:new WeakMap,keyString:new Map},ge.set(r,o));let s=o.stringsArray.get(e.strings);if(s!==void 0)return s;let i=e.strings.join(U);if(s=o.keyString.get(i),s===void 0){let a=e.getTemplateElement();zt&&window.ShadyCSS.prepareTemplateDom(a,t),s=new he(e,a),o.keyString.set(i,s)}return o.stringsArray.set(e.strings,s),s},"shadyTemplateFactory"),sc=["html","svg"],ic=n(t=>{sc.forEach(e=>{let r=ge.get(Dn(e,t));r!==void 0&&r.keyString.forEach(o=>{let{element:{content:s}}=o,i=new Set;Array.from(s.querySelectorAll("style")).forEach(a=>{i.add(a)}),Pr(o,i)})})},"removeStylesFromLitTemplates"),Fn=new Set,ac=n((t,e,r)=>{Fn.add(t);let o=r?r.element:document.createElement("template"),s=e.querySelectorAll("style"),{length:i}=s;if(i===0){window.ShadyCSS.prepareTemplateStyles(o,t);return}let a=document.createElement("style");for(let d=0;d<i;d++){let g=s[d];g.parentNode.removeChild(g),a.textContent+=g.textContent}ic(t);let c=o.content;r?Nn(r,a,c.firstChild):c.insertBefore(a,c.firstChild),window.ShadyCSS.prepareTemplateStyles(o,t);let l=c.querySelector("style");if(window.ShadyCSS.nativeShadow&&l!==null)e.insertBefore(l.cloneNode(!0),e.firstChild);else if(r){c.insertBefore(a,c.firstChild);let d=new Set;d.add(a),Pr(r,d)}},"prepareTemplateStyles"),Ln=n((t,e,r)=>{if(!r||typeof r!="object"||!r.scopeName)throw new Error("The `scopeName` option is required.");let o=r.scopeName,s=X.has(e),i=zt&&e.nodeType===11&&!!e.host,a=i&&!Fn.has(o),c=a?document.createDocumentFragment():e;if(kr(t,c,Object.assign({templateFactory:nc(o)},r)),a){let l=X.get(c);X.delete(c);let d=l.value instanceof Z?l.value.template:void 0;ac(o,c,d),de(e,e.firstChild),e.appendChild(c),X.set(e,l)}!s&&i&&window.ShadyCSS.styleElement(e.host)},"render")});var Mn,Fr,Vn,Lr,jr,Mr,Vr,$r,Br,Qe,Hr=S(()=>{window.JSCompiler_renameProperty=(t,e)=>t;Fr={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}},Vn=n((t,e)=>e!==t&&(e===e||t===t),"notEqual"),Lr={attribute:!0,type:String,converter:Fr,reflect:!1,hasChanged:Vn},jr=1,Mr=1<<2,Vr=1<<3,$r=1<<4,Br="finalized",Qe=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=Lr){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)||Lr}static finalize(){let e=Object.getPrototypeOf(this);if(e.hasOwnProperty(Br)||e.finalize(),this[Br]=!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=Vn){return o(e,r)}static _propertyValueFromAttribute(e,r){let o=r.type,s=r.converter||Fr,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||Fr.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=Lr){let s=this.constructor,i=s._attributeNameForProperty(e,o);if(i!==void 0){let a=s._propertyValueToAttribute(r,o);if(a===void 0)return;this._updateState=this._updateState|Vr,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._updateState=this._updateState&~Vr}}_attributeToProperty(e,r){if(this._updateState&Vr)return;let o=this.constructor,s=o._attributeToPropertyMap.get(e);if(s!==void 0){let i=o.getPropertyOptions(s);this._updateState=this._updateState|$r,this[s]=o._propertyValueFromAttribute(r,i),this._updateState=this._updateState&~$r}}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&$r)&&(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|Mr;try{await this._updatePromise}catch{}let e=this.performUpdate();return e!=null&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return this._updateState&Mr}get hasUpdated(){return this._updateState&jr}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&jr||(this._updateState=this._updateState|jr,this.firstUpdated(r)),this.updated(r))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~Mr}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(Qe,"UpdatingElement");Mn=Br;Qe[Mn]=!0});var $n,Pu,Bn=S(()=>{$n=Element.prototype,Pu=$n.msMatchesSelector||$n.webkitMatchesSelector});var Gt,zr,Je,Hn,cc,w,Gr=S(()=>{Gt=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,zr=Symbol(),Je=class{constructor(e,r){if(r!==zr)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return this._styleSheet===void 0&&(Gt?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}};n(Je,"CSSResult");Hn=n(t=>new Je(String(t),zr),"unsafeCSS"),cc=n(t=>{if(t instanceof Je)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
+ take care to ensure page security.`)},"textFromCSSResult"),w=n((t,...e)=>{let r=e.reduce((o,s,i)=>o+cc(s)+t[i+1],t[0]);return new Je(r,zr)},"css")});var zn,x,v=S(()=>{jn();Hr();Hr();Bn();Dr();Gr();Gr();(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");zn={},x=class extends Qe{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;let e=this.getStyles();if(Array.isArray(e)){let r=n((i,a)=>i.reduceRight((c,l)=>Array.isArray(l)?r(l,c):(c.add(l),c),a),"addStyles"),o=r(e,new Set),s=[];o.forEach(i=>s.unshift(i)),this._styles=s}else this._styles=e===void 0?[]:[e];this._styles=this._styles.map(r=>{if(r instanceof CSSStyleSheet&&!Gt){let o=Array.prototype.slice.call(r.cssRules).reduce((s,i)=>s+i.cssText,"");return Hn(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):Gt?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!==zn&&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 zn}};n(x,"LitElement");x.finalized=!0;x.render=Ln});var Wt=re((ju,Gn)=>{var lc={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"};Gn.exports=lc});var Yn=re((Mu,Wn)=>{var ye=Wt(),uc=n(t=>{let e="",r=[];for(let o of t){let s=o.charCodeAt(0);switch(s){case ye.PAR_OPEN:case ye.PAR_CLOSE:case ye.OP_NOT:case ye.BINARY_AND:case ye.BINARY_OR:e&&(r.push({type:ye.LITERAL,value:e}),e=""),r.push({type:s,value:o});break;default:e+=o}}return e&&r.push({type:ye.LITERAL,value:e}),r},"Tokenizer");Wn.exports=uc});var Jn=re((Vu,Qn)=>{var ee=Wt(),pc=n(t=>{let e=[],r=[];return t.forEach(s=>{switch(s.type){case ee.LITERAL:e.unshift(s);break;case ee.BINARY_AND:case ee.BINARY_OR:case ee.OP_NOT:case ee.PAR_OPEN:r.push(s);break;case ee.PAR_CLOSE:for(;r.length&&r[r.length-1].type!==ee.PAR_OPEN;)e.unshift(r.pop());r.pop(),r.length&&r[r.length-1].type===ee.OP_NOT&&e.unshift(r.pop());break;default:break}}),r.length&&[...r.reverse(),...e]||e},"PolishNotation"),dc=n(function*(t){for(let e=0;e<t.length-1;e++)yield t[e];return t[t.length-1]},"PolishGenerator");Qn.exports={PolishNotation:pc,PolishGenerator:dc}});var Zn=re(($u,Kn)=>{var I=Wt(),F=class{constructor(e,r,o,s){this.op=e,this.left=r,this.right=o,this.literal=s}isLeaf(){return this.op===I.LEAF}isAtomic(){return this.isLeaf()||this.op===I.OP_NOT&&this.left.isLeaf()}getLiteralValue(){return this.literal}static CreateAnd(e,r){return new F(I.BINARY_AND,e,r)}static CreateNot(e){return new F(I.OP_NOT,e)}static CreateOr(e,r){return new F(I.BINARY_OR,e,r)}static CreateLiteral(e){return new F(I.LEAF,null,null,e)}};n(F,"ExpNode");var Pe=n(t=>{let e=t.next().value;switch(e.type){case I.LITERAL:return F.CreateLiteral(e.value);case I.OP_NOT:return F.CreateNot(Pe(t));case I.BINARY_AND:{let r=Pe(t),o=Pe(t);return F.CreateAnd(r,o)}case I.BINARY_OR:{let r=Pe(t),o=Pe(t);return F.CreateOr(r,o)}}return null},"make"),Re=n((t,e)=>{if(t.isLeaf())return e(t.getLiteralValue());if(t.op===I.OP_NOT)return!Re(t.left,e);if(t.op===I.BINARY_OR)return Re(t.left,e)||Re(t.right,e);if(t.op===I.BINARY_AND)return Re(t.left,e)&&Re(t.right,e)},"nodeEvaluator");Kn.exports={make:Pe,nodeEvaluator:Re}});var rs=re((Bu,ts)=>{var fc=Yn(),Xn=Jn(),es=Zn(),hc=n((t,e)=>{let r=fc(t),o=Xn.PolishNotation(r),s=Xn.PolishGenerator(o),i=es.make(s);return es.nodeEvaluator(i,e)},"parse");ts.exports={parse:hc}});var Is={};tr(Is,{TestWizard:()=>er,default:()=>Fc});var er,Fc,qs=S(()=>{v();N();er=class extends x{static get styles(){return w`
13
13
  :host {
14
14
  position: fixed;
15
15
  top: 5em;
@@ -67,11 +67,11 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
67
67
  a {
68
68
  color: white;
69
69
  }
70
- `}runTests(){this.results=[],this.disabled=!0,this.requestUpdate(),document.querySelectorAll("og-offer").forEach(r=>{let o=r.store.getState(),s=r.getAttribute("product"),i=r.getAttribute("location"),a={messages:this.getOfferAttributeMessages(s,i).concat(this.getOfferRequestMessages(s,o)),product:s};this.results.push(a)}),this.testsRan=!0,this.disabled=!1,this.requestUpdate()}getOfferAttributeMessages(e,r){let o=[];return e||o.push({name:"Offer element found but missing product attribute",type:"error"}),r||o.push({name:"Offer element found but missing location attribute",type:"warning"}),e&&r&&o.push({name:"Offer element found and properly tagged",type:"success"}),o}getOfferRequestMessages(e,r){let o=r.inStock[e],s=r.autoshipEligible[e],i=[];return e&&o===!1&&i.push({name:"This product is marked as out of stock in the OG database",type:"warning"}),e&&s===!1&&i.push({name:"This product is not eligible for autoship",type:"warning"}),e&&o===null&&s===null&&i.push({name:"This product does not exist in our database",type:"error"}),i}resultsCodeBlock(){return this.results.length===0?p`
70
+ `}runTests(){this.results=[],this.disabled=!0,this.requestUpdate(),document.querySelectorAll("og-offer").forEach(r=>{let o=r.store.getState(),s=r.getAttribute("product"),i=r.getAttribute("location"),a={messages:this.getOfferAttributeMessages(s,i).concat(this.getOfferRequestMessages(s,o)),product:s};this.results.push(a)}),this.testsRan=!0,this.disabled=!1,this.requestUpdate()}getOfferAttributeMessages(e,r){let o=[];return e||o.push({name:"Offer element found but missing product attribute",type:"error"}),r||o.push({name:"Offer element found but missing location attribute",type:"warning"}),e&&r&&o.push({name:"Offer element found and properly tagged",type:"success"}),o}getOfferRequestMessages(e,r){let o=r.inStock[e],s=r.autoshipEligible[e],i=[];return e&&o===!1&&i.push({name:"This product is marked as out of stock in the OG database",type:"warning"}),e&&s===!1&&i.push({name:"This product is not eligible for autoship",type:"warning"}),e&&o===null&&s===null&&i.push({name:"This product does not exist in our database",type:"error"}),i}resultsCodeBlock(){return this.results.length===0?u`
71
71
  <div class="message error">No offer element found on the page</div>
72
- `:this.results.map((e,r)=>p`
72
+ `:this.results.map((e,r)=>u`
73
73
  <div>For offer tag with product = "${e.product}"</div>
74
- ${e.messages.map(o=>p`
74
+ ${e.messages.map(o=>u`
75
75
  <div class="message ${o.type}">
76
76
  ${o.name}
77
77
  </div>
@@ -100,16 +100,16 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
100
100
  upsell product is in next order
101
101
  </button>
102
102
  <br />
103
- `)}toggleUpsellPreview(e){return r=>{r.preventDefault();let o=document.querySelectorAll("og-offer")[e];o.getAttribute("preview-upsell-offer")?o.removeAttribute("preview-upsell-offer"):o.setAttribute("preview-upsell-offer",!0),this.runTests()}}toggleProductFlags(e,{inStock:r=!0,autoship:o=!0,groups:s=["subscription","upsell"]}){return i=>{i.preventDefault();let a=document.querySelectorAll("og-offer")[e],c=a.product.id;a.store.dispatch(Re({in_stock:{[c]:r},eligibility_groups:{[c]:s},result:"success",autoship:{[c]:o},module_view:{regular:"58a01e9aacbe40389b5c7325d79091bb"},modifiers:{},incentives_display:{"47c01e9aacbe40389b5c7325d79091aa":{field:"sub_total",object:"order",type:"Discount Percent",value:5},e6534b9d877f41e586c37b7d8abc3a58:{field:"total_price",object:"item",type:"Discount Percent",value:5},f35e842710b24929922db4a529eecd40:{field:"total_price",object:"item",type:"Discount Percent",value:10},"5be321d7c17f4e18a757212b9a20bfcc":{field:"total_price",object:"item",type:"Discount Percent",value:1}},incentives:{[c]:{initial:["5be321d7c17f4e18a757212b9a20bfcc"],ongoing:["e6534b9d877f41e586c37b7d8abc3a58","47c01e9aacbe40389b5c7325d79091aa","f35e842710b24929922db4a529eecd40"]}}})),this.runTests()}}toggleUpsellNextOrder(e){return r=>{let o=document.querySelectorAll("og-offer")[e],s=o.product.id;r.preventDefault(),o.store.dispatch(vr({count:1,next:null,previous:null,results:[{order:"24d50352579511ea806cbc764e100cfd",offer:null,subscription:"8a076b7a0ea011e7a5bcbc764e105eda",product:s,components:[],quantity:1,public_id:"24d6901e579511ea806cbc764e100cfd",product_attribute:null,price:"14.99",extra_cost:"0.00",total_price:"13.49",one_time:!1,frozen:!1,first_placed:null}]})),this.runTests()}}render(){return p`
103
+ `)}toggleUpsellPreview(e){return r=>{r.preventDefault();let o=document.querySelectorAll("og-offer")[e];o.getAttribute("preview-upsell-offer")?o.removeAttribute("preview-upsell-offer"):o.setAttribute("preview-upsell-offer",!0),this.runTests()}}toggleProductFlags(e,{inStock:r=!0,autoship:o=!0,groups:s=["subscription","upsell"]}){return i=>{i.preventDefault();let a=document.querySelectorAll("og-offer")[e],c=a.product.id;a.store.dispatch(Te({in_stock:{[c]:r},eligibility_groups:{[c]:s},result:"success",autoship:{[c]:o},module_view:{regular:"58a01e9aacbe40389b5c7325d79091bb"},modifiers:{},incentives_display:{"47c01e9aacbe40389b5c7325d79091aa":{field:"sub_total",object:"order",type:"Discount Percent",value:5},e6534b9d877f41e586c37b7d8abc3a58:{field:"total_price",object:"item",type:"Discount Percent",value:5},f35e842710b24929922db4a529eecd40:{field:"total_price",object:"item",type:"Discount Percent",value:10},"5be321d7c17f4e18a757212b9a20bfcc":{field:"total_price",object:"item",type:"Discount Percent",value:1}},incentives:{[c]:{initial:["5be321d7c17f4e18a757212b9a20bfcc"],ongoing:["e6534b9d877f41e586c37b7d8abc3a58","47c01e9aacbe40389b5c7325d79091aa","f35e842710b24929922db4a529eecd40"]}}})),this.runTests()}}toggleUpsellNextOrder(e){return r=>{let o=document.querySelectorAll("og-offer")[e],s=o.product.id;r.preventDefault(),o.store.dispatch(xr({count:1,next:null,previous:null,results:[{order:"24d50352579511ea806cbc764e100cfd",offer:null,subscription:"8a076b7a0ea011e7a5bcbc764e105eda",product:s,components:[],quantity:1,public_id:"24d6901e579511ea806cbc764e100cfd",product_attribute:null,price:"14.99",extra_cost:"0.00",total_price:"13.49",one_time:!1,frozen:!1,first_placed:null}]})),this.runTests()}}render(){return u`
104
104
  <div>
105
- ${this.testsRan?this.resultsCodeBlock():p`
105
+ ${this.testsRan?this.resultsCodeBlock():u`
106
106
  <div>Click the button to run tests</div>
107
107
  `}
108
108
  <button ?disabled=${this.disabled} @click="${this.runTests.bind(this)}" class="primary">Run Test</button>
109
109
  </div>
110
- `}};n(or,"TestWizard");tl=or});var sl={};nr(sl,{addOptinChangedCallback:()=>Xs,addTemplate:()=>si,clear:()=>Zs,config:()=>oi,default:()=>nl,disableOptinChangedCallbacks:()=>ei,getOptins:()=>Ks,getProductsForPurchasePost:()=>Js,initialize:()=>_o,offers:()=>E,previewMode:()=>ri,register:()=>ti,resolveSettings:()=>ci,setAuthUrl:()=>Qs,setEnvironment:()=>Ws,setLocale:()=>ni,setMerchantId:()=>Ys,setPublicPath:()=>ai,setTemplates:()=>ii});var bi=Object.create,De=Object.defineProperty,_i=Object.getOwnPropertyDescriptor,xi=Object.getOwnPropertyNames,wo=Object.getOwnPropertySymbols,Ei=Object.getPrototypeOf,Oo=Object.prototype.hasOwnProperty,Si=Object.prototype.propertyIsEnumerable,To=n((t,e,r)=>e in t?De(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,"d"),vi=n((t,e)=>{for(var r in e||(e={}))Oo.call(e,r)&&To(t,r,e[r]);if(wo)for(var r of wo(e))Si.call(e,r)&&To(t,r,e[r]);return t},"c"),wi=n(t=>De(t,"__esModule",{value:!0}),"E"),st=n((t,e)=>De(t,"name",{value:e,configurable:!0}),"r"),Oi=(t=>typeof ne!="undefined"?ne:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof ne!="undefined"?ne:e)[r]}):t)(function(t){if(typeof ne!="undefined")return ne.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),Ti=n((t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of xi(e))!Oo.call(t,o)&&o!=="default"&&De(t,o,{get:()=>e[o],enumerable:!(r=_i(e,o))||r.enumerable});return t},"x"),Ci=n(t=>Ti(wi(De(t!=null?bi(Ei(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),"v"),Pi=st(t=>e=>t.indexOf(e.origin)>=0,"createIsMessageAllowed"),Co=["https://rc3.ordergroove.com","https://rc3.stg.ordergroove.com","http://localhost:3000",window.location.origin],Po=st(t=>(e,r)=>{Co.forEach(o=>t.postMessage(vi({ogType:e},r),o))},"createBroadcastMessage");function sr(t){let e=Pi(Co),r=Po(t.source);e(t)&&t.data.ogType==="READY"&&Promise.resolve().then(()=>Ci(Oi("//static.ordergroove.com/@ordergroove/offers-live-editor/0.4.1/dist/client.js"))).then(({initializeClient:o})=>{o(e,r),window.removeEventListener("message",sr)})}n(sr,"f");st(sr,"handleReady");function ir(t=window.opener){t&&t!==window&&(window.addEventListener("message",sr),Po(t)("READY"))}n(ir,"I");st(ir,"offersLiveEditor");function ar(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(ar,"symbolObservablePonyfill");var Se;typeof self!="undefined"?Se=self:typeof window!="undefined"||typeof window!="undefined"?Se=window:typeof module!="undefined"?Se=module:Se=Function("return this")();var Ri=ar(Se),cr=Ri;var lr=n(function(){return Math.random().toString(36).substring(7).split("").join(".")},"randomString"),Fe={INIT:"@@redux/INIT"+lr(),REPLACE:"@@redux/REPLACE"+lr(),PROBE_UNKNOWN_ACTION:n(function(){return"@@redux/PROBE_UNKNOWN_ACTION"+lr()},"PROBE_UNKNOWN_ACTION")};function Ai(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(Ai,"isPlainObject");function ur(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(ur)(t,e)}if(typeof t!="function")throw new Error("Expected the reducer to be a function.");var s=t,i=e,a=[],c=a,u=!1;function f(){c===a&&(c=a.slice())}n(f,"ensureCanMutateNextListeners");function b(){if(u)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(b,"getState");function d(m){if(typeof m!="function")throw new Error("Expected the listener to be a function.");if(u)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 C=!0;return f(),c.push(m),n(function(){if(!!C){if(u)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.");C=!1,f();var x=c.indexOf(m);c.splice(x,1),a=null}},"unsubscribe")}n(d,"subscribe");function y(m){if(!Ai(m))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(typeof m.type=="undefined")throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(u)throw new Error("Reducers may not dispatch actions.");try{u=!0,i=s(i,m)}finally{u=!1}for(var C=a=c,P=0;P<C.length;P++){var x=C[P];x()}return m}n(y,"dispatch");function v(m){if(typeof m!="function")throw new Error("Expected the nextReducer to be a function.");s=m,y({type:Fe.REPLACE})}n(v,"replaceReducer");function _(){var m,C=d;return m={subscribe:n(function(x){if(typeof x!="object"||x===null)throw new TypeError("Expected the observer to be an object.");function A(){x.next&&x.next(b())}n(A,"observeState"),A();var li=C(A);return{unsubscribe:li}},"subscribe")},m[cr]=function(){return this},m}return n(_,"observable"),y({type:Fe.INIT}),o={dispatch:y,subscribe:d,getState:b,replaceReducer:v},o[cr]=_,o}n(ur,"createStore");function Ni(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(Ni,"getUndefinedStateErrorMessage");function ki(t){Object.keys(t).forEach(function(e){var r=t[e],o=r(void 0,{type:Fe.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:Fe.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error('Reducer "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle "+Fe.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(ki,"assertReducerShape");function Ro(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),a,c;try{ki(r)}catch(u){c=u}return n(function(f,b){if(f===void 0&&(f={}),c)throw c;if(!1)var d;for(var y=!1,v={},_=0;_<i.length;_++){var m=i[_],C=r[m],P=f[m],x=C(P,b);if(typeof x=="undefined"){var A=Ni(m,b);throw new Error(A)}v[m]=x,y=y||x!==P}return y=y||i.length!==Object.keys(f).length,y?v:f},"combination")}n(Ro,"combineReducers");function Ao(t,e){return function(){return e(t.apply(this,arguments))}}n(Ao,"bindActionCreator");function No(t,e){if(typeof t=="function")return Ao(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]=Ao(s,e))}return r}n(No,"bindActionCreators");function Ii(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n(Ii,"_defineProperty");function ko(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(ko,"ownKeys");function qi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ko(r,!0).forEach(function(o){Ii(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ko(r).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}n(qi,"_objectSpread2");function pr(){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(pr,"compose");function Io(){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"),a={getState:s.getState,dispatch:n(function(){return i.apply(void 0,arguments)},"dispatch")},c=e.map(function(u){return u(a)});return i=pr.apply(void 0,c)(s.dispatch),qi({},s,{dispatch:i})}}}n(Io,"applyMiddleware");var it=null,Ui=n(t=>({dispatch:t}),"defaultMapDispatchToProps"),qo=n(t=>{if(!it)throw new Error("Missing redux store.");return it},"resolveStore"),Di=n((t,e)=>r=>{let{getState:o,dispatch:s}=qo(r),i=t?t(o(),r):{},a=e(s,r);Object.assign(r,i,a)},"createRecalcProps"),g=n((t,e=Ui)=>r=>{let s=Di(t,typeof e=="function"?e:i=>No(e,i));return class extends r{get store(){return it}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=qo(this).subscribe(()=>s(this)),s(this)}attributeChangedCallback(i,a,c){super.attributeChangedCallback&&super.attributeChangedCallback(i,a,c),this._storeUnsubscribe&&a!==c&&s(this)}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}}},"connect"),Uo=n(t=>{it=t},"setStore");function Do(t){var e=n(function(o){var s=o.dispatch,i=o.getState;return function(a){return function(c){return typeof c=="function"?c(s,i,t):a(c)}}},"middleware");return e}n(Do,"createThunkMiddleware");var Fo=Do();Fo.withExtraArgument=Do;var Lo=Fo;ue();function Fi(t,e){return t===e}n(Fi,"defaultEqualityCheck");function Li(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(Li,"areArgumentsShallowlyEqual");function ji(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fi,r=null,o=null;return function(){return Li(e,r,arguments)||(o=t.apply(null,arguments)),r=arguments,o}}n(ji,"defaultMemoize");function Mi(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(Mi,"getDependencies");function Vi(t){for(var e=arguments.length,r=Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];return function(){for(var s=arguments.length,i=Array(s),a=0;a<s;a++)i[a]=arguments[a];var c=0,u=i.pop(),f=Mi(i),b=t.apply(void 0,[function(){return c++,u.apply(null,arguments)}].concat(r)),d=t(function(){for(var y=[],v=f.length,_=0;_<v;_++)y.push(f[_].apply(null,arguments));return b.apply(null,y)});return d.resultFunc=u,d.dependencies=f,d.recomputations=function(){return c},d.resetRecomputations=function(){return c=0},d}}n(Vi,"createSelectorCreator");var Oe=Vi(ji);var fe=Ee(Ct());J();fe.default.Cache=Map;function Na(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(Na,"arraysEqual");var N=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))||Na((t.components||[]).sort(),(e.components||[]).sort()))),"isSameProduct"),At=n(t=>t.optedin||[],"optedinSelector"),nn=n(t=>t.optedout||[],"optedoutSelector"),yr=n(t=>t.autoshipByDefault||{},"autoshipSelector"),ka=n(t=>t.defaultFrequencies||{},"defaultFrequenciesSelector"),B=(0,fe.default)(t=>Oe(At,nn,yr,(e,r,o)=>{let s=e.find(i=>N(t,i));return s||(r.find(i=>N(t,i))?!1:t&&o[t.id]?{id:t.id}:!1)}),t=>JSON.stringify(t)),sn=(0,fe.default)(t=>Oe(At,e=>{let r=e.find(o=>N(t,o));return r||!1}),t=>JSON.stringify(t)),an=(0,fe.default)(t=>Oe(nn,e=>e.find(r=>N(t,r))));var V=(0,fe.default)(t=>Oe(B(t),e=>e&&e.frequency||null)),Nt=(0,fe.default)(t=>Oe(ka,e=>e[t]&&ze(e[t])||null)),br=n(t=>t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),"kebabCase"),H=n((t,e,r,o)=>({[r]:e&&e.hasAttribute&&e.hasAttribute(br(r))&&e[r]||e.offer&&typeof(e.offer[r]!=="undefined")&&e.offer[r]||t.config&&t.config[r]||o}),"configSelector"),Ce=n(t=>({templates:t.templates||[]}),"templatesSelector");J();var Ia=n((t=[],e)=>{switch(e.type){case Y:return[];case le:return e.newValue?e.newValue.optedin:t;case ie:case ce:let[[r],o]=t.reduce((s,i)=>s[N(e.payload.product,i)?0:1].push(i)&&s,[[],[]]);return(o||[]).concat(h(l(l({},r),e.payload.product),{frequency:e.payload.frequency}));case ae:return t.filter(s=>!N(e.payload.product,s));case Le:return t.map(s=>N(e.payload.product,s)?l(l({},s),e.payload.newProduct):s);case yt:return t.filter(s=>!N(e.payload.product,s));case we:return[];default:return t}},"optedin"),qa=n((t=[],e)=>{switch(e.type){case Y:return[];case le:return e.newValue?e.newValue.optedout:t;case ie:case ce:return t.filter(s=>!N(e.payload.product,s));case ae:let[[r],o]=t.reduce((s,i)=>s[N(e.payload.product,i)?0:1].push(i)&&s,[[],[]]);return(o||[]).concat(h(l(l({},r),e.payload.product),{frequency:e.payload.frequency}));case Le:return t.map(s=>N(e.payload.product,s)?l(l({},s),e.payload.newProduct):s);case we:return[];default:return t}},"optedout"),Ua=n((t={},{type:e,payload:r})=>{switch(e){case pt:return r&&r.count>0?l(l({},t),r.results[0]&&h(l({},r.results[0]),{place:new Date(Date.parse(r.results[0].place.replace(/-/gi,"/")))})):t;case dt:return h(l({},t),{products:(r.results||[]).map(o=>o.product)});case gt:return l(h(l(l({},t),r),{public_id:r.order}),r.product&&{products:(t.products||[]).concat(r.product)});default:return t}},"nextUpcomingOrder"),Da=n((t={},e)=>{switch(e.type){case D:return l(l({},t),e.payload.autoship);default:return t}},"autoshipEligible"),Fa=n((t={},e)=>{switch(e.type){case D:return l(l({},t),e.payload.in_stock);default:return t}},"inStock"),La=n((t={},e)=>{switch(e.type){case D:return l(l({},t),e.payload.eligibility_groups);default:return t}},"eligibilityGroups"),cn=n((t,e)=>t.map(r=>h(l({},e[r]),{id:[r][0]})),"mapIncentive"),ja=n((t={},e)=>{switch(e.type){case D:return l(l({},t),[...new Set(Object.keys(e.payload.incentives||{}))].reduce((r,o)=>h(l({},r),{[o]:Object.entries(e.payload.incentives).filter(([s])=>s===o).reduce((s,[,{initial:i,ongoing:a}])=>h(l({},s),{initial:[...s.initial||[],...cn(i,e.payload.incentives_display)],ongoing:[...s.ongoing||[],...cn(a,e.payload.incentives_display)]}),{})}),{}));default:return t}},"incentives");var Ma=n((t=!1,e)=>{switch(e.type){case ut:return l({},e.payload);case ve:return!1;default:return t}},"auth"),Va=n((t="",e)=>{switch(e.type){case at:return e.payload;default:return t}},"merchantId"),$a=n((t=null,e)=>{switch(e.type){case lt:return e.payload;default:return t}},"authUrl"),Ba=n((t={},e)=>{switch(e.type){case D:return l(h(l({},t),{offerId:(e.payload.module_view||{}).regular}),e.payload.modifiers);default:return t}},"offer"),Ha=n((t="",e)=>{switch(e.type){case D:return(e.payload.module_view||{}).regular||"";default:return t}},"offerId"),za=n((t=null,e)=>{switch(e.type){case Y:return null;case ct:return e.payload;default:return t}},"sessionId"),Ga=n((t={},e)=>{switch(e.type){case D:return l(l({},t),Object.entries(e.payload.autoship).map(([r])=>({[r]:Object.keys(e.payload.modifiers)})).reduce((r,o)=>l(l({},r),o)));case we:return{};default:return t}},"productOffer"),Wa=n((t={},e)=>{switch(e.type){case St:return h(l({},t),{[e.payload.product]:e.payload.firstOrderPlaceDate});default:return t}},"firstOrderPlaceDate"),Ya=n((t={},e)=>{switch(e.type){case vt:return h(l({},t),{[e.payload.product]:e.payload.productToSubscribe});default:return t}},"productToSubscribe"),_r=n((t={},e)=>{switch(e.type){case ft:return h(l({},t),{name:"staging",apiUrl:"https://staging.om.ordergroove.com",legoUrl:"https://staging.restapi.ordergroove.com"});case ht:return h(l({},t),{name:"dev",apiUrl:"https://dev.om.ordergroove.com",legoUrl:"https://dev.restapi.ordergroove.com"});case mt:return h(l({},t),{name:"prod",apiUrl:"https://om.ordergroove.com",legoUrl:"https://restapi.ordergroove.com"});default:return t}},"environment"),Qa=n((t={offerOptInLabel:"Subscribe and Save",offerIncentiveText:"Save {{ogIncentive DiscountPercent}} when you subscribe",offerOptOutLabel:"Deliver one-time only",offerEveryLabel:"Delivery Every",offerTooltipTrigger:"[?]",offerTooltipContent:"Seems this is a great subscription offering. Many fun details about this program exist.",optinButtonLabel:"\u2022",optoutButtonLabel:"\u2022",optinStatusOptedInLabel:"You're opted in!",optinStatusOptedOutLabel:"You're not opted in.",optinToggleLabel:"\u2022",upsellButtonLabel:"Add item to order on ",upsellButtonPrefix:"",upsellModalContent:"Some upsell modal content",upsellModalOptInLabel:"Subscribe",upsellModalOptOutLabel:"Purchase one time",upsellModalTitle:"Impulse Upsell",upsellModalConfirmLabel:"Ok",upsellModalCancelLabel:"Cancel",defaultFrequencyCopy:"(Most Popular)",frequencyPeriods:{"1":"day","2":"week","3":"month"}},e)=>{switch(e.type){case bt:return l(l({},t),e.payload);default:return t}},"locale"),Ja=n((t={frequencies:["1_2","1_2","1_3"],offerType:"radio"},e)=>{switch(e.type){case _t:return h(l(l({},t),e.payload),{defaultFrequency:e.payload.defaultFrequency?ze(e.payload.defaultFrequency):t.defaultFrequency,frequencies:e.payload.frequencies?e.payload.frequencies.map(ze):t.frequencies});default:return t}},"config"),Ka=n((t=!1,e)=>{switch(e.type){case je:return e.payload;default:return t}},"previewStandardOffer"),Za=n((t=!1,e)=>{switch(e.type){case Me:return e.payload;default:return t}},"previewUpsellOffer"),Xa=n((t=[],e)=>{switch(e.type){case D:return l(l({},t),e.payload.autoship_by_default);default:return t}},"autoshipByDefault"),ec=n((t=[],e)=>{switch(e.type){case D:return l(l({},t),e.payload.default_frequencies);default:return t}},"defaultFrequencies"),tc=n((t=[],e)=>{switch(e.type){case Et:return[...e.payload||[]];case xt:return[e.payload,...t];default:return t}},"templates"),rc=n((t={},e)=>{switch(e.type){case wt:return l({},e.payload);default:return t}},"productPlans"),ln=Ro({productPlans:rc,environment:_r,optedin:Ia,optedout:qa,merchantId:Va,offer:Ba,offerId:Ha,productOffer:Ga,sessionId:za,inStock:Fa,eligibilityGroups:La,autoshipByDefault:Xa,autoshipEligible:Da,incentives:ja,nextUpcomingOrder:Ua,auth:Ma,authUrl:$a,locale:Qa,config:Ja,previewStandardOffer:Ka,previewUpsellOffer:Za,templates:tc,defaultFrequencies:ec,firstOrderPlaceDate:Wa,productToSubscribe:Ya});var Rn=Ee(xr());I();ue();var Ge="OG_STATE",An=n(t=>{try{return t===null?void 0:JSON.parse(t)}catch(e){return}},"safeParseState"),Tr=n(()=>window.og&&window.og.previewMode,"isPreviewMode"),Nn=n(()=>Tr()?{}:An(localStorage.getItem(Ge)),"loadState"),mc=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"),kn=n(t=>{if(Tr())return;let e=mc(t);e&&localStorage.getItem(Ge)!==e&&localStorage.setItem(Ge,e)},"saveState"),In=n(t=>(0,Rn.throttle)(500,e=>{if(Tr())return;let{key:r,newValue:o}=e;r===Ge&&o===null?(t.dispatch({type:Y}),setTimeout(()=>t.dispatch(Ft()),0)):r===Ge&&t.dispatch({type:le,newValue:An(o)})}),"listenLocalStorageChanges");var qn=Ee(xr());ue();var gc=n((t,e,r=document)=>r.dispatchEvent(new CustomEvent(t,{detail:e})),"dispatchEvent"),Un=n(t=>({payload:{product:{id:e,components:r}={}}={}}={})=>setTimeout(()=>gc("optin-changed",{productId:e,components:r,optedIn:t}),0),"dispatchOptinChangedEvent"),yc=[{expressions:[({type:t}={})=>t===ie,({type:t}={})=>t===ce],fn:Un(!0)},{expressions:[({type:t}={})=>t===ae],fn:Un(!1)}],Dn=n(t=>e=>r=>{let o=t.getState();yc.forEach(s=>{s.expressions.some(i=>i(r,o))&&s.fn(r)}),e(r)},"dispatchMiddleware"),Fn=n(t=>e=>r=>{e(r);let o=(0,qn.throttle)(500,()=>{kn(l({},t.getState()))});r.type!==le&&o()},"localStorageMiddleware");function Ln(){if(window.og&&window.og.store)return window.og.store;let t=window.og&&window.og.previewMode,e=typeof window=="object"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):pr,r=[Lo,Dn];t||r.push(Fn);let o=e(Io(...r)),s=ur(ln,t?{}:Nn(),o);return window.og=window.og||{},window.og.store=s,s}n(Ln,"getStore");J();var Cr=n((t={},e=[])=>(t.optedin||[]).map(r=>{let o={product:r.id,subscription_info:{components:r.components||[]},tracking_override:l({offer:((t.productOffer||{})[r.id]||[])[0]},He(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");I();O();var xs=Ee(ds());O();var Uc=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"),fs=n(t=>t.hasAttribute("product")&&l({id:t.getAttribute("product")},t.hasAttribute("product-components")&&{components:JSON.parse(t.getAttribute("product-components"))}),"buildProduct");var Jr=n(t=>{let e=fs(t);if(!e){let r=t.offer;r&&(e=fs(r))}return e},"resolveProduct"),Dc=n(t=>{let e=t;for(;e;){if(e.tagName==="OG-OFFER")return e;e=e.nodeType===11?e.host:e.parentNode}},"resolveOffer"),Kr=n(t=>class extends t{get offer(){return Dc(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 Kr(t){get product(){return Jr(this)}},"withProduct"),Kt=n(t=>class extends t{get childOptions(){return this._childOptions||{options:[]}}connectedCallback(){let e=[],r=null;this.querySelectorAll("option").forEach(o=>{let s=Uc(o.value),i=o.innerText.trim();e.push({value:s,text:i}),!r&&o.selected&&(r=s)}),this._childOptions={options:e,isSelected:r},super.connectedCallback&&super.connectedCallback()}},"withChildOptions");var Zt={};nr(Zt,{eligibilityGroups:()=>gs,eligible:()=>hs,hasUpcomingOrder:()=>bs,hasUpsellGroup:()=>ys,inStock:()=>Zr,regularEligible:()=>jc,subscribed:()=>Fc,subscriptionEligible:()=>ms,upcomingOrderContainsProduct:()=>Lc,upsellEligible:()=>_s});var Zr=n((t,e)=>(t.inStock||{})[(e.product||{}).id],"inStock"),hs=n((t,e)=>(t.autoshipEligible||{})[(e.product||{}).id]||!1,"eligible"),ms=n((t,e)=>(t.offerId&&t.offerId!=="0"||!1)&&hs(t,e)&&Zr(t,e),"subscriptionEligible"),gs=n((t,e)=>(t.eligibilityGroups||{})[(e.product||{}).id]||null,"eligibilityGroups"),ys=n((t,e)=>{let r=gs(t,e);return r===null||!!r.find(o=>o==="upsell"||o==="impulse_upsell")},"hasUpsellGroup"),Fc=n((t,e)=>sn(e.product)(t),"subscribed"),bs=n(t=>!!(t.nextUpcomingOrder&&t.nextUpcomingOrder.public_id),"hasUpcomingOrder"),Lc=n((t,e)=>(t.nextUpcomingOrder&&t.nextUpcomingOrder.products||[]).includes((e.product||{}).id),"upcomingOrderContainsProduct"),_s=n((t,e)=>t.offerId&&t.offerId!=="0"&&t.auth&&Zr(t,e)&&bs(t)&&ys(t,e),"upsellEligible"),jc=n((t,e)=>ms(t,e)&&!_s(t,e),"regularEligible");var Mc=n(t=>t.replace(/(\r\n|\n|\r|\s)+/gm,""),"removeWhitespace"),Xr=class extends k(S){static get properties(){return h(l({},super.properties),{state:{type:Object,attribute:!1},test:{type:String}})}render(){return this.test&&xs.default.parse(Mc(this.test),r=>Zt[r]&&Zt[r](this.state,this))?p`
110
+ `}};n(er,"TestWizard");Fc=er});var Vc={};tr(Vc,{addOptinChangedCallback:()=>Bs,addTemplate:()=>Qs,clear:()=>$s,config:()=>Ws,default:()=>Mc,disableOptinChangedCallbacks:()=>Hs,getOptins:()=>Vs,getProductsForPurchasePost:()=>Ms,initialize:()=>go,offers:()=>_,previewMode:()=>Gs,register:()=>zs,resolveSettings:()=>Zs,setAuthUrl:()=>js,setEnvironment:()=>Fs,setLocale:()=>Ys,setMerchantId:()=>Ls,setPublicPath:()=>Ks,setTemplates:()=>Js});var ai=Object.defineProperty,tt=n((t,e)=>ai(t,"name",{value:e,configurable:!0}),"s"),ci=tt(t=>e=>t.indexOf(e.origin)>=0,"createIsMessageAllowed"),bo=["https://rc3.ordergroove.com","https://rc3.stg.ordergroove.com","http://localhost:3000",window.location.origin],_o=tt(t=>(e,r)=>{bo.forEach(o=>t.postMessage({ogType:e,...r},o))},"createBroadcastMessage");function rr(t){let e=ci(bo),r=_o(t.source);e(t)&&t.data.ogType==="READY"&&import("//static.ordergroove.com/@ordergroove/offers-live-editor/0.4.1/dist/client.js").then(({initializeClient:o})=>{o(e,r),window.removeEventListener("message",rr)})}n(rr,"d");tt(rr,"handleReady");function or(t=window.opener){t&&t!==window&&(window.addEventListener("message",rr),_o(t)("READY"))}n(or,"l");tt(or,"offersLiveEditor");function nr(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(nr,"symbolObservablePonyfill");var be;typeof self!="undefined"?be=self:typeof window!="undefined"||typeof window!="undefined"?be=window:typeof module!="undefined"?be=module:be=Function("return this")();var li=nr(be),sr=li;var ir=n(function(){return Math.random().toString(36).substring(7).split("").join(".")},"randomString"),Ie={INIT:"@@redux/INIT"+ir(),REPLACE:"@@redux/REPLACE"+ir(),PROBE_UNKNOWN_ACTION:n(function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ir()},"PROBE_UNKNOWN_ACTION")};function ui(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(ui,"isPlainObject");function ar(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(ar)(t,e)}if(typeof t!="function")throw new Error("Expected the reducer to be a function.");var s=t,i=e,a=[],c=a,l=!1;function d(){c===a&&(c=a.slice())}n(d,"ensureCanMutateNextListeners");function g(){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(g,"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 T=!0;return d(),c.push(f),n(function(){if(!!T){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.");T=!1,d();var b=c.indexOf(f);c.splice(b,1),a=null}},"unsubscribe")}n(p,"subscribe");function m(f){if(!ui(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 T=a=c,O=0;O<T.length;O++){var b=T[O];b()}return f}n(m,"dispatch");function E(f){if(typeof f!="function")throw new Error("Expected the nextReducer to be a function.");s=f,m({type:Ie.REPLACE})}n(E,"replaceReducer");function y(){var f,T=p;return f={subscribe:n(function(b){if(typeof b!="object"||b===null)throw new TypeError("Expected the observer to be an object.");function P(){b.next&&b.next(g())}n(P,"observeState"),P();var Xs=T(P);return{unsubscribe:Xs}},"subscribe")},f[sr]=function(){return this},f}return n(y,"observable"),m({type:Ie.INIT}),o={dispatch:m,subscribe:p,getState:g,replaceReducer:E},o[sr]=y,o}n(ar,"createStore");function pi(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(pi,"getUndefinedStateErrorMessage");function di(t){Object.keys(t).forEach(function(e){var r=t[e],o=r(void 0,{type:Ie.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:Ie.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error('Reducer "'+e+'" returned undefined when probed with a random type. '+("Don't try to handle "+Ie.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(di,"assertReducerShape");function xo(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),a,c;try{di(r)}catch(l){c=l}return n(function(d,g){if(d===void 0&&(d={}),c)throw c;if(!1)var p;for(var m=!1,E={},y=0;y<i.length;y++){var f=i[y],T=r[f],O=d[f],b=T(O,g);if(typeof b=="undefined"){var P=pi(f,g);throw new Error(P)}E[f]=b,m=m||b!==O}return m=m||i.length!==Object.keys(d).length,m?E:d},"combination")}n(xo,"combineReducers");function Eo(t,e){return function(){return e(t.apply(this,arguments))}}n(Eo,"bindActionCreator");function So(t,e){if(typeof t=="function")return Eo(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]=Eo(s,e))}return r}n(So,"bindActionCreators");function fi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n(fi,"_defineProperty");function vo(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(vo,"ownKeys");function hi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vo(r,!0).forEach(function(o){fi(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vo(r).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}n(hi,"_objectSpread2");function cr(){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(cr,"compose");function wo(){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"),a={getState:s.getState,dispatch:n(function(){return i.apply(void 0,arguments)},"dispatch")},c=e.map(function(l){return l(a)});return i=cr.apply(void 0,c)(s.dispatch),hi({},s,{dispatch:i})}}}n(wo,"applyMiddleware");var rt=null,mi=n(t=>({dispatch:t}),"defaultMapDispatchToProps"),To=n(t=>{if(!rt)throw new Error("Missing redux store.");return rt},"resolveStore"),gi=n((t,e)=>r=>{let{getState:o,dispatch:s}=To(r),i=t?t(o(),r):{},a=e(s,r);Object.assign(r,i,a)},"createRecalcProps"),h=n((t,e=mi)=>r=>{let s=gi(t,typeof e=="function"?e:i=>So(e,i));return class extends r{get store(){return rt}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._storeUnsubscribe=To(this).subscribe(()=>s(this)),s(this)}attributeChangedCallback(i,a,c){super.attributeChangedCallback&&super.attributeChangedCallback(i,a,c),this._storeUnsubscribe&&a!==c&&s(this)}disconnectedCallback(){this._storeUnsubscribe(),super.disconnectedCallback&&super.disconnectedCallback()}}},"connect"),Oo=n(t=>{rt=t},"setStore");function Co(t){var e=n(function(o){var s=o.dispatch,i=o.getState;return function(a){return function(c){return typeof c=="function"?c(s,i,t):a(c)}}},"middleware");return e}n(Co,"createThunkMiddleware");var Po=Co();Po.withExtraArgument=Co;var Ro=Po;ce();function yi(t,e){return t===e}n(yi,"defaultEqualityCheck");function bi(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(bi,"areArgumentsShallowlyEqual");function _i(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yi,r=null,o=null;return function(){return bi(e,r,arguments)||(o=t.apply(null,arguments)),r=arguments,o}}n(_i,"defaultMemoize");function xi(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(xi,"getDependencies");function Ei(t){for(var e=arguments.length,r=Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];return function(){for(var s=arguments.length,i=Array(s),a=0;a<s;a++)i[a]=arguments[a];var c=0,l=i.pop(),d=xi(i),g=t.apply(void 0,[function(){return c++,l.apply(null,arguments)}].concat(r)),p=t(function(){for(var m=[],E=d.length,y=0;y<E;y++)m.push(d[y].apply(null,arguments));return g.apply(null,m)});return p.resultFunc=l,p.dependencies=d,p.recomputations=function(){return c},p.resetRecomputations=function(){return c=0},p}}n(Ei,"createSelectorCreator");var Ee=Ei(_i);var pe=oe(vt());Y();pe.default.Cache=Map;function pa(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(pa,"arraysEqual");var R=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))||pa((t.components||[]).sort(),(e.components||[]).sort()))),"isSameProduct"),Ot=n(t=>t.optedin||[],"optedinSelector"),Qo=n(t=>t.optedout||[],"optedoutSelector"),hr=n(t=>t.autoshipByDefault||{},"autoshipSelector"),da=n(t=>t.defaultFrequencies||{},"defaultFrequenciesSelector"),V=(0,pe.default)(t=>Ee(Ot,Qo,hr,(e,r,o)=>{let s=e.find(i=>R(t,i));return s||(r.find(i=>R(t,i))?!1:t&&o[t.id]?{id:t.id}:!1)}),t=>JSON.stringify(t)),Jo=(0,pe.default)(t=>Ee(Ot,e=>{let r=e.find(o=>R(t,o));return r||!1}),t=>JSON.stringify(t)),Ct=(0,pe.default)(t=>Ee(Qo,e=>e.find(r=>R(t,r))));var j=(0,pe.default)(t=>Ee(V(t),e=>e&&e.frequency||null)),Pt=(0,pe.default)(t=>Ee(da,e=>e[t]&&Ve(e[t])||null)),mr=n(t=>t.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),"kebabCase"),$=n((t,e,r,o)=>({[r]:e&&e.hasAttribute&&e.hasAttribute(mr(r))&&e[r]||e.offer&&typeof(e.offer[r]!=="undefined")&&e.offer[r]||t.config&&t.config[r]||o}),"configSelector"),ve=n(t=>({templates:t.templates||[]}),"templatesSelector");Y();var fa=n((t=[],e)=>{switch(e.type){case G:return[];case ae:return e.newValue?e.newValue.optedin:t;case ne:case ie:let[[r],o]=t.reduce((s,i)=>s[R(e.payload.product,i)?0:1].push(i)&&s,[[],[]]);return(o||[]).concat({...r,...e.payload.product,frequency:e.payload.frequency});case se:return t.filter(s=>!R(e.payload.product,s));case qe:return t.map(s=>R(e.payload.product,s)?{...s,...e.payload.newProduct}:s);case ft:return t.filter(s=>!R(e.payload.product,s));case xe:return[];default:return t}},"optedin"),ha=n((t=[],e)=>{switch(e.type){case G:return[];case ae:return e.newValue?e.newValue.optedout:t;case ne:case ie:return t.filter(s=>!R(e.payload.product,s));case se:let[[r],o]=t.reduce((s,i)=>s[R(e.payload.product,i)?0:1].push(i)&&s,[[],[]]);return(o||[]).concat({...r,...e.payload.product,frequency:e.payload.frequency});case qe:return t.map(s=>R(e.payload.product,s)?{...s,...e.payload.newProduct}:s);case xe:return[];default:return t}},"optedout"),ma=n((t={},{type:e,payload:r})=>{switch(e){case at:return r&&r.count>0?{...t,...r.results[0]&&{...r.results[0],place:new Date(Date.parse(r.results[0].place.replace(/-/gi,"/")))}}:t;case ct:return{...t,products:(r.results||[]).map(o=>o.product)};case dt:return{...t,...r,public_id:r.order,...r.product&&{products:(t.products||[]).concat(r.product)}};default:return t}},"nextUpcomingOrder"),ga=n((t={},e)=>{switch(e.type){case q:return{...t,...e.payload.autoship};default:return t}},"autoshipEligible"),ya=n((t={},e)=>{switch(e.type){case q:return{...t,...e.payload.in_stock};default:return t}},"inStock"),ba=n((t={},e)=>{switch(e.type){case q:return{...t,...e.payload.eligibility_groups};default:return t}},"eligibilityGroups"),Ko=n((t,e)=>t.map(r=>({...e[r],id:[r][0]})),"mapIncentive"),_a=n((t={},e)=>{switch(e.type){case q:return{...t,...[...new Set(Object.keys(e.payload.incentives||{}))].reduce((r,o)=>({...r,[o]:Object.entries(e.payload.incentives).filter(([s])=>s===o).reduce((s,[,{initial:i,ongoing:a}])=>({...s,initial:[...s.initial||[],...Ko(i,e.payload.incentives_display)],ongoing:[...s.ongoing||[],...Ko(a,e.payload.incentives_display)]}),{})}),{})};default:return t}},"incentives");var xa=n((t=!1,e)=>{switch(e.type){case it:return{...e.payload};case _e:return!1;default:return t}},"auth"),Ea=n((t="",e)=>{switch(e.type){case ot:return e.payload;default:return t}},"merchantId"),Sa=n((t=null,e)=>{switch(e.type){case st:return e.payload;default:return t}},"authUrl"),va=n((t={},e)=>{switch(e.type){case q:return{...t,offerId:(e.payload.module_view||{}).regular,...e.payload.modifiers};default:return t}},"offer"),wa=n((t="",e)=>{switch(e.type){case q:return(e.payload.module_view||{}).regular||"";default:return t}},"offerId"),Ta=n((t=null,e)=>{switch(e.type){case G:return null;case nt:return e.payload;default:return t}},"sessionId"),Oa=n((t={},e)=>{switch(e.type){case q:return{...t,...Object.entries(e.payload.autoship).map(([r])=>({[r]:Object.keys(e.payload.modifiers)})).reduce((r,o)=>({...r,...o}))};case xe:return{};default:return t}},"productOffer"),Ca=n((t={},e)=>{switch(e.type){case bt:return{...t,[e.payload.product]:e.payload.firstOrderPlaceDate};default:return t}},"firstOrderPlaceDate"),Pa=n((t={},e)=>{switch(e.type){case _t:return{...t,[e.payload.product]:e.payload.productToSubscribe};default:return t}},"productToSubscribe"),gr=n((t={},e)=>{switch(e.type){case lt:return{...t,name:"staging",apiUrl:"https://staging.om.ordergroove.com",legoUrl:"https://staging.restapi.ordergroove.com"};case ut:return{...t,name:"dev",apiUrl:"https://dev.om.ordergroove.com",legoUrl:"https://dev.restapi.ordergroove.com"};case pt:return{...t,name:"prod",apiUrl:"https://om.ordergroove.com",legoUrl:"https://restapi.ordergroove.com"};default:return t}},"environment"),Ra=n((t={offerOptInLabel:"Subscribe and Save",offerIncentiveText:"Save {{ogIncentive DiscountPercent}} when you subscribe",offerOptOutLabel:"Deliver one-time only",offerEveryLabel:"Delivery Every",offerTooltipTrigger:"[?]",offerTooltipContent:"Seems this is a great subscription offering. Many fun details about this program exist.",optinButtonLabel:"\u2022",optoutButtonLabel:"\u2022",optinStatusOptedInLabel:"You're opted in!",optinStatusOptedOutLabel:"You're not opted in.",optinToggleLabel:"\u2022",upsellButtonLabel:"Add item to order on ",upsellButtonPrefix:"",upsellModalContent:"Some upsell modal content",upsellModalOptInLabel:"Subscribe",upsellModalOptOutLabel:"Purchase one time",upsellModalTitle:"Impulse Upsell",upsellModalConfirmLabel:"Ok",upsellModalCancelLabel:"Cancel",defaultFrequencyCopy:"(Most Popular)",frequencyPeriods:{"1":"day","2":"week","3":"month"}},e)=>{switch(e.type){case ht:return{...t,...e.payload};default:return t}},"locale"),Aa=n((t={frequencies:["1_2","1_2","1_3"],offerType:"radio"},e)=>{switch(e.type){case mt:return{...t,...e.payload,defaultFrequency:e.payload.defaultFrequency?Ve(e.payload.defaultFrequency):t.defaultFrequency,frequencies:e.payload.frequencies?e.payload.frequencies.map(Ve):t.frequencies};default:return t}},"config"),Na=n((t=!1,e)=>{switch(e.type){case Ue:return e.payload;default:return t}},"previewStandardOffer"),ka=n((t=!1,e)=>{switch(e.type){case De:return e.payload;default:return t}},"previewUpsellOffer"),Ia=n((t=[],e)=>{switch(e.type){case q:return{...t,...e.payload.autoship_by_default};default:return t}},"autoshipByDefault"),qa=n((t=[],e)=>{switch(e.type){case q:return{...t,...e.payload.default_frequencies};default:return t}},"defaultFrequencies"),Ua=n((t=[],e)=>{switch(e.type){case yt:return[...e.payload||[]];case gt:return[e.payload,...t];default:return t}},"templates"),Da=n((t={},e)=>{switch(e.type){case xt:return{...e.payload};default:return t}},"productPlans"),Zo=xo({productPlans:Da,environment:gr,optedin:fa,optedout:ha,merchantId:Ea,offer:va,offerId:wa,productOffer:Oa,sessionId:Ta,inStock:ya,eligibilityGroups:ba,autoshipByDefault:Ia,autoshipEligible:ga,incentives:_a,nextUpcomingOrder:ma,auth:xa,authUrl:Sa,locale:Ra,config:Aa,previewStandardOffer:Na,previewUpsellOffer:ka,templates:Ua,defaultFrequencies:qa,firstOrderPlaceDate:Ca,productToSubscribe:Pa});var _n=oe(yr());N();ce();var $e="OG_STATE",xn=n(t=>{try{return t===null?void 0:JSON.parse(t)}catch{return}},"safeParseState"),vr=n(()=>window.og&&window.og.previewMode,"isPreviewMode"),En=n(()=>vr()?{}:xn(localStorage.getItem($e)),"loadState"),Qa=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"),Sn=n(t=>{if(vr())return;let e=Qa(t);e&&localStorage.getItem($e)!==e&&localStorage.setItem($e,e)},"saveState"),vn=n(t=>(0,_n.throttle)(500,e=>{if(vr())return;let{key:r,newValue:o}=e;r===$e&&o===null?(t.dispatch({type:G}),setTimeout(()=>t.dispatch(qt()),0)):r===$e&&t.dispatch({type:ae,newValue:xn(o)})}),"listenLocalStorageChanges");var wn=oe(yr());ce();var Ja=n((t,e,r=document)=>r.dispatchEvent(new CustomEvent(t,{detail:e})),"dispatchEvent"),Tn=n(t=>({payload:{product:{id:e,components:r}={}}={}}={})=>setTimeout(()=>Ja("optin-changed",{productId:e,components:r,optedIn:t}),0),"dispatchOptinChangedEvent"),Ka=[{expressions:[({type:t}={})=>t===ne,({type:t}={})=>t===ie],fn:Tn(!0)},{expressions:[({type:t}={})=>t===se],fn:Tn(!1)}],On=n(t=>e=>r=>{let o=t.getState();Ka.forEach(s=>{s.expressions.some(i=>i(r,o))&&s.fn(r)}),e(r)},"dispatchMiddleware"),Cn=n(t=>e=>r=>{e(r);let o=(0,wn.throttle)(500,()=>{Sn({...t.getState()})});r.type!==ae&&o()},"localStorageMiddleware");function Pn(){if(window.og&&window.og.store)return window.og.store;let t=window.og&&window.og.previewMode,e=typeof window=="object"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}):cr,r=[Ro,On];t||r.push(Cn);let o=e(wo(...r)),s=ar(Zo,t?{}:En(),o);return window.og=window.og||{},window.og.store=s,s}n(Pn,"getStore");Y();var wr=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],...Me(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();v();var us=oe(rs());v();var mc=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"),os=n(t=>t.hasAttribute("product")&&{id:t.getAttribute("product"),...t.hasAttribute("product-components")&&{components:JSON.parse(t.getAttribute("product-components"))}},"buildProduct");var Wr=n(t=>{let e=os(t);if(!e){let r=t.offer;r&&(e=os(r))}return e},"resolveProduct"),gc=n(t=>{let e=t;for(;e;){if(e.tagName==="OG-OFFER")return e;e=e.nodeType===11?e.host:e.parentNode}},"resolveOffer"),Yr=n(t=>class extends t{get offer(){return gc(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"),A=n(t=>class extends Yr(t){get product(){return Wr(this)}},"withProduct"),Yt=n(t=>class extends t{get childOptions(){return this._childOptions||{options:[]}}connectedCallback(){let e=[],r=null;this.querySelectorAll("option").forEach(o=>{let s=mc(o.value),i=o.innerText.trim();e.push({value:s,text:i}),!r&&o.selected&&(r=s)}),this._childOptions={options:e,isSelected:r},super.connectedCallback&&super.connectedCallback()}},"withChildOptions");var Qt={};tr(Qt,{autoshipByDefault:()=>yc,eligibilityGroups:()=>is,eligible:()=>ns,hasUpcomingOrder:()=>cs,hasUpsellGroup:()=>as,inStock:()=>Qr,optedout:()=>_c,regularEligible:()=>Ec,subscribed:()=>bc,subscriptionEligible:()=>ss,upcomingOrderContainsProduct:()=>xc,upsellEligible:()=>ls});var Qr=n((t,e)=>(t.inStock||{})[(e.product||{}).id],"inStock"),ns=n((t,e)=>(t.autoshipEligible||{})[(e.product||{}).id]||!1,"eligible"),yc=n((t,e)=>(t.autoshipByDefault||{})[(e.product||{}).id]||!1,"autoshipByDefault"),ss=n((t,e)=>(t.offerId&&t.offerId!=="0"||!1)&&ns(t,e)&&Qr(t,e),"subscriptionEligible"),is=n((t,e)=>(t.eligibilityGroups||{})[(e.product||{}).id]||null,"eligibilityGroups"),as=n((t,e)=>{let r=is(t,e);return r===null||!!r.find(o=>o==="upsell"||o==="impulse_upsell")},"hasUpsellGroup"),bc=n((t,e)=>Jo(e.product)(t),"subscribed"),_c=n((t,e)=>Ct(e.product)(t),"optedout"),cs=n(t=>!!(t.nextUpcomingOrder&&t.nextUpcomingOrder.public_id),"hasUpcomingOrder"),xc=n((t,e)=>(t.nextUpcomingOrder&&t.nextUpcomingOrder.products||[]).includes((e.product||{}).id),"upcomingOrderContainsProduct"),ls=n((t,e)=>t.offerId&&t.offerId!=="0"&&t.auth&&Qr(t,e)&&cs(t)&&as(t,e),"upsellEligible"),Ec=n((t,e)=>ss(t,e)&&!ls(t,e),"regularEligible");var Sc=n(t=>t.replace(/(\r\n|\n|\r|\s)+/gm,""),"removeWhitespace"),Jr=class extends A(x){static get properties(){return{...super.properties,state:{type:Object,attribute:!1},test:{type:String}}}render(){return this.test&&us.default.parse(Sc(this.test),r=>Qt[r]&&Qt[r](this.state,this))?u`
111
111
  <slot></slot>
112
- `:p``}shouldUpdate(e){return e.size&&this.product&&this.product.id in this.state.autoshipEligible&&this.product.id in this.state.inStock}};n(Xr,"When");var Vc=n(t=>({state:t}),"mapStateToProps"),Es=g(Vc)(Xr);O();I();O();J();var Ss={type:Object,converter:{toAttribute(t){return t==null?t:JSON.stringify(t)},fromAttribute(t){return t&&t.match(/[{[]/)?JSON.parse(t):{id:t}}}},oe={type:String,attribute:"default-frequency",converter:{fromAttribute(t){return t&&gr(t)?t:null}}},Xt={type:Boolean,attribute:!0,reflect:!0},qe={type:Object,attribute:!1};O();var $c=n(t=>class extends t{getOption(e,r=e){let o=br(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(o){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"),L=$c(S);var M=class extends k(L){static get properties(){return{subscribed:Xt,frequencyMatch:{type:Boolean,reflect:!0,attribute:"frequency-match"}}}static get styles(){return T`
112
+ `:u``}shouldUpdate(e){return e.size&&this.product&&this.product.id in this.state.autoshipEligible&&this.product.id in this.state.inStock}};n(Jr,"When");var vc=n(t=>({state:t}),"mapStateToProps"),ps=h(vc)(Jr);v();N();v();Y();var ds={type:Object,converter:{toAttribute(t){return t==null?t:JSON.stringify(t)},fromAttribute(t){return t&&t.match(/[{[]/)?JSON.parse(t):{id:t}}}},te={type:String,attribute:"default-frequency",converter:{fromAttribute(t){return t&&fr(t)?t:null}}},Jt={type:Boolean,attribute:!0,reflect:!0},Ae={type:Object,attribute:!1};v();var wc=n(t=>class extends t{getOption(e,r=e){let o=mr(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"),D=wc(x);var L=class extends A(D){static get properties(){return{subscribed:Jt,frequencyMatch:{type:Boolean,reflect:!0,attribute:"frequency-match"}}}static get styles(){return w`
113
113
  :host {
114
114
  cursor: default;
115
115
  display: inline-block;
@@ -162,18 +162,18 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
162
162
  text-align: center;
163
163
  overflow: visible;
164
164
  }
165
- `}constructor(){super();this.addEventListener("click",this.handleClick.bind(this))}updated(e){e.has("subscribed")&&(this.frequencyMatch=this.frequency===this.defaultFrequency)}handleClick(){}render(){return this.subscribed&&!this.defaultFrequency?p`
165
+ `}constructor(){super();this.addEventListener("click",this.handleClick.bind(this))}updated(e){e.has("subscribed")&&(this.frequencyMatch=this.frequency===this.defaultFrequency)}handleClick(){}render(){return this.subscribed&&!this.defaultFrequency?u`
166
166
  <slot name="subscribed"></slot>
167
167
  <slot name="frequency-mismatch"></slot>
168
- `:this.subscribed&&this.defaultFrequency===this.frequency?p`
168
+ `:this.subscribed&&this.defaultFrequency===this.frequency?u`
169
169
  <slot name="subscribed"></slot>
170
170
  <slot name="frequency-match"></slot>
171
- `:this.subscribed&&this.defaultFrequency!==this.frequency?p`
171
+ `:this.subscribed&&this.defaultFrequency!==this.frequency?u`
172
172
  <slot name="subscribed"></slot>
173
173
  <slot name="frequency-mismatch"></slot>
174
- `:p`
174
+ `:u`
175
175
  <slot name="not-subscribed"></slot>
176
- `}};n(M,"OptinStatus");var W=n((t,e={})=>l(l({subscribed:B(e.product)(t),frequency:V(e.product)(t)},H(t,e,"defaultFrequency")),Ce(t,e)),"mapStateToProps"),vs=g(W)(M);var eo=class extends M{static get properties(){return h(l({},super.properties),{frequency:{type:String,reflect:!0},defaultFrequency:oe,optinButtonLabel:{type:String}})}handleClick(e){this.optinProduct(Jr(this),this.defaultFrequency),e.preventDefault()}render(){return p`
176
+ `}};n(L,"OptinStatus");var z=n((t,e={})=>({subscribed:V(e.product)(t),frequency:j(e.product)(t),...$(t,e,"defaultFrequency"),...ve(t,e)}),"mapStateToProps"),fs=h(z)(L);var Kr=class extends L{static get properties(){return{...super.properties,frequency:{type:String,reflect:!0},defaultFrequency:te,optinButtonLabel:{type:String}}}handleClick(e){this.optinProduct(Wr(this),this.defaultFrequency),e.preventDefault()}render(){return u`
177
177
  <slot name="default">
178
178
  <button id="action-trigger" class="btn radio ${this.subscribed?"active":""}"></button>
179
179
  <label for="action-trigger">
@@ -182,7 +182,7 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
182
182
  </slot>
183
183
  </label>
184
184
  </slot>
185
- `}};n(eo,"OptinButton");var ws=g(W,{optinProduct:K})(eo);O();I();var to=class extends M{static get properties(){return h(l({},super.properties),{label:{type:String}})}handleClick(e){this.optoutProduct(this.product),e.preventDefault()}render(){return p`
185
+ `}};n(Kr,"OptinButton");var hs=h(z,{optinProduct:Q})(Kr);v();N();var Zr=class extends L{static get properties(){return{...super.properties,label:{type:String}}}handleClick(e){this.optoutProduct(this.product),e.preventDefault()}render(){return u`
186
186
  <slot name="default">
187
187
  <button id="action-trigger" class="btn radio ${this.subscribed?"":"active"}"></button>
188
188
  <label for="action-trigger">
@@ -191,32 +191,32 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
191
191
  </slot>
192
192
  </label>
193
193
  </slot>
194
- `}};n(to,"OptoutButton");var Os=g(W,{optoutProduct:Pe})(to);O();I();O();J();var tt=n((t,e)=>{let{every:r,every_period:o}=He(t);return p`
194
+ `}};n(Zr,"OptoutButton");var ms=h(z,{optoutProduct:we})(Zr);v();N();v();Y();var Ke=n((t,e)=>{let{every:r,every_period:o}=Me(t);return u`
195
195
  ${r}
196
196
  <og-text key="frequencyPeriods" variant="${o}" pluralize="${r}"></og-text>
197
- ${e&&e===t?p`
197
+ ${e&&e===t?u`
198
198
  <og-text key="defaultFrequencyCopy"></og-text>
199
199
  `:""}
200
- `},"frequencyText"),rt=class extends k(L){static get properties(){return h(l({},super.properties),{disabled:{type:Boolean},subscribed:Xt,frequency:{type:String},defaultFrequency:oe,productDefaultFrequency:{type:String},frequencies:{converter:{fromAttribute:on}}})}static get styles(){return T`
200
+ `},"frequencyText"),Ze=class extends A(D){static get properties(){return{...super.properties,disabled:{type:Boolean},subscribed:Jt,frequency:{type:String},defaultFrequency:te,productDefaultFrequency:{type:String},frequencies:{converter:{fromAttribute:Yo}}}}static get styles(){return w`
201
201
  :host[hidden] {
202
202
  display: none;
203
203
  }
204
204
  :host {
205
205
  display: inline-block;
206
206
  }
207
- `}constructor(){super();this.frequencies=[]}render(){let e=this.frequency||this.defaultFrequency;return p`
207
+ `}constructor(){super();this.frequencies=[]}render(){let e=this.frequency||this.defaultFrequency;return u`
208
208
  <span>
209
- ${this.subscribed&&p`
210
- <slot name="subscribed">${tt(e)} </slot>
209
+ ${this.subscribed&&u`
210
+ <slot name="subscribed">${Ke(e)} </slot>
211
211
  `||""}
212
- ${!this.subscribed&&p`
212
+ ${!this.subscribed&&u`
213
213
  <slot name="not-subscribed"></slot>
214
214
  `||""}
215
- ${this.subscribed&&this.defaultFrequency&&this.defaultFrequency!==this.frequency&&p`
215
+ ${this.subscribed&&this.defaultFrequency&&this.defaultFrequency!==this.frequency&&u`
216
216
  <slot name="frequency-mismatch"></slot>
217
217
  `||""}
218
218
  </span>
219
- `}};n(rt,"FrequencyStatus");var ot=n((t,e)=>l(l(l({subscribed:B(e.product)(t),frequency:V(e.product)(t),productDefaultFrequency:Nt((e.product||{}).id)(t)},H(t,e,"frequencies",[])),H(t,e,"defaultFrequency")),Ce(t,e)),"mapStateToProps"),Ts=g(ot)(rt);var ro=class extends Kt(M){static get properties(){return h(l({},super.properties),{frequencies:{type:Array,attribute:!1},frequency:{type:String},defaultFrequency:oe})}static get styles(){return T`
219
+ `}};n(Ze,"FrequencyStatus");var Xe=n((t,e)=>({subscribed:V(e.product)(t),frequency:j(e.product)(t),productDefaultFrequency:Pt((e.product||{}).id)(t),...$(t,e,"frequencies",[]),...$(t,e,"defaultFrequency"),...ve(t,e)}),"mapStateToProps"),gs=h(Xe)(Ze);var Xr=class extends Yt(L){static get properties(){return{...super.properties,frequencies:{type:Array,attribute:!1},frequency:{type:String},defaultFrequency:te}}static get styles(){return w`
220
220
  :host {
221
221
  display: inline-block;
222
222
  cursor: pointer;
@@ -226,26 +226,26 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
226
226
  border-width: var(--og-select-border-width, 1px);
227
227
  box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.04);
228
228
  }
229
- `}get isSelected(){return this.subscribed?this.frequency:"optedOut"}onOptinChange(e){e==="optedOut"?this.optoutProduct(this.product):this.productChangeFrequency(this.product,e)}render(){let{options:e,isSelected:r}=this.childOptions,o=e;return e.length||(o=[{value:"optedOut",text:p`
229
+ `}get isSelected(){return this.subscribed?this.frequency:"optedOut"}onOptinChange(e){e==="optedOut"?this.optoutProduct(this.product):this.productChangeFrequency(this.product,e)}render(){let{options:e,isSelected:r}=this.childOptions,o=e;return e.length||(o=[{value:"optedOut",text:u`
230
230
  <og-text key="offerOptOutLabel"></og-text>
231
- `},...(this.frequencies||[]).map(s=>({value:s,text:tt(s,this.defaultFrequency)}))]),p`
231
+ `},...(this.frequencies||[]).map(s=>({value:s,text:Ke(s,this.defaultFrequency)}))]),u`
232
232
  <og-select
233
233
  .options="${o}"
234
234
  .selected="${r}"
235
235
  .onChange="${({target:{value:s}})=>this.onOptinChange(s)}"
236
236
  ></og-select>
237
- `}};n(ro,"OptinSelect");var Cs=g((t,e)=>l(l({},W(t,e)),ot(t,e)),{productChangeFrequency:qt,optoutProduct:Pe})(ro);O();I();var oo=class extends k(L){static get styles(){return T`
237
+ `}};n(Xr,"OptinSelect");var ys=h((t,e)=>({...z(t,e),...Xe(t,e)}),{productChangeFrequency:Nt,optoutProduct:we})(Xr);v();N();var eo=class extends A(D){static get styles(){return w`
238
238
  :host[hidden] {
239
239
  display: none;
240
240
  }
241
241
  :host {
242
242
  display: inline-block;
243
243
  }
244
- `}static get properties(){return h(l({},super.properties),{upcomingOrderDate:{type:String,attribute:!1},auth:qe,isPreview:{type:Boolean,attribute:!1},target:{type:String}})}constructor(){super();this.fetchOrders=()=>0,this.addEventListener("click",this.handleClick.bind(this))}updated(e){e.has("auth")&&this.auth&&!this.upcomingOrderDate&&!this.isPreview&&this.fetchOrders()}handleClick(){let e;if(!this.target&&this.offer)e=this.offer.querySelector("og-upsell-modal"),e||(e=this.offer.shadowRoot.querySelector("og-upsell-modal"));else if(this.target)e=document.querySelector(this.target);else throw Error("You must specify a target attribute or place this element as child of og-offer");e&&e.setAttribute("show",!0)}render(){return p`
244
+ `}static get properties(){return{...super.properties,upcomingOrderDate:{type:String,attribute:!1},auth:Ae,isPreview:{type:Boolean,attribute:!1},target:{type:String}}}constructor(){super();this.fetchOrders=()=>0,this.addEventListener("click",this.handleClick.bind(this))}updated(e){e.has("auth")&&this.auth&&!this.upcomingOrderDate&&!this.isPreview&&this.fetchOrders()}handleClick(){let e;if(!this.target&&this.offer)e=this.offer.querySelector("og-upsell-modal"),e||(e=this.offer.shadowRoot.querySelector("og-upsell-modal"));else if(this.target)e=document.querySelector(this.target);else throw Error("You must specify a target attribute or place this element as child of og-offer");e&&e.setAttribute("show",!0)}render(){return u`
245
245
  <slot>
246
246
  <og-next-upcoming-order></og-next-upcoming-order>
247
247
  </slot>
248
- `}};n(oo,"UpsellButton");var Bc=n(t=>({isPreview:t.previewUpsellOffer}),"mapStateToProps"),Ps=g(Bc,{fetchOrders:Dt})(oo);O();I();var no=class extends k(L){static get properties(){return h(l({},super.properties),{defaultFrequency:oe,auth:qe,subscribed:{type:Boolean,attribute:!1},frequency:{type:String,attribute:!1},nextUpcomingOrder:{type:Object,attribute:!1},show:{type:Boolean,attribute:"show"},offerId:{type:String}})}constructor(){super();this.createIu=()=>0,this.concludeUpsell=()=>0}render(){return p`
248
+ `}};n(eo,"UpsellButton");var Tc=n(t=>({isPreview:t.previewUpsellOffer}),"mapStateToProps"),bs=h(Tc,{fetchOrders:It})(eo);v();N();var to=class extends A(D){static get properties(){return{...super.properties,defaultFrequency:te,auth:Ae,subscribed:{type:Boolean,attribute:!1},frequency:{type:String,attribute:!1},nextUpcomingOrder:{type:Object,attribute:!1},show:{type:Boolean,attribute:"show"},offerId:{type:String}}}constructor(){super();this.createIu=()=>0,this.concludeUpsell=()=>0}render(){return u`
249
249
  <og-modal ?show=${this.show} @close=${()=>this.close()} @confirm=${()=>this.confirm()}>
250
250
  <div slot="content">
251
251
  <slot>
@@ -283,7 +283,7 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
283
283
  </slot>
284
284
  </span>
285
285
  </og-modal>
286
- `}set defaultFrequency(e){this._defaultFrequency=e}get defaultFrequency(){let e=this.querySelector("og-select-frequency");return e?e.defaultFrequency:this._defaultFrequency}confirm(){this.createIu(this.product,this.nextUpcomingOrder.public_id,1,this.subscribed,this.frequency||this.defaultFrequency),this.close()}close(){this.concludeUpsell(),this.removeAttribute("show")}};n(no,"UpsellModal");var Hc=n((t,e)=>h(l({auth:t.auth,offerId:t.offerId,subscribed:B(e.product)(t),frequency:V(e.product)(t)},H(t,e,"defaultFrequency")),{nextUpcomingOrder:t.previewUpsellOffer?{public_id:"preview-order-id"}:t.nextUpcomingOrder,isPreview:t.previewUpsellOffer}),"mapStateToProps"),Rs=g(Hc,{concludeUpsell:gn,createIu:Sn})(no);O();I();var so=class extends M{static get properties(){return h(l({},super.properties),{frequency:{type:String}})}handleClick(e){this.subscribed?this.optoutProduct(this.product):this.optinProduct(this.product,this.frequency||this.defaultFrequency),e.preventDefault()}render(){return p`
286
+ `}set defaultFrequency(e){this._defaultFrequency=e}get defaultFrequency(){let e=this.querySelector("og-select-frequency");return e?e.defaultFrequency:this._defaultFrequency}confirm(){this.createIu(this.product,this.nextUpcomingOrder.public_id,1,this.subscribed,this.frequency||this.defaultFrequency),this.close()}close(){this.concludeUpsell(),this.removeAttribute("show")}};n(to,"UpsellModal");var Oc=n((t,e)=>({auth:t.auth,offerId:t.offerId,subscribed:V(e.product)(t),frequency:j(e.product)(t),...$(t,e,"defaultFrequency"),nextUpcomingOrder:t.previewUpsellOffer?{public_id:"preview-order-id"}:t.nextUpcomingOrder,isPreview:t.previewUpsellOffer}),"mapStateToProps"),_s=h(Oc,{concludeUpsell:sn,createIu:dn})(to);v();N();var ro=class extends L{static get properties(){return{...super.properties,frequency:{type:String}}}handleClick(e){this.subscribed?this.optoutProduct(this.product):this.optinProduct(this.product,this.frequency||this.defaultFrequency),e.preventDefault()}render(){return u`
287
287
  <slot name="default">
288
288
  <button id="action-trigger" class="btn checkbox ${this.subscribed?"active":""}"></button>
289
289
  <label for="action-trigger">
@@ -292,13 +292,13 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
292
292
  ></slot>
293
293
  </label>
294
294
  </slot>
295
- `}};n(so,"OptinToggle");var As=g(W,{optoutProduct:Pe,optinProduct:K})(so);O();var zc=n((t,e)=>`${t}${parseInt(e,10)>1?"s":""}`,"pluralize"),io=class extends Kr(S){static get properties(){return{pluralize:{type:Number},variant:{type:Number},i18n:{type:Object,attribute:!1},locale:{type:Object,attribute:!1},key:{type:String}}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this._textOverride=this.innerText.trim()}getText(){return this._textOverride?this._textOverride:this.getPluralizedText(this.getVariantText(this.key))}getVariantText(e){let r=l(l({},this.i18n),this.offer&&this.offer.locale),o=typeof r[e]!="undefined"?r[e]:"";return typeof this.variant=="undefined"?o:o[this.variant]}getPluralizedText(e){return typeof this.pluralize=="undefined"?e:e&&zc(e,this.pluralize)}render(){return p`
295
+ `}};n(ro,"OptinToggle");var xs=h(z,{optoutProduct:we,optinProduct:Q})(ro);v();var Cc=n((t,e)=>`${t}${parseInt(e,10)>1?"s":""}`,"pluralize"),oo=class extends Yr(x){static get properties(){return{pluralize:{type:Number},variant:{type:Number},i18n:{type:Object,attribute:!1},locale:{type:Object,attribute:!1},key:{type:String}}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this._textOverride=this.innerText.trim()}getText(){return this._textOverride?this._textOverride:this.getPluralizedText(this.getVariantText(this.key))}getVariantText(e){let r={...this.i18n,...this.offer&&this.offer.locale},o=typeof r[e]!="undefined"?r[e]:"";return typeof this.variant=="undefined"?o:o[this.variant]}getPluralizedText(e){return typeof this.pluralize=="undefined"?e:e&&Cc(e,this.pluralize)}render(){return u`
296
296
  ${this.getText()}
297
- `}};n(io,"Text");var Gc=n(t=>({i18n:t.locale||{}}),"mapStateToProps"),Ns=g(Gc)(io);O();var Ue=class{constructor(e){this.value=e,this.className="DiscountAmount"}toString(){return`${this.value}`}};n(Ue,"DiscountAmount");var nt=class extends Ue{constructor(e){super(e);this.className="DiscountPercent"}toString(){return`${super.toString()}%`}};n(nt,"DiscountPercent");var ao=class extends nt{constructor(e){super(e);this.className="ShippingDiscountPercent"}toString(){return this.value===100?"free shipping":super.toString()}};n(ao,"ShippingDiscountPercent");var co="Discount Percent",lo="Discount Amount",ks="total_price",Is="shipping_total",qs="sub_total",uo=n(({field:t,object:e,type:r,value:o})=>{let i=[[new nt(o),{field:ks,object:"item",type:co}],[new Ue(o),{field:ks,object:"item",type:lo}],[new ao(o),{field:Is,object:"order",type:co}],[new Ue(o),{field:Is,object:"order",type:lo}],[new nt(o),{field:qs,object:"order",type:co}],[new Ue(o),{field:qs,object:"order",type:lo}]].find(([,a])=>a.field===t&&a.object===e&&a.type===r);return i&&i[0]},"discountBuilder");function Wc(t){return!(uo(t).className!==this.incentiveClass||this.incentiveValue&&this.incentiveValue.toString()!==t.value.toString())}n(Wc,"filterIncentives");var po=class extends k(S){static get properties(){return h(l({},super.properties),{incentives:{type:Object,attribute:!1},from:{type:String},label:{type:String},initial:{type:Boolean,default:!1},value:{type:Number}})}createRenderRoot(){return this}render(){let e=this.from,r=this.value,o=this.initial?"initial":"ongoing",s=(this.incentives[o]||[]).find(Wc.bind({incentiveClass:e,incentiveValue:r}));return p`
298
- ${this.label} ${s?uo(s):this.renderFallback()}
299
- `}renderFallback(){let e=this.from,r=this.value,o=this.initial?"initial":"ongoing";return p`
300
- ${uo({field:"sub_total",object:"order",type:"Discount Percent",value:this.value})}
301
- `}};n(po,"IncentiveText");var Yc=n((t,e)=>({incentives:(t.incentives||{})[e&&e.product&&e.product.id]||{}}),"mapStateToProps"),Us=g(Yc)(po);O();I();var fo=class extends Kt(rt){static get properties(){return h(l({},super.properties),{defaultText:{type:String,attribute:"default-text"}})}static get styles(){return T`
297
+ `}};n(oo,"Text");var Pc=n(t=>({i18n:t.locale||{}}),"mapStateToProps"),Es=h(Pc)(oo);v();var Ne=class{constructor(e){this.value=e,this.className="DiscountAmount"}toString(){return`${this.value}`}};n(Ne,"DiscountAmount");var et=class extends Ne{constructor(e){super(e);this.className="DiscountPercent"}toString(){return`${super.toString()}%`}};n(et,"DiscountPercent");var no=class extends et{constructor(e){super(e);this.className="ShippingDiscountPercent"}toString(){return this.value===100?"free shipping":super.toString()}};n(no,"ShippingDiscountPercent");var so="Discount Percent",io="Discount Amount",Ss="total_price",vs="shipping_total",ws="sub_total",ao=n(({field:t,object:e,type:r,value:o})=>{let i=[[new et(o),{field:Ss,object:"item",type:so}],[new Ne(o),{field:Ss,object:"item",type:io}],[new no(o),{field:vs,object:"order",type:so}],[new Ne(o),{field:vs,object:"order",type:io}],[new et(o),{field:ws,object:"order",type:so}],[new Ne(o),{field:ws,object:"order",type:io}]].find(([,a])=>a.field===t&&a.object===e&&a.type===r);return i&&i[0]},"discountBuilder");function Rc(t){return!(ao(t).className!==this.incentiveClass||this.incentiveValue&&this.incentiveValue.toString()!==t.value.toString())}n(Rc,"filterIncentives");var co=class extends A(x){static get properties(){return{...super.properties,incentives:{type:Object,attribute:!1},from:{type:String},label:{type:String},initial:{type:Boolean,default:!1},value:{type:Number}}}createRenderRoot(){return this}render(){let e=this.from,r=this.value,o=this.initial?"initial":"ongoing",s=(this.incentives[o]||[]).find(Rc.bind({incentiveClass:e,incentiveValue:r}));return u`
298
+ ${this.label} ${s?ao(s):this.renderFallback()}
299
+ `}renderFallback(){let e=this.from,r=this.value,o=this.initial?"initial":"ongoing";return u`
300
+ ${ao({field:"sub_total",object:"order",type:"Discount Percent",value:this.value})}
301
+ `}};n(co,"IncentiveText");var Ac=n((t,e)=>({incentives:(t.incentives||{})[e&&e.product&&e.product.id]||{}}),"mapStateToProps"),Ts=h(Ac)(co);v();N();var lo=class extends Yt(Ze){static get properties(){return{...super.properties,defaultText:{type:String,attribute:"default-text"}}}static get styles(){return w`
302
302
  :host {
303
303
  display: inline-block;
304
304
  cursor: pointer;
@@ -309,15 +309,15 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
309
309
  box-shadow: 0 1px 0 1px rgba(0, 0, 0, 0.04);
310
310
  z-index: 1;
311
311
  }
312
- `}set defaultFrequency(e){this._defaultFrequency=e}get defaultFrequency(){let{options:e,isSelected:r}=this.childOptions;return this.productDefaultFrequency?this.productDefaultFrequency:r||(e.length?e[0].value:this._defaultFrequency)}get currentFrequency(){return this.frequency||this.defaultFrequency}productChangeFrequency(e,r){this.frequency=r}render(){let{options:e}=this.childOptions;e.length||(e=(this.frequencies||[]).map(o=>({value:o,text:tt(o,this.defaultFrequency)})));let r=this.defaultFrequency;return e=e.map(({text:o,value:s})=>({text:s===r?`${o} ${(this.defaultText||"").trim()}`.trim():o,value:s})),p`
312
+ `}set defaultFrequency(e){this._defaultFrequency=e}get defaultFrequency(){let{options:e,isSelected:r}=this.childOptions;return this.productDefaultFrequency?this.productDefaultFrequency:r||(e.length?e[0].value:this._defaultFrequency)}get currentFrequency(){return this.frequency||this.defaultFrequency}productChangeFrequency(e,r){this.frequency=r}render(){let{options:e}=this.childOptions;e.length||(e=(this.frequencies||[]).map(o=>({value:o,text:Ke(o,this.defaultFrequency)})));let r=this.defaultFrequency;return e=e.map(({text:o,value:s})=>({text:s===r?`${o} ${(this.defaultText||"").trim()}`.trim():o,value:s})),u`
313
313
  <og-select
314
314
  .options="${e}"
315
315
  .selected="${this.currentFrequency}"
316
316
  .onChange="${({target:{value:o}})=>{this.productChangeFrequency(this.product,o)}}"
317
317
  ></og-select>
318
- `}};n(fo,"SelectFrequency");var Ds=g(ot,{productChangeFrequency:qt})(fo);O();var Qc={day:{day:"2-digit"},"day-numeric":{day:"numeric"},"day-short":{weekday:"short"},"day-long":{weekday:"long"},month:{month:"2-digit"},"month-numeric":{month:"numeric"},"month-short":{month:"short"},"month-long":{month:"long"},year:{year:"2-digit"},"year-numeric":{year:"numeric"}};var Fs=n((t,e)=>t instanceof Date?(e||"").toString().replace(/\{\{([-\w]+)\}\}/g,r=>{let o=r.replace(/[{}]/g,""),s=Qc[o];if(typeof s=="undefined")return o;let a=new Intl.DateTimeFormat("en-us",s).formatToParts(t),[{value:c}]=a;return c}):t,"formatDate");var ho=class extends S{static get properties(){return{value:{type:String,reflect:!0},format:{type:String}}}createRenderRoot(){return this}render(){return p`
319
- ${Fs(this.value,this.format||"{{month-long}} {{day}}, {{year-numeric}}")}
320
- `}};n(ho,"FormattedDate");var Jc=n(t=>({value:t.previewUpsellOffer?new Date:t.nextUpcomingOrder.place}),"mapStateToProps"),Ls=g(Jc)(ho);O();var Vs=Ee(Ct());I();ue();var js=n((t,e)=>n(async function(o){await o({type:je,payload:t}),await o({type:ve}),await o(Re({in_stock:{[e]:!0},eligibility_groups:{[e]:["subscription","upsell"]},result:"success",autoship:{[e]:!0},modifiers:{},module_view:{regular:"096135e6650111e9a444bc764e106cf4"},incentives_display:{"47c01e9aacbe40389b5c7325d79091aa":{field:"sub_total",object:"order",type:"Discount Percent",value:5},e6534b9d877f41e586c37b7d8abc3a58:{field:"total_price",object:"item",type:"Discount Percent",value:10},f35e842710b24929922db4a529eecd40:{field:"total_price",object:"item",type:"Discount Percent",value:10},"5be321d7c17f4e18a757212b9a20bfcc":{field:"total_price",object:"item",type:"Discount Percent",value:1}},incentives:{[e]:{initial:["5be321d7c17f4e18a757212b9a20bfcc"],ongoing:["e6534b9d877f41e586c37b7d8abc3a58","47c01e9aacbe40389b5c7325d79091aa","f35e842710b24929922db4a529eecd40"]}}}))},"setPreviewStandardOfferThunk"),"setPreviewStandardOffer"),Kc=n((t,e)=>n(async function(o,s){await o({type:Me,payload:t});let{merchantId:i}=s();t?(await o(Re({in_stock:{[e]:!0},module_view:{regular:"096135e6650111e9a444bc764e106cf4"},default_frequencies:{[e]:{every:1,every_period:3}},eligibility_groups:{[e]:["subscription","upsell"]},result:"success",autoship:{[e]:!0},modifiers:{}})),await o(Sr({count:1,next:null,previous:null,results:[{merchant:"0e5de2bedc5e11e3a2e4bc764e106cf4",customer:"TestCust",payment:"e98e789aba0111e9b90fbc764e107990",shipping_address:"b3a5816ae59611e78937bc764e1043b0",public_id:"23322d4a83eb11ea9a1ebc764e101db1",sub_total:"206.98",tax_total:"0.00",shipping_total:"10.00",discount_total:"0.00",total:"216.98",created:"2020-04-21 11:14:11",place:"2020-06-24 00:00:00",cancelled:null,tries:0,generic_error_count:0,status:1,type:1,order_merchant_id:null,rejected_message:null,extra_data:null,locked:!1,oos_free_shipping:!1}]})),await o(Er(i,"sig_field","ts","sig"))):await o(Z())},"setPreviewUpsellOfferThunk"),"setPreviewUpsellOffer"),Ms=n((t,e,r)=>async function(o,s){switch(await o({type:Y}),await o({type:je,payload:!1}),await o({type:Me,payload:!1}),t){case"regular":o(js(!0,r.product.id));break;case"upsell":o(Kc(!0,r.product.id));break;case"subscribed":o(js(!0,r.product.id)),o(K(r.product,"2_2"));break;default:}},"setPreview");I();var Zc=n((...t)=>JSON.stringify(t),"memoizeKey"),Xc=(0,Vs.default)((t,e)=>Object.assign({components:e},t),Zc),mo=class extends L{static get properties(){return h(l({},super.properties),{config:{type:Object,attribute:!1},product:Ss,productComponents:{type:Array,attribute:"product-components"},offerId:{type:String,attribute:!1},auth:qe,preview:{type:String,attribute:"preview",reflect:"true"},location:{type:String},autoshipByDefault:{type:Boolean,attribute:"autoship-by-default"},productDefaultFrequency:{type:String,attribute:!1},locale:{type:Object,attribute:!0},firstOrderPlaceDate:{type:String,attribute:"first-order-place-date"},productToSubscribe:{type:String,attribute:"product-to-subscribe"},subscribed:{type:Boolean,reflect:!0},frequency:{type:String,reflect:!0}})}firstUpdated(){let e=Array.from(this.getAttributeNames()).find(r=>r.startsWith("preview-"));e==="preview-standard-offer"?this.preview="regular":e==="preview-upsell-offer"?this.preview="upsell":e==="preview-subscribed-offer"&&(this.preview="subscribed")}static get styles(){return T`
318
+ `}};n(lo,"SelectFrequency");var Os=h(Xe,{productChangeFrequency:Nt})(lo);v();var Nc={day:{day:"2-digit"},"day-numeric":{day:"numeric"},"day-short":{weekday:"short"},"day-long":{weekday:"long"},month:{month:"2-digit"},"month-numeric":{month:"numeric"},"month-short":{month:"short"},"month-long":{month:"long"},year:{year:"2-digit"},"year-numeric":{year:"numeric"}};var Cs=n((t,e)=>t instanceof Date?(e||"").toString().replace(/\{\{([-\w]+)\}\}/g,r=>{let o=r.replace(/[{}]/g,""),s=Nc[o];if(typeof s=="undefined")return o;let a=new Intl.DateTimeFormat("en-us",s).formatToParts(t),[{value:c}]=a;return c}):t,"formatDate");var uo=class extends x{static get properties(){return{value:{type:String,reflect:!0},format:{type:String}}}createRenderRoot(){return this}render(){return u`
319
+ ${Cs(this.value,this.format||"{{month-long}} {{day}}, {{year-numeric}}")}
320
+ `}};n(uo,"FormattedDate");var kc=n(t=>({value:t.previewUpsellOffer?new Date:t.nextUpcomingOrder.place}),"mapStateToProps"),Ps=h(kc)(uo);v();var Ns=oe(vt());N();ce();var Rs=n((t,e)=>n(async function(o){await o({type:Ue,payload:t}),await o({type:_e}),await o(Te({in_stock:{[e]:!0},eligibility_groups:{[e]:["subscription","upsell"]},result:"success",autoship:{[e]:!0},modifiers:{},module_view:{regular:"096135e6650111e9a444bc764e106cf4"},incentives_display:{"47c01e9aacbe40389b5c7325d79091aa":{field:"sub_total",object:"order",type:"Discount Percent",value:5},e6534b9d877f41e586c37b7d8abc3a58:{field:"total_price",object:"item",type:"Discount Percent",value:10},f35e842710b24929922db4a529eecd40:{field:"total_price",object:"item",type:"Discount Percent",value:10},"5be321d7c17f4e18a757212b9a20bfcc":{field:"total_price",object:"item",type:"Discount Percent",value:1}},incentives:{[e]:{initial:["5be321d7c17f4e18a757212b9a20bfcc"],ongoing:["e6534b9d877f41e586c37b7d8abc3a58","47c01e9aacbe40389b5c7325d79091aa","f35e842710b24929922db4a529eecd40"]}}}))},"setPreviewStandardOfferThunk"),"setPreviewStandardOffer"),Ic=n((t,e)=>n(async function(o,s){await o({type:De,payload:t});let{merchantId:i}=s();t?(await o(Te({in_stock:{[e]:!0},module_view:{regular:"096135e6650111e9a444bc764e106cf4"},default_frequencies:{[e]:{every:1,every_period:3}},eligibility_groups:{[e]:["subscription","upsell"]},result:"success",autoship:{[e]:!0},modifiers:{}})),await o(_r({count:1,next:null,previous:null,results:[{merchant:"0e5de2bedc5e11e3a2e4bc764e106cf4",customer:"TestCust",payment:"e98e789aba0111e9b90fbc764e107990",shipping_address:"b3a5816ae59611e78937bc764e1043b0",public_id:"23322d4a83eb11ea9a1ebc764e101db1",sub_total:"206.98",tax_total:"0.00",shipping_total:"10.00",discount_total:"0.00",total:"216.98",created:"2020-04-21 11:14:11",place:"2020-06-24 00:00:00",cancelled:null,tries:0,generic_error_count:0,status:1,type:1,order_merchant_id:null,rejected_message:null,extra_data:null,locked:!1,oos_free_shipping:!1}]})),await o(br(i,"sig_field","ts","sig"))):await o(J())},"setPreviewUpsellOfferThunk"),"setPreviewUpsellOffer"),As=n((t,e,r)=>async function(o,s){switch(await o({type:G}),await o({type:Ue,payload:!1}),await o({type:De,payload:!1}),t){case"regular":o(Rs(!0,r.product.id));break;case"upsell":o(Ic(!0,r.product.id));break;case"subscribed":o(Rs(!0,r.product.id)),o(Q(r.product,"2_2"));break;default:}},"setPreview");N();var qc=n((...t)=>JSON.stringify(t),"memoizeKey"),Uc=(0,Ns.default)((t,e)=>Object.assign({components:e},t),qc),po=class extends D{static get properties(){return{...super.properties,config:{type:Object,attribute:!1},product:ds,productComponents:{type:Array,attribute:"product-components"},offerId:{type:String,attribute:!1},auth:Ae,preview:{type:String,attribute:"preview",reflect:"true"},location:{type:String},autoshipByDefault:{type:Boolean,attribute:"autoship-by-default"},productDefaultFrequency:{type:String,attribute:!1},locale:{type:Object,attribute:!0},firstOrderPlaceDate:{type:String,attribute:"first-order-place-date"},productToSubscribe:{type:String,attribute:"product-to-subscribe"},subscribed:{type:Boolean,reflect:!0},frequency:{type:String,reflect:!0}}}firstUpdated(){let e=Array.from(this.getAttributeNames()).find(r=>r.startsWith("preview-"));e==="preview-standard-offer"?this.preview="regular":e==="preview-upsell-offer"?this.preview="upsell":e==="preview-subscribed-offer"&&(this.preview="subscribed")}static get styles(){return w`
321
321
  :host[hidden] {
322
322
  display: none;
323
323
  }
@@ -465,9 +465,9 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
465
465
  The product is in your next upcomming order
466
466
  </og-when>
467
467
  </og-when>
468
- `}constructor(){super();this.module="pdp",this.product={},this.productComponents=[],this.fetchOffer=()=>0,this.fetchOrders=()=>0,this.productHasChangedComponents=()=>0,this.setFirstOrderPlaceDate=()=>0,this.setProductToSubscribe=()=>0,this.productChangeFrequency=()=>0}applyTemplate(e){super.applyTemplate(e);let{locale:r}=e;this.locale=r;let o=new CustomEvent("template-changed");this.dispatchEvent(o)}updated(e){if(e.has("preview")&&this.setPreview(this.preview,e.get("preview"),this),this.frequency=this.defaultFrequency,e.has("product")&&this.product.id&&!this.isPreview&&this.fetchOffer(this.product.id),e.has("firstOrderPlaceDate")&&this.product.id&&!this.isPreview&&this.setFirstOrderPlaceDate(this.product.id,this.firstOrderPlaceDate),e.has("productToSubscribe")&&this.product.id&&!this.isPreview&&this.setProductToSubscribe(this.product.id,this.productToSubscribe),e.has("auth")&&this.auth&&!this.isPreview&&this.fetchOrders(),e.has("productComponents")){let r=Xc(this.product,this.productComponents),o=Object.assign({},this.product,{components:e.get("productComponents")});N(r,o)||this.productHasChangedComponents(r,o)}(e.has("offerId")||e.has("autoshipByDefault")||e.has("location")||e.has("product"))&&this.offerId&&this.autoshipByDefault&&this.location==="cart"&&this.product.id&&this.optinProduct&&!(this.optedin||[]).find(r=>N(r,this.product))&&this.optinProduct(l(l({},this.product),this.productComponents.length&&{components:this.productComponents}),this.defaultFrequency)}get isPreview(){return this.preview}render(){return p`
468
+ `}constructor(){super();this.module="pdp",this.product={},this.productComponents=[],this.fetchOffer=()=>0,this.fetchOrders=()=>0,this.productHasChangedComponents=()=>0,this.setFirstOrderPlaceDate=()=>0,this.setProductToSubscribe=()=>0,this.productChangeFrequency=()=>0}applyTemplate(e){super.applyTemplate(e);let{locale:r}=e;this.locale=r;let o=new CustomEvent("template-changed");this.dispatchEvent(o)}updated(e){if(e.has("preview")&&this.setPreview(this.preview,e.get("preview"),this),this.frequency=this.defaultFrequency,e.has("product")&&this.product.id&&!this.isPreview&&this.fetchOffer(this.product.id),e.has("firstOrderPlaceDate")&&this.product.id&&!this.isPreview&&this.setFirstOrderPlaceDate(this.product.id,this.firstOrderPlaceDate),e.has("productToSubscribe")&&this.product.id&&!this.isPreview&&this.setProductToSubscribe(this.product.id,this.productToSubscribe),e.has("auth")&&this.auth&&!this.isPreview&&this.fetchOrders(),e.has("productComponents")){let r=Uc(this.product,this.productComponents),o=Object.assign({},this.product,{components:e.get("productComponents")});R(r,o)||this.productHasChangedComponents(r,o)}(e.has("offerId")||e.has("autoshipByDefault")||e.has("location")||e.has("product"))&&this.offerId&&this.autoshipByDefault&&this.location==="cart"&&this.product.id&&this.optinProduct&&!(this.optedin||[]).find(r=>R(r,this.product))&&this.optinProduct({...this.product,...this.productComponents.length&&{components:this.productComponents}},this.defaultFrequency)}get isPreview(){return this.preview}render(){return u`
469
469
  <slot></slot>
470
- `}get defaultFrequency(){let e=this.productFrequency||this.productDefaultFrequency;if(e)return e;let r=this.querySelector("og-select-frequency");return r&&r.currentFrequency?r.currentFrequency:this.getOption("defaultFrequency")}};n(mo,"Offer");var el=n((t,e)=>l(h(l(l({config:t.config,auth:t.auth,offerId:((t.productOffer||{})[(e.product||{}).id]||[])[0],productFrequency:V(e.product)(t),productDefaultFrequency:Nt((e.product||{}).id)(t)},H(t,e,"autoshipByDefault",yr(t)[(e.product||{}).id])),an(e.product)(t)&&{autoshipByDefault:!1}),{optedin:At(t),subscribed:B(e.product)(t)}),Ce(t)),"mapStateToProps"),$s=g(el,{fetchOffer:xn,fetchOrders:Dt,productHasChangedComponents:mn,optinProduct:K,setFirstOrderPlaceDate:Cn,setProductToSubscribe:Pn,setPreview:Ms})(mo);O();var er=class extends S{constructor(){super();this.showCancelButton=!0,this.showConfirmButton=!0}static get properties(){return{title:{type:String,attribute:!1},content:{type:String,attribute:!1},confirmText:{type:String,attribute:!1},cancelText:{type:String,attribute:!1},showCancelButton:{type:Boolean},showConfirmButton:{type:Boolean},show:{type:Boolean,attribute:"show"}}}static get styles(){return T`
470
+ `}get defaultFrequency(){let e=this.productFrequency||this.productDefaultFrequency;if(e)return e;let r=this.querySelector("og-select-frequency");return r&&r.currentFrequency?r.currentFrequency:this.getOption("defaultFrequency")}};n(po,"Offer");var Dc=n((t,e)=>({config:t.config,auth:t.auth,offerId:((t.productOffer||{})[(e.product||{}).id]||[])[0],productFrequency:j(e.product)(t),productDefaultFrequency:Pt((e.product||{}).id)(t),...$(t,e,"autoshipByDefault",hr(t)[(e.product||{}).id]),...Ct(e.product)(t)&&{autoshipByDefault:!1},optedin:Ot(t),subscribed:V(e.product)(t),...ve(t)}),"mapStateToProps"),ks=h(Dc,{fetchOffer:un,fetchOrders:It,productHasChangedComponents:nn,optinProduct:Q,setFirstOrderPlaceDate:yn,setProductToSubscribe:bn,setPreview:As})(po);v();var Kt=class extends x{constructor(){super();this.showCancelButton=!0,this.showConfirmButton=!0}static get properties(){return{title:{type:String,attribute:!1},content:{type:String,attribute:!1},confirmText:{type:String,attribute:!1},cancelText:{type:String,attribute:!1},showCancelButton:{type:Boolean},showConfirmButton:{type:Boolean},show:{type:Boolean,attribute:"show"}}}static get styles(){return w`
471
471
  :host[hidden] {
472
472
  display: none;
473
473
  }
@@ -579,7 +579,7 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
579
579
  .btn {
580
580
  cursor: pointer;
581
581
  }
582
- `}close(){this.removeAttribute("show"),this.dispatchEvent(new CustomEvent("close"))}confirm(){this.removeAttribute("show"),this.dispatchEvent(new CustomEvent("confirm"))}get confirmButton(){return this.showConfirmButton?p`
582
+ `}close(){this.removeAttribute("show"),this.dispatchEvent(new CustomEvent("close"))}confirm(){this.removeAttribute("show"),this.dispatchEvent(new CustomEvent("confirm"))}get confirmButton(){return this.showConfirmButton?u`
583
583
  <span @click="${()=>this.confirm()}">
584
584
  <slot name="confirm" class="btn">
585
585
  <button class="og-modal__btn og-modal__btn-primary og-modal__confirm" @click="${()=>this.confirm()}">
@@ -587,7 +587,7 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
587
587
  </button>
588
588
  </slot>
589
589
  </span>
590
- `:p``}get cancelButton(){return this.showCancelButton?p`
590
+ `:u``}get cancelButton(){return this.showCancelButton?u`
591
591
  <span @click="${()=>this.close()}" class="btn">
592
592
  <slot name="cancel">
593
593
  <button class="og-modal__btn og-modal__cancel" @click="${()=>this.close()}">
@@ -595,7 +595,7 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
595
595
  </button>
596
596
  </slot>
597
597
  </span>
598
- `:p``}render(){return this.show?p`
598
+ `:u``}render(){return this.show?u`
599
599
  <div class="og-modal is-open" aria-hidden="true">
600
600
  <div class="og-modal__overlay" tabindex="-1">
601
601
  <div class="og-modal__container" role="dialog" aria-modal="true">
@@ -614,7 +614,7 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
614
614
  </div>
615
615
  </div>
616
616
  </div>
617
- `:p``}};n(er,"Modal");O();var tr=class extends S{static get styles(){return T`
617
+ `:u``}};n(Kt,"Modal");v();var Zt=class extends x{static get styles(){return w`
618
618
  :host {
619
619
  display: inline-block;
620
620
  color: inherit;
@@ -673,9 +673,9 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
673
673
  line-height: 0.2em;
674
674
  transform: scaleY(0.5);
675
675
  }
676
- `}static get properties(){return{options:{type:Array},selected:{type:String}}}render(){return p`
676
+ `}static get properties(){return{options:{type:Array},selected:{type:String}}}render(){return u`
677
677
  <select @change="${this.onChange}" .value="${this.selected}">
678
- ${this.options.map(e=>p`
678
+ ${this.options.map(e=>u`
679
679
  <option value="${e.value}" ?selected=${this.selected===e.value}>${e.text}</option>
680
680
  `)}
681
681
  </select>
@@ -684,7 +684,7 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
684
684
  <path d="M10.5 15l7.5 7.5 7.5-7.5z" />
685
685
  <path d="M0 0h36v36h-36z" fill="none" />
686
686
  </svg> -->
687
- `}};n(tr,"Select");O();var rr=class extends S{static get properties(){return{placement:{type:String,default:"bottom"}}}static get styles(){return T`
687
+ `}};n(Zt,"Select");v();var Xt=class extends x{static get properties(){return{placement:{type:String,default:"bottom"}}}static get styles(){return w`
688
688
  :host[hidden] {
689
689
  display: none;
690
690
  }
@@ -834,7 +834,7 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
834
834
  pointer-events: auto;
835
835
  transform: translateY(0px);
836
836
  }
837
- `}connectedCallback(){super.connectedCallback(),this.showTooltip=this.showTooltip.bind(this),this.addEventListener("mouseenter",this.showTooltip)}showTooltip(){let r=this.shadowRoot.querySelector(".trigger").getBoundingClientRect(),o=this.shadowRoot.querySelector(".content"),s=o.getBoundingClientRect();!this.placement||this.placement==="top"||this.placement==="bottom"?o.style.left=`${(-1*s.width+r.width)/2}px`:(this.placement==="left"||this.placement==="right")&&(o.style.top=`${(-1*s.height+r.height)/2}px`)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mouseenter",this.showTooltip),this.removeEventListener("mouseout",this.hideTooltip)}render(){return p`
837
+ `}connectedCallback(){super.connectedCallback(),this.showTooltip=this.showTooltip.bind(this),this.addEventListener("mouseenter",this.showTooltip)}showTooltip(){let r=this.shadowRoot.querySelector(".trigger").getBoundingClientRect(),o=this.shadowRoot.querySelector(".content"),s=o.getBoundingClientRect();!this.placement||this.placement==="top"||this.placement==="bottom"?o.style.left=`${(-1*s.width+r.width)/2}px`:(this.placement==="left"||this.placement==="right")&&(o.style.top=`${(-1*s.height+r.height)/2}px`)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mouseenter",this.showTooltip),this.removeEventListener("mouseout",this.hideTooltip)}render(){return u`
838
838
  <span class="tooltip">
839
839
  <span class="trigger">
840
840
  <slot name="trigger">
@@ -847,12 +847,12 @@ var lib=(()=>{var ui=Object.create;var xe=Object.defineProperty,pi=Object.define
847
847
  </slot>
848
848
  </div>
849
849
  </span>
850
- `}};n(rr,"Tooltip");var{TestWizard:rl}=(Hs(),Bs);function go(){let t="og-test-wizard";customElements.get(t)||customElements.define(t,rl);let e=document.createElement(t);document.body.appendChild(e)}n(go,"default");var yo=[79,71,68,69,86],zs=n(()=>{if(window.OG_OFFERS_TEST_MODE_ENABLE)return;window.OG_OFFERS_TEST_MODE_ENABLE=!0;let t=0;document.addEventListener("keyup",async function(e){if(e.which===yo[t]){let o=yo[t];setTimeout(function(){t<=o&&(t=0)},5e3),t+=1,t>=yo.length&&go()}else t=0},!1)},"enable");J();ue();O();var bo=class extends k(L){static get properties(){return h(l({},super.properties),{regular:{type:Boolean,reflect:!0},subscription:{type:Boolean,reflect:!0},discount:{type:Boolean,reflect:!0},frequency:{type:Object},productPlans:{type:Object}})}get value(){let e=this.frequency||this.offer&&this.offer.defaultFrequency,o=(this.productPlans[this.product.id]||{})[e]||[];if(!o)return"";let[s,i,a]=o;return a===s?"":this.regular?s:this.discount?i:a}render(){let e=this.value;return e?p`
850
+ `}};n(Xt,"Tooltip");var{TestWizard:Lc}=(qs(),Is);function fo(){let t="og-test-wizard";customElements.get(t)||customElements.define(t,Lc);let e=document.createElement(t);document.body.appendChild(e)}n(fo,"default");var ho=[79,71,68,69,86],Us=n(()=>{if(window.OG_OFFERS_TEST_MODE_ENABLE)return;window.OG_OFFERS_TEST_MODE_ENABLE=!0;let t=0;document.addEventListener("keyup",async function(e){if(e.which===ho[t]){let o=ho[t];setTimeout(function(){t<=o&&(t=0)},5e3),t+=1,t>=ho.length&&fo()}else t=0},!1)},"enable");Y();ce();v();var mo=class extends A(D){static get properties(){return{...super.properties,regular:{type:Boolean,reflect:!0},subscription:{type:Boolean,reflect:!0},discount:{type:Boolean,reflect:!0},frequency:{type:Object},productPlans:{type:Object}}}get value(){let e=this.frequency||this.offer&&this.offer.defaultFrequency,o=(this.productPlans[this.product.id]||{})[e]||[];if(!o)return"";let[s,i,a]=o;return a===s?"":this.regular?s:this.discount?i:a}render(){let e=this.value;return e?u`
851
851
  <slot name="prepend"></slot>
852
852
  ${e}
853
853
  <slot name="append"></slot>
854
- `:p`
854
+ `:u`
855
855
  <slot></slot>
856
- `}};n(bo,"Price");var ol=n((t,e)=>({productPlans:t.productPlans,frequency:V(e.product)(t)}),"mapStateToProps"),Gs=g(ol)(bo);zs();var R,E={};function Ws(t){return R.dispatch(wr(t)),E}n(Ws,"setEnvironment");function Ys(t){return R.dispatch(yn(t)),E}n(Ys,"setMerchantId");function Qs(t){return R.dispatch(bn(t)),E}n(Qs,"setAuthUrl");function Js(t=[]){return Cr(R.getState(),t)}n(Js,"getProductsForPurchasePost");function Ks(t=[]){return Cr(R.getState(),t)}n(Ks,"getOptins");function Zs(){R.dispatch(En())}n(Zs,"clear");function Xs(t){typeof t=="function"&&document.addEventListener("optin-changed",e=>t(e.detail))}n(Xs,"addOptinChangedCallback");function ei(){document.addEventListener("optin-changed",t=>t.stopPropagation(),!0)}n(ei,"disableOptinChangedCallbacks");function ti(){try{customElements.define("og-when",Es),customElements.define("og-text",Ns),customElements.define("og-incentive-text",Us),customElements.define("og-offer",$s),customElements.define("og-select-frequency",Ds),customElements.define("og-optout-button",Os),customElements.define("og-optin-toggle",As),customElements.define("og-optin-status",vs),customElements.define("og-optin-button",ws),customElements.define("og-optin-select",Cs),customElements.define("og-upsell-button",Ps),customElements.define("og-frequency-status",Ts),customElements.define("og-modal",er),customElements.define("og-select",tr),customElements.define("og-tooltip",rr),customElements.define("og-upsell-modal",Rs),customElements.define("og-next-upcoming-order",Ls),customElements.define("og-price",Gs)}catch(t){console.warn(t)}E.register=()=>0}n(ti,"register");function ri(t){return window.og=window.og||{},t===!1?delete window.og:window.og.previewMode=!0,this}n(ri,"previewMode");function oi(t){return R.dispatch(wn(t)),E}n(oi,"config");function ni(t){return R.dispatch(vn(t)),E}n(ni,"setLocale");function si(t,e,r){return R.dispatch(On(t,e,r)),E}n(si,"addTemplate");function ii(t){return R.dispatch(Tn(t)),E}n(ii,"setTemplates");function ai(t){return E}n(ai,"setPublicPath");function ci(t,e,r,o=R){if(t&&e&&r){let s=[];r.product?s.push(r.product):r.cart&&Array.isArray(r.cart.products)&&(s=s.concat(r.cart.products));let{apiUrl:i}=_r({},wr(e)),{sessionId:a}=o.getState();a&&s.forEach(c=>{Q.fetchOffer(i,t,a,`${c}`,"pdp")}),r.product_discounts&&typeof r.product_discounts=="object"&&o.dispatch({type:wt,payload:r.product_discounts})}}n(ci,"resolveSettings");function _o(t,e,r){return E.isReady?(console.warn("og.offers has been initialized already. Skipping."),E):(R=Ln(),E.store=R,E.resolveSettings(t,e,window.og_settings,R),Uo(R),t&&E.setMerchantId(t),e&&E.setEnvironment(e),r&&E.setAuthUrl(r),window.addEventListener("storage",In(R)),t&&e&&(R.dispatch(Ft()),R.dispatch(_n()),E.register()),E.isReady=!0,E)}n(_o,"initialize");var nl=_o;Object.assign(E,{setEnvironment:Ws,setMerchantId:Ys,setAuthUrl:Qs,getProductsForPurchasePost:Js,getOptins:Ks,clear:Zs,addOptinChangedCallback:Xs,disableOptinChangedCallbacks:ei,register:ti,previewMode:ri,config:oi,setLocale:ni,addTemplate:si,setTemplates:ii,setPublicPath:ai,resolveSettings:ci,initialize:_o});window.OG=window.OG||{};Object.assign(window.OG,E);Object.assign(E.initialize,E);ir();return sl;})();
856
+ `}};n(mo,"Price");var jc=n((t,e)=>({productPlans:t.productPlans,frequency:j(e.product)(t)}),"mapStateToProps"),Ds=h(jc)(mo);Us();var C,_={};function Fs(t){return C.dispatch(Er(t)),_}n(Fs,"setEnvironment");function Ls(t){return C.dispatch(an(t)),_}n(Ls,"setMerchantId");function js(t){return C.dispatch(cn(t)),_}n(js,"setAuthUrl");function Ms(t=[]){return wr(C.getState(),t)}n(Ms,"getProductsForPurchasePost");function Vs(t=[]){return wr(C.getState(),t)}n(Vs,"getOptins");function $s(){C.dispatch(pn())}n($s,"clear");function Bs(t){typeof t=="function"&&document.addEventListener("optin-changed",e=>t(e.detail))}n(Bs,"addOptinChangedCallback");function Hs(){document.addEventListener("optin-changed",t=>t.stopPropagation(),!0)}n(Hs,"disableOptinChangedCallbacks");function zs(){try{customElements.define("og-when",ps),customElements.define("og-text",Es),customElements.define("og-incentive-text",Ts),customElements.define("og-offer",ks),customElements.define("og-select-frequency",Os),customElements.define("og-optout-button",ms),customElements.define("og-optin-toggle",xs),customElements.define("og-optin-status",fs),customElements.define("og-optin-button",hs),customElements.define("og-optin-select",ys),customElements.define("og-upsell-button",bs),customElements.define("og-frequency-status",gs),customElements.define("og-modal",Kt),customElements.define("og-select",Zt),customElements.define("og-tooltip",Xt),customElements.define("og-upsell-modal",_s),customElements.define("og-next-upcoming-order",Ps),customElements.define("og-price",Ds)}catch(t){console.warn(t)}_.register=()=>0}n(zs,"register");function Gs(t){return window.og=window.og||{},t===!1?delete window.og:window.og.previewMode=!0,this}n(Gs,"previewMode");function Ws(t){return C.dispatch(hn(t)),_}n(Ws,"config");function Ys(t){return C.dispatch(fn(t)),_}n(Ys,"setLocale");function Qs(t,e,r){return C.dispatch(mn(t,e,r)),_}n(Qs,"addTemplate");function Js(t){return C.dispatch(gn(t)),_}n(Js,"setTemplates");function Ks(t){return _}n(Ks,"setPublicPath");function Zs(t,e,r,o=C){if(t&&e&&r){let s=[];r.product?s.push(r.product):r.cart&&Array.isArray(r.cart.products)&&(s=s.concat(r.cart.products));let{apiUrl:i}=gr({},Er(e)),{sessionId:a}=o.getState();a&&s.forEach(c=>{W.fetchOffer(i,t,a,`${c}`,"pdp")}),r.product_discounts&&typeof r.product_discounts=="object"&&o.dispatch({type:xt,payload:r.product_discounts})}}n(Zs,"resolveSettings");function go(t,e,r){return _.isReady?(console.warn("og.offers has been initialized already. Skipping."),_):(C=Pn(),_.store=C,_.resolveSettings(t,e,window.og_settings,C),Oo(C),t&&_.setMerchantId(t),e&&_.setEnvironment(e),r&&_.setAuthUrl(r),window.addEventListener("storage",vn(C)),t&&e&&(C.dispatch(qt()),C.dispatch(ln()),_.register()),_.isReady=!0,_)}n(go,"initialize");var Mc=go;Object.assign(_,{setEnvironment:Fs,setMerchantId:Ls,setAuthUrl:js,getProductsForPurchasePost:Ms,getOptins:Vs,clear:$s,addOptinChangedCallback:Bs,disableOptinChangedCallbacks:Hs,register:zs,previewMode:Gs,config:Ws,setLocale:Ys,addTemplate:Qs,setTemplates:Js,setPublicPath:Ks,resolveSettings:Zs,initialize:go});window.OG=window.OG||{};Object.assign(window.OG,_);Object.assign(_.initialize,_);or();return Vc;})();
857
857
  ; return lib; });
858
858
  //# sourceMappingURL=offers.js.map