!function(){"use strict";function e(){}function t(e){return e()}function r(e){e.forEach(t)}function n(t){if(null==t)return e;for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;oe.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:e,o=new Set;function u(e){if(p=e,((f=t)!=f?p==p:f!==p||f&&"object"==typeof f||"function"==typeof f)&&(t=e,r)){var n,u=!s.length,c=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,u=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){c=!0,s=e},f:function(){try{u||null==r.return||r.return()}finally{if(c)throw s}}}}(o);try{for(c.s();!(n=c.n()).done;){var a=n.value;a[1](),s.push(a,t)}}catch(e){c.e(e)}finally{c.f()}if(u){for(var l=0;l1&&void 0!==arguments[1]?arguments[1]:e];return o.add(s),1===o.size&&(r=n(u)||e),i(t),function(){o.delete(s),0===o.size&&r&&(r(),r=null)}}}}function c(t,o,i){var s=!Array.isArray(t),c=s?[t]:t,a=o.length<2;return{subscribe:u(i,(function(t){var i=!1,u=[],l=0,f=e,p=function(){if(!l){f();var r=o(s?u[0]:u,t);a?t(r):f="function"==typeof r?r:e}},d=c.map((function(e,t){return n(e,(function(e){u[t]=e,l&=~(1<{if(i=r,a&&(s=e),!u){let n=t(e,r);if(!(t.length<2))return n;r(n)}u=!1}),n),f=!Array.isArray(e),p=t=>{f?(u=!0,e.set(t)):t.forEach(((t,r)=>{u=!0,e[r].set(t)})),u=!1};a&&(r=r.withOld);var d=r.length>=(a?3:2),m=null,_=!1;function g(e){var t,n,u,c;if(_)return c=e(o(l)),void i(c);var f=l.subscribe((e=>{_?t?n=!0:t=!0:u=e}));c=e(u),_=!0,i(c),f(),_=!1,n&&(c=o(l)),t&&function(e){if(m&&(m(),m=null),a)var t=r(e,s,p);else t=r(e,p);d?"function"==typeof t&&(m=t):p(t)}(c)}return{subscribe:l.subscribe,set(e){g((()=>e))},update:g}}function l(e,t){if(Array.isArray(t)){let r=t.concat();return a(e,(e=>{for(let t=0;te[t]),{withOld(e,r){return r[t]=e,r}})}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function p(e){for(var t=1;t{const n=p({},e);return o=Reflect.set(n,t,r),n})),o},has(e,t){return Reflect.has(o(e),t)},ownKeys(e){return Reflect.ownKeys(o(e))},defineProperty(e,t,r){let n;return e.update((e=>{const o=p({},e);return n=Reflect.defineProperty(o,t,r),o})),n},deleteProperty(e,t){let r;return t in o(e)&&(e.update((e=>{const n=p({},e);return r=Reflect.deleteProperty(n,t),n})),r)},getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(o(e),t)},getPrototypeOf(e){return Reflect.getPrototypeOf(o(e))},setPrototypeOf(e,t){return Reflect.setPrototypeOf(e,t)},isExtensible(e){return Reflect.isExtensible(o(e))},preventExtensions(e){return Reflect.preventExtensions(e)},apply(e,t,r){return Reflect.apply(o(e),t,r)},construct(e,t,r){return Reflect.construct(o(e),t,r)}})}let _;try{_=(window.Cypress?window:window.parent).Rivo}catch(e){console.error(e),_=window.Rivo}const g=u(_),h=m(g),v=l(g,"loy_config"),y=m(v);function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.common.shop.money_format||"{{amount_with_comma_separator}}$")),l(v,"ways_to_earn"),l(v,"referral_rewards"),l(v,"vip_tiers"),l(g,["common","customer"]),u(),u(),u(),u([]),l(v,"rewards"),u(),u({bottom:void 0}),u();class b{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.$appConfig,r=void 0===t?y:t,n=e.includeShopParamOnRequests,o=void 0!==n&&n;this.includeShopParamOnRequests=o,this.$appConfig=r}url(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=new URL(this.$appConfig.api_endpoint,window.location.href);/\/$/.test(n.pathname)||(n.pathname+="/");const o=new URL(t,n);if(this.includeShopParamOnRequests&&o.searchParams.set("shop",h.common.shop.permanent_domain),window.Shopify?.designMode&&(console.log("DesignMode",window.location.href),o.searchParams.set("oseid",window.location.href.split("oseid=")[1])),"GET"===e){o.pathname+=".json";for(const e of Object.entries(r)){var i=(u=2,function(e){if(Array.isArray(e))return e}(s=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,u=[],c=!0,a=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){a=!0,o=e}finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(a)throw o}}return u}}(s,u)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(e,t):void 0}}(s,u)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());const t=i[0],r=i[1];o.searchParams.set(t,r)}}var s,u;return window.Rivo?.global_config?.fetch_url_to_string?o.toString():o}async request(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.url(...arguments),o={"Content-Type":"application/json"};let i;["POST","PUT"].includes(e)&&(i=window.parent.Rivo?.preview_mode?JSON.stringify({}):JSON.stringify(r));try{const t=await fetch(n,{method:e,headers:o,body:i});return 200!==t.status?(console.error(`API response status is ${t.status}`),{}):t.json()}catch(e){return console.error(e),{}}}async requestWithFormData(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=this.url(...arguments),o=new FormData;for(const e in r){const t=r[e];t&&o.append(e,t)}try{const t=await fetch(n,{method:e,body:o});return 200!==t.status?(console.error(`API response status is ${t.status}`),{}):t.json()}catch(e){return console.error(e),{}}}}function P(e){e&&window.parent.postMessage({msg_action:"event.points_update",msg_options:{points_tally:e}})}const T=function(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return e?n.request("GET",`customer/${e}`,{fields:t?.fields}).then((function(e){return e.customer})):Promise.resolve()},update_dob:function(e,t){return e&&t?n.request("PUT",`customer/${e}`,{dob:t}).then((function(e){return!(!e||!0!==e.success)})):Promise.resolve()},points_logs:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:25;var o={points_logs:[],metadata:{prev_page:null,next_page:null}};if(!e)return Promise.resolve(o);var i={customer_id:e,per_page:r};return t&&(i.page=t),n.request("GET",`customers/${e}/points_logs`,i).then((function(e){return e||(e=o),e}))},best_reward_to_show:function(e){return e?n.request("GET",`customers/${e}/next_reward`,{}).then((function(e){return e.reward})):Promise.resolve()},referrer_opt_in:function(e,t,r){return n.request("POST","opt_in_referrer",{shop:h.common.shop.permanent_domain,email:e,first_name:t,accepts_marketing:r}).then((function(e){return e}))},send_advocate_email_stats:function(e){return n.request("POST","send_advocate_email_stats",{shop:h.common.shop.permanent_domain,email:e}).then((function(e){return e}))},referrals:function(e,t){return e?n.request("GET",`customers/${e}/referrals`,{page:t}).then((function(e){return e})):Promise.resolve()},referral_claim_visitor:function(e){return n.request("POST","claim_visitor_referral",{shop:h.common.shop.permanent_domain,visitor_token:window.Rivo?.visitor_token,referral_campaign_id:e}).then((function(e){return e}))},referral_stats:function(e){return e?n.request("GET",`customers/${e}/referral_stats`,{}).then((function(e){return e})):Promise.resolve()},referral_signup:function(e,t,r,o,i,s){return n.request("POST","referrals",{shop:h.common.shop.permanent_domain,email:e,referral_code:t,visitor_token:r,source:o,referral_campaign_id:i,accepts_marketing:s}).then((function(e){return e}))},upload_receipt:function(e,t){return e&&t?n.requestWithFormData("POST",`customers/${e}/upload_receipt`,{shop:h.common.shop.permanent_domain,file:t}).then((function(e){return e})):Promise.resolve()},referral_invite:function(e,t,r,o,i,s){return n.request("POST",`customers/${o}/referral_invitation`,{shop:h.common.shop.permanent_domain,email_recipients:e,email_subject:t,email_note:r,customer_id:o,referral_campaign_id:i,send_reminder:s}).then((function(e){return e}))},grant_social_points:function(e,t){return n.request("POST",`customers/${e}/grant_social_earnings`,{social_action:t}).then((function(e){if(e&&!0===e.success)return P(e.points_tally),e}))},grant_visit_url_points:function(e,t){return n.request("POST",`customers/${e}/grant_visit_url_points`,{url:t}).then((function(e){if(e&&!0===e.success)return P(e.points_tally),e}))},subscribe_email:function(e,t){return n.request("POST",`customers/${e}/subscribe_email`,{email:t}).then((function(e){if(e&&!0===e.success)return P(e.points_tally),e}))},points_purchases:function(e,t,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:250;var i={points_purchases:[],metadata:{prev_page:null,next_page:null}};if(!e)return Promise.resolve(i);var s={customer_id:e,used:t||!1,per_page:o};return r&&(s.page=r),n.request("GET","points_purchases",s).then((function(e){return e||(e=i),e}))},redeem:function(e,t,r,o){return e&&t?n.request("POST",`customers/${e}/spend_points`,{reward_name:t,points:r,credits:o}).then((function(e){if(e)return P(e.points_tally),e})):Promise.resolve()},product:function(e){return n.request("GET",`products/${e}`)},products:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"db",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return n.request("GET",`rivo_products?product_ids=${e.join(",")}&source=${t}&shopify_market_currency_code=${r}`)},customer_preferences:function(e){return n.request("GET",`customers/${e}/customer_preferences`)},popular_products:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"db",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.request("GET",`popular_products?source=${e}&shopify_market_currency_code=${t}`)},legacy_points_balance:function(e){return n.request("GET",`customers/loggedin/legacy_points_balance?legacy_app=${e}`)},legacy_gift_card:function(e){return n.request("GET",`customers/loggedin/legacy_gift_card?legacy_app=${e}`)},legacy_membership_data:function(e){return n.request("GET",`customers/loggedin/legacy_membership_data?legacy_app=${e}`)},membership:function(){return n.request("GET","customers/loggedin/membership")},favorite_products:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"db",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.request("GET",`customers/loggedin/favorite_products?source=${e}&shopify_market_currency_code=${t}`)},add_favorite_product:function(e){return n.request("POST","customers/loggedin/favorite_products",{product_id:e})},saved_cart_items:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"db",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return n.request("GET",`customers/loggedin/saved_cart_items?source=${e}&shopify_market_currency_code=${t}`)},update_saved_cart_collection:function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return n.request("POST","customers/loggedin/saved_cart_items",{shopify_market_currency_code:r,product_ids:e,action_type:t,visitor_token:window.Rivo?.visitor_token})},favorite_collections:function(){return n.request("GET","customers/loggedin/favorite_collections")},create_favorite_collection:function(e,t){return n.request("POST","customers/loggedin/favorite_collections",{product_ids:e,collection_name:t,visitor_token:window.Rivo?.visitor_token})},update_favorite_collection_products:function(e,t,r){return n.request("PUT",`customers/loggedin/favorite_collections/${t}`,{product_ids:[e],action_type:r})},preferences:function(){return n.request("GET","customers/loggedin/preferences")},orders:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e?n.request("GET",`customers/${e}/shopify_orders`,{limit:t,next_page_info:r}):Promise.resolve()},order:function(e,t){return n.request("GET",`customers/${e}/shopify_orders/${t}`)},gift_card_lookup:function(e){return n.request("GET",`gift_card_lookup/${e}`)},gift_card_code_uid:function(e){return n.request("GET",`gift_card_code_uid/${e}`)},order_payment_details:function(e,t){return n.request("GET",`customers/${e}/shopify_order_payment_details/${t}`)},order_tracking:function(e){return n.request("GET",`customers/loggedin/shopify_order_tracking?order_number=${e}`)},subscription_contract:function(){return n.request("GET","customers/loggedin/subscription_contract")},shopify_customer:function(e){return e?n.request("GET",`customers/${e}/shopify_customer`):Promise.resolve()},vip_tier:function(e){return n.request("GET",`vip_tiers/${e}`)},customer_tier:function(e){return e&&y.vip_program_enabled?n.request("GET",`customers/${e}/vip_tiers`,{}).then((function(e){return e})):Promise.resolve()},membership_logs:function(e){return e?n.request("GET",`customers/${e}/vip_memberships`,{}).then((function(e){return e})):Promise.resolve()}};var n}({includeShopParamOnRequests:!0}),O=window.top.Rivo.common.customer?.id;window.RivoAPI=T,window.RivoJS={openWidget:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.top.postMessage({msg_action:"widget.open",msg_options:e},"*")},closeWidget:function(){window.top.postMessage({msg_action:"widget.close",msg_options:{}},"*")},getShopRewards:function(){return T.rewards()},getShopVipTier:function(e){return T.vip_tier(e)},getCustomerDetails:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return T.identify_customer(O,e)},getCustomerPointsLogs:function(e){return T.points_logs(O,e)},getCustomerReferrals:function(e){return T.referrals(O,e)},getCustomerReferralStats:function(){return T.referral_stats(O)},getCustomerPointsPurchases:function(){let e=arguments.length>1?arguments[1]:void 0,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).used||!1;return T.points_purchases(O,t,e)},getCustomerVipTier:function(){return T.customer_tier(O)},getCustomerVipTierLogs:function(){return T.membership_logs(O)},getCustomerBestRewardToShow:function(){return T.best_reward_to_show(O)},updateCustomerDob:function(e){return T.update_dob(O,e)},redeemReward:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return T.redeem(O,e,t.points,t.credits)}},window.addEventListener("message",(function(e){e.origin===window.location.origin&&"event.points_update"===e.data.msg_action&&document.querySelectorAll(".rivo-points-balance").forEach((function(t){t.innerHTML=e.data.msg_options.points_tally}))}));const q=new Event("rivo-js-loaded");document.dispatchEvent(q)}(); //# sourceMappingURL=https://d15d3imw3mjndz.cloudfront.net/assets/storefront/ba_rivo_api.js-df343968bf52357f3000e2576147023a0694555dcb0d8018de2af5ec866b467a.map //! ;