/*! For license information please see vendor.824ce93f50031b2e36d4.js.LICENSE.txt */ (self.webpackChunkui=self.webpackChunkui||[]).push([[7],{22:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.initBentoAnalytics=t.logCollectionView=t.loadShopifyAccount=t.DEFAULT_SHOPIFY_ACCOUNT_DATA=void 0,t.logViewCart=async function(){const e=(0,y.uuid)();await(0,y.callOrlyTagHooks)("viewCart",e)},t.logViewContent=async function(e){const n=(0,y.uuid)(),r=[(0,s.logGoogleViewContent)(e,n),(0,p.logSnapchatViewContent)(e,n)];await(0,t.loadShopifyAccount)();const o=[(0,y.callOrlyTagHooks)("viewContent",e,n),(0,u.logOutsmartlyViewedProduct)(e,n),(0,u.logOutsmartlySelectedVariant)(e,n),(0,l.logFacebookViewContent)(e,n)];await Promise.allSettled([...r,...o])},t.loadScript=h,t.loadAccount=w,t.logClickContent=async function(e,t,n=0){const r=window.__APP_CONFIG__.eventId||(0,y.uuid)();await(0,y.callOrlyTagHooks)("clickContent",e,t,n,r)},t.logSignUp=async function(e){const t=(0,y.uuid)();await Promise.allSettled([(0,y.callOrlyTagHooks)("signUp",e,t)])},t.logSignIn=async function(e){const t=(0,y.uuid)();await Promise.allSettled([(0,y.callOrlyTagHooks)("signIn",e,t)])},t.logSearch=async function(e,t){const n=(0,y.uuid)();await Promise.allSettled([(0,y.callOrlyTagHooks)("search",e,t,n)])};const o=n(48),i=n(53),a=n(137),c=n(180),l=n(182),s=n(138),u=n(139),d=n(50),p=n(141),y=n(6),f=r(n(54));async function g(e,t){const n=await(0,y.getCartComponents)(e);await Promise.allSettled(n.map(A).flatMap((e=>[(0,y.callOrlyTagHooks)("addToCart",e,t),(0,l.logAddToCartFacebook)(e,t),(0,d.logAddToCartPinterest)(e,t),(0,p.logAddToCartSnapchat)(e,t),(0,s.logAddToCartGoogleAnalytics)(e,t)])))}async function m(e,t){await(0,y.callOrlyTagHooks)("removeFromCart",e,t)}async function v(){const e=window.__APP_CONFIG__.eventId||(0,y.uuid)(),n=(0,t.loadShopifyAccount)(),r=n.then((async e=>{await w(e)}));await Promise.allSettled([(0,y.callOrlyTagHooks)("pageView",e,n),(0,s.logGooglePageView)(e,n),(0,p.logSnapchatPageView)(e,n),(0,u.logOutsmartlyPageView)(e,n),(0,d.logPinterestPageView)(e,n),(0,l.logFacebookPageView)(e,n),r])}async function h(){await Promise.allSettled([(0,y.callOrlyTagHooks)("loadScript"),new Promise((e=>{(0,s.loadGoogleAnalytics)(),e()}))])}async function w(e){await Promise.allSettled([(0,y.callOrlyTagHooks)("loadAccount",e),new Promise((t=>{(0,p.loadSnapchat)(e),t()}))])}t.DEFAULT_SHOPIFY_ACCOUNT_DATA={loggedIn:!1,id:"",email:"",phone:"",first_name:"",last_name:"",city:"",country:"",countryCode:"",zip:"",address1:"",address2:"",hashedEmail:"",loyaltylion_has_account:!1,loyaltylion_token:"",loyaltylion_auth_token:"",province:"",provinceCode:"",rechargeHash:"",date:"",tags:"",orderValue:"",orderId:"",theme:void 0},t.loadShopifyAccount=(0,f.default)((async()=>{const e=window.__APP_CONFIG__.ANALYTICS.accountEndpoint??"/api/account";try{return await fetch(e).then((e=>e.json())).catch((n=>(console.error("loadShopifyAccount from endpoint failed.\n",`Tried to fetch from: ${e}\n.`,"Returning a default account...\n",`error: ${JSON.stringify(n,Object.getOwnPropertyNames(n),2)}`),t.DEFAULT_SHOPIFY_ACCOUNT_DATA)))}catch(n){return console.warn(`Error loading account from '${e}', returning default account instead.\n You can change default account endpoint on window.__APP_CONFIG__.ANALYTICS.accountEndpoint.\n ${JSON.stringify(n,Object.getOwnPropertyNames(n),2)}`),t.DEFAULT_SHOPIFY_ACCOUNT_DATA}})),t.logCollectionView=(0,f.default)((async(e,t)=>{const n=(0,y.uuid)();await Promise.allSettled([(0,y.callOrlyTagHooks)("collectionView",e,t,n),(0,d.logPinterestCollectionView)(e,t,n),(0,s.logGoogleCollectionView)(e,t,n)])}));const _=async(e,t)=>{const n=await fetch(e,t),r=await n.json();return queueMicrotask((()=>function(e,t,n){if(!(0,y.isShopifyCart)(n)){if(!(0,y.isShopifyCartError)(n))throw new Error("unexpected response, not a ShopifyCart or ShopifyCartError");return n}const r=(0,y.normalizeCart)(n),o=t.get("x-event-id")??(0,y.uuid)();e.startsWith("/cart/add.js")?C(r,o):e.startsWith("/cart/change.js")||e.startsWith("/cart/update.js")?S(r,o):e.startsWith("/cart.json")?(0,y.updateCart)(r):console.error(`Unknown URL: ${e}`)}(e,n.headers,r))),r},C=(e,t)=>{const n=(0,y.getOldCart)();if(!n)return void(0,y.updateCart)(e);const r=new Map(n.items.map((e=>[e.key,e])));e.items.forEach((e=>{const n=r.get(e.key),o=n?.quantity||0,i=e.quantity-o;g({...e,quantity:i},t).catch((e=>{console.error(e)}))}))};function A(e){try{const t=e.properties,n=t._olpid??e.product_id.toString(),r=t._olvid??e.variant_id.toString();return{...e,product_id:Number.parseInt(n.toString()),variant_id:Number.parseInt(r.toString())}}catch{return e}}const S=(e,t)=>{const n=(0,y.getOldCart)();if(!n)return void(0,y.updateCart)(e);const r=(0,y.getItemCounts)(n.items),o=(0,y.getItemCounts)(e.items);for(const[e,n]of o.entries()){const o=r.get(e),i=o?.quantity||0,a=n.quantity-i;a>0?g({...n,quantity:a},t).catch((e=>{console.error(e)})):a<0&&m({...n,quantity:-a},t).catch((e=>{console.error(e)}))}for(const[e,n]of r.entries())o.has(e)||m(n,t).catch((e=>{console.error(e)}));(0,y.updateCart)(e)};t.initBentoAnalytics=(0,f.default)((async e=>{if("undefined"==typeof window)return void console.warn("initBentoAnalytics: window not defined, NOP.");if(!window.__APP_CONFIG__)return void console.warn("initBentoAnalytics: No window.__APP_CONFIG__ found.");if(!window.__APP_CONFIG__.ANALYTICS)return void console.warn("initBentoAnalytics: No window.__APP_CONFIG__.ANALYTICS found.");window.__APP_CONFIG__.fetchCartJSON=_;const t={elevar:o.initElevar};for(const n of(0,y.entries)(e))if(n){const[e,r]=n;r&&t[e]()}(0,i.initKlaviyo)(),(0,a.initShopify)(),(0,c.initTikTok)();try{await h().then(v)}catch(e){console.log(e)}}))},189:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useViewContent=function(e){(0,r.useEffect)((()=>{(0,o.logViewContent)(e).catch((e=>{console.error(e)}))}),[e.product_id,e.variant_id])},t.useCollectionView=function(e,t){(0,r.useEffect)((()=>{(0,o.logCollectionView)(e,t).catch((e=>{console.error(e)}))}),[e,t])};const r=n(3),o=n(22)},178:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadScriptWithDelay=t.loadScript=t.initBentoAnalytics=t.logCollectionView=t.logSearch=t.logSignIn=t.logSignUp=t.logViewContent=t.logViewCart=t.loadShopifyAccount=t.useCollectionView=t.useViewContent=t.useOutsmartlyErrorReporting=t.logOutsmartlyError=t.loadImapactRadius=t.loadAttn=t.loadIntellipse=t.loadKlaviyoSubscribe=t.loadKlaviyo=t.loadLoyaltyLion=t.loadSnapchat=t.loadPinterest=t.loadGoogleAnalytics=t.initShopify=t.initElevar=void 0;var r=n(48);Object.defineProperty(t,"initElevar",{enumerable:!0,get:function(){return r.initElevar}});var o=n(137);Object.defineProperty(t,"initShopify",{enumerable:!0,get:function(){return o.initShopify}});var i=n(138);Object.defineProperty(t,"loadGoogleAnalytics",{enumerable:!0,get:function(){return i.loadGoogleAnalytics}});var a=n(50);Object.defineProperty(t,"loadPinterest",{enumerable:!0,get:function(){return a.loadPinterest}});var c=n(141);Object.defineProperty(t,"loadSnapchat",{enumerable:!0,get:function(){return c.loadSnapchat}});var l=n(184);Object.defineProperty(t,"loadLoyaltyLion",{enumerable:!0,get:function(){return l.loadLoyaltyLion}});var s=n(53);Object.defineProperty(t,"loadKlaviyo",{enumerable:!0,get:function(){return s.loadKlaviyo}}),Object.defineProperty(t,"loadKlaviyoSubscribe",{enumerable:!0,get:function(){return s.loadKlaviyoSubscribe}});var u=n(186);Object.defineProperty(t,"loadIntellipse",{enumerable:!0,get:function(){return u.loadIntellipse}});var d=n(187);Object.defineProperty(t,"loadAttn",{enumerable:!0,get:function(){return d.loadAttn}});var p=n(188);Object.defineProperty(t,"loadImapactRadius",{enumerable:!0,get:function(){return p.loadImapactRadius}});var y=n(139);Object.defineProperty(t,"logOutsmartlyError",{enumerable:!0,get:function(){return y.logOutsmartlyError}}),Object.defineProperty(t,"useOutsmartlyErrorReporting",{enumerable:!0,get:function(){return y.useOutsmartlyErrorReporting}});var f=n(189);Object.defineProperty(t,"useViewContent",{enumerable:!0,get:function(){return f.useViewContent}}),Object.defineProperty(t,"useCollectionView",{enumerable:!0,get:function(){return f.useCollectionView}});var g=n(22);Object.defineProperty(t,"loadShopifyAccount",{enumerable:!0,get:function(){return g.loadShopifyAccount}}),Object.defineProperty(t,"logViewCart",{enumerable:!0,get:function(){return g.logViewCart}}),Object.defineProperty(t,"logViewContent",{enumerable:!0,get:function(){return g.logViewContent}}),Object.defineProperty(t,"logSignUp",{enumerable:!0,get:function(){return g.logSignUp}}),Object.defineProperty(t,"logSignIn",{enumerable:!0,get:function(){return g.logSignIn}}),Object.defineProperty(t,"logSearch",{enumerable:!0,get:function(){return g.logSearch}}),Object.defineProperty(t,"logCollectionView",{enumerable:!0,get:function(){return g.logCollectionView}}),Object.defineProperty(t,"initBentoAnalytics",{enumerable:!0,get:function(){return g.initBentoAnalytics}});var m=n(6);Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return m.loadScript}}),Object.defineProperty(t,"loadScriptWithDelay",{enumerable:!0,get:function(){return m.loadScriptWithDelay}})},187:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadAttn=function(){const{ATTN_ID:e,ATTN_DELAY:t=10}=window.__APP_CONFIG__.ANALYTICS;e&&(0,r.loadScriptWithDelay)({src:`//cdn.attn.tv/${e}/dtag.js`,id:"attn-script",timeout:1e3*t,anonymous:!1})};const r=n(6)},48:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.logElevarSearch=t.logElevarViewCart=t.logElevarViewContent=t.logElevarClickContent=t.logElevarCollectionView=t.logElevarRemoveFromCart=t.logElevarAddToCart=t.logElevarPageView=void 0,t.initElevar=function(){"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",t.logElevarAddToCart],["removeFromCart",t.logElevarRemoveFromCart],["clickContent",t.logElevarClickContent],["collectionView",t.logElevarCollectionView],["pageView",t.logElevarPageView],["viewCart",t.logElevarViewCart],["viewContent",t.logElevarViewContent],["loadScript",c],["search",t.logElevarSearch]))},t.loadElevar=c;const o=n(22),i=n(6),a=r(n(54));async function c(){try{await(0,i.waitForShopifyY)(),await fetch("/static-489c224a/elevar/live.html").then((e=>e.text())).then((e=>{const t=document.createRange().createContextualFragment(e);document.body.append(t)})),window.ElevarPushToDataLayer||(window.ElevarPushToDataLayer=e=>(window.ElevarDataLayer=window.ElevarDataLayer??[],window.ElevarDataLayer.push(e)))}catch(e){throw new Error("loadElevar error:"+JSON.stringify(e,Object.getOwnPropertyNames(e),2))}}async function l(e){const t=e??await(0,o.loadShopifyAccount)(),n=(0,i.getOldCart)(),r=n?.items.map(((e,t)=>({name:e.title,id:e.id.toString(),category:e.product_type||"unknown",brand:e.vendor,variant:e.variant_title,price:e.final_line_price.toString(),quantity:e.quantity.toString(),product_id:e.product_id.toString(),variant_id:e.variant_id.toString(),compare_at_price:e.original_line_price.toString(),image:e.image,inventory:"",list:"",url:e.url,position:t,properties:e.properties})))??[];return{user:{customer_address_1:t.address1||void 0,customer_address_2:t.address2||void 0,customer_city:t.city||void 0,customer_country:t.country||void 0,customer_email:t.email||void 0,customer_first_name:t.first_name||void 0,customer_id:t.id||void 0,customer_last_name:t.last_name||void 0,customer_order_count:void 0,customer_phone:t.phone||void 0,customer_province:t.province||void 0,customer_province_code:t.provinceCode||void 0,customer_tags:t.tags||void 0,customer_total_spent:t.orderValue||void 0,customer_zip:t.zip||void 0,user_consent:void 0,visitor_type:t.loggedIn?"logged_in":"guest"},cart:{items:r,total:n?.total_price.toString()??""}}}const s=async e=>{const t=(0,i.readCookie)("cart_currency")||(0,i.readCookie)("cartCurrency");return t&&""!==t?t:(e??await(0,o.loadShopifyAccount)()).currency||"USD"},u=(e,t)=>{const n=new URL(t?.url||window.location.href),r=n.pathname+n.search;return e.map(((e,t)=>{const n=e.selected_variant?.id||e.product.id,o=e.selected_variant?.price??e.product.price,i=e.selected_variant?.compare_at_price??e.product.compare_at_price,a=e.selected_variant?.inventory_quantity;return{id:e.selected_variant?.sku??n?.toString(),name:e.product.title,list:r,brand:e.product.vendor,category:e.product.type||"unknown",variant:e.selected_variant?.title,variant_id:e.selected_variant?.id?.toString(),position:t+1,price:o?.toFixed(2),quantity:a?a.toString():"1",product_id:e.product.id?.toString(),compare_at_price:i?.toFixed(2)??o?.toFixed(2),url:e.selected_variant?.url||e.product.url}}))};function d(e){const t=e.price.toFixed(2),n=e.original_price.toFixed(2),r=e.position??0,o=document.referrer?new URL(document.referrer):void 0;return{id:e.sku,name:e.product_title,price:t,image:e.image,brand:e.vendor,category:e.product_type||"unknown",compare_at_price:n===t||"0.00"===n?t:n,product_id:e.product_id.toString(),variant_id:e.variant_id.toString(),variant:e.variant_title,inventory:e.inventory?.toString(),list:o?`${o.pathname}${o.search}`:"",position:r+1,quantity:e.quantity.toString(),url:e.url,properties:e.properties}}function p(e,t,n=0){const r=e.selected_variant?.price??e.product.price,o=e.selected_variant?.compare_at_price??e.product.compare_at_price,i=e.selected_variant?.image??e.product.image,a=new URL(t?.url||window.location.href),c=a.pathname+a.search;return{id:e.selected_variant?.sku||e.product.id?.toString(),name:e.product.title,price:r?.toFixed(2),image:i?.src,brand:e.product.vendor,category:e.product.type||"unknown",compare_at_price:o===r||0===o?r?.toFixed(2):o?.toFixed(2),product_id:e.product.id?.toString(),variant_id:e.selected_variant?.id?.toString(),variant:e.selected_variant?.title,inventory:e.selected_variant?.inventory_quantity?.toString(),list:c,position:n+1,quantity:e.quantity?.toString(),url:e.selected_variant?.url||e.product.url}}t.logElevarPageView=async(e,t)=>{const n=await t,r=await s(n),{user:o,cart:i}=await l(n);window.ElevarPushToDataLayer?.({event:"dl_user_data",eventId:e,cart_total:i.total,user_properties:o,ecommerce:{currencyCode:r,cart_contents:{products:i.items}}})},t.logElevarAddToCart=async(e,t=(0,i.uuid)())=>{const n=d(e),r=await s(),{user:o}=await l();window.ElevarPushToDataLayer?.({event:"dl_add_to_cart",eventId:t,user_properties:o,ecommerce:{currencyCode:r,add:{actionField:{list:document.referrer?new URL(document.referrer).pathname:"",action:"add"},products:[n]}}})},t.logElevarRemoveFromCart=async(e,t=(0,i.uuid)())=>{const n=d(e),r=await s(),{user:o}=await l();window.ElevarPushToDataLayer?.({event:"dl_remove_from_cart",eventId:t,user_properties:o,ecommerce:{currencyCode:r,remove:{actionField:{list:"Shopping Cart"},products:[n]}}})},t.logElevarCollectionView=async(e,t,n=(0,i.uuid)())=>{const r=await s(),{user:o}=await l(),a=u(t,e);window.ElevarPushToDataLayer?.({event:"dl_view_item_list",eventId:n,user_properties:o,ecommerce:{currencyCode:r,impressions:a}})},t.logElevarClickContent=async(e,t,n=0,r=(0,i.uuid)())=>{const{user:o}=await l(),a=await s(),c=new URL(e.url||window.location.href),u=`${c.pathname}${c.search}`,d=[p(t,e,n)];window.ElevarPushToDataLayer?.({event:"dl_select_item",eventId:r,user_properties:o,ecommerce:{currencyCode:a,click:{actionField:{list:u,action:"click"},products:d}}})};const y=(0,a.default)((async e=>{const n=(0,i.cartItemToBentoAnalyticsItem)(e),r=document.referrer?new URL(document.referrer):void 0;await(0,t.logElevarClickContent)({id:-1,title:r?`${r.pathname}${r.search}`:"",url:document.referrer},n,0)}));t.logElevarViewContent=async(e,t=(0,i.uuid)())=>{document.referrer&&await y(e);const n=document.referrer||window.location.href?new URL(document.referrer||window.location.href):void 0,r=await s(),o=p((0,i.cartItemToBentoAnalyticsItem)(e));o.inventory||console.error("Please attach an inventory value to cartItem for logViewContent events.");const{user:a}=await l(),c=[o];window.ElevarPushToDataLayer?.({event:"dl_view_item",eventId:t,user_properties:a,ecommerce:{currencyCode:r,detail:{actionField:{list:n?`${n.pathname}${n.search}`:"",action:"detail"},products:c}}})},t.logElevarViewCart=async(e=(0,i.uuid)())=>{const n=await s();await(0,t.logElevarPageView)(e,(0,o.loadShopifyAccount)());const{user:r,cart:a}=await l();var c;window.ElevarPushToDataLayer?.({event:"dl_view_cart",eventId:e,user_properties:r,ecommerce:{currencyCode:n,actionField:{list:"Shopping Cart"},impressions:(c=a.items??[],c.map(((e,t)=>({...e,position:t+1,list:"Shopping Cart"}))))},cart_total:a.total})},t.logElevarSearch=async(e,t,n=(0,i.uuid)())=>{const r=await s(),{user:o}=await l(),a=new URL(window.location.href);a.searchParams.set("query",e),window.ElevarPushToDataLayer?.({event:"dl_view_search_results",eventId:n,user_properties:o,ecommerce:{currencyCode:r,actionField:{list:"search results"},impressions:u(t,{title:"search results test",url:a.toString(),id:-1})}})}},182:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logFacebookPageView=t.logFacebookViewContent=t.logAddToCartFacebook=void 0;const r=n(6),o=n(183);function i(){const{USE_FB_SDK:e,FB_INIT:t}=window.__APP_CONFIG__.ANALYTICS;return!e||t?t:(window.__APP_CONFIG__.ANALYTICS.FB_INIT=(async()=>{const{FB_ID:e}=window.__APP_CONFIG__.ANALYTICS;if(e&&((0,o.loadFacebookSdk)(),window.fbq)){(0,r.ccpa_dns)()?window.fbq("dataProcessingOptions",["LDU"],1,1e3):window.fbq("dataProcessingOptions",[]);const t=await s();window.fbq("init",e,t)}})(),window.__APP_CONFIG__.ANALYTICS.FB_INIT)}function a(e,t){const n=`${e.title??""} - ${t.title??""}`;return[`&cd[content_ids]=${t.id??""}`,"&cd[content_type]=product_group",`&cd[content_name]=${window.encodeURIComponent(n)}`,`&cd[currency]=${(0,r.readCookie)("cartCurrency")??"USD"}`,`&cd[value]=${window.encodeURIComponent(t.price??"0")}`,e.productType?`&cd[content_category]=${e.productType}`:"","&cd[num_items]=1"]}function c(e,t){const n=`${e.title??""} - ${t.title??""}`;return{content_ids:void 0===e.content_ids?t.id?[t.id]:[]:e.content_ids,content_type:"product",content_name:n,curency:(0,r.readCookie)("cartCurrency")??"USD",value:Number.parseFloat(t.price??"0"),content_category:e.productType}}async function l(e){const t=(0,r.readCookie)("_shopify_y"),n=(0,r.readCookie)("_fbp"),o=(0,r.readCookie)("_fbc"),i=await async function(){const e=await s();return e?await Promise.all(Object.entries(e).map((async([e,t])=>t&&"string"==typeof t?`&ud[${e}]=${window.encodeURIComponent(await(0,r.sha256)(t))}`:""))):[]}(),a=`${document.location.pathname}${document.location.search}`;return[`&dl=${window.encodeURIComponent(a)}`,`&eid=${e}`,n?`&fbp=${window.encodeURIComponent(n)}`:"",o?`&fbc=${window.encodeURIComponent(o)}`:"",t?`&external_id[0]=${window.encodeURIComponent(t)}`:"",...i,(0,r.ccpa_dns)()?"&dpo=LDU&dpoco=1&dpost=1000":"&dpo="].join("")}async function s(){const e=await window.__APP_CONFIG__.account;if(e?.id)return{em:e.email,fn:e.first_name,ln:e.last_name,ph:e.phone?.replace(/\D+/g,"")}}t.logAddToCartFacebook=async(e,t)=>{const{FB_ID:n,USE_FB_SDK:o}=window.__APP_CONFIG__.ANALYTICS;if(!n)return;const[s,u]=(0,r.buildProductAndVariant)(e);if(await i(),o&&window.fbq?.loaded)window.fbq("track","AddToCart",c(s,u),{eventID:t});else try{(0,r.imagePixel)([`https://www.facebook.com/tr/?id=${n}`,"&ev=AddToCart",await l(t),...a(s,u)].join(""))}catch(e){console.error(e)}},t.logFacebookViewContent=async(e,t)=>{const{FB_ID:n,USE_FB_SDK:o}=window.__APP_CONFIG__.ANALYTICS;if(!n)return;const[s,u]=(0,r.buildProductAndVariant)(e);try{if(await i(),o&&window.fbq?.loaded)return void window.fbq("track","ViewContent",c(s,u),{eventID:t});(0,r.imagePixel)([`https://www.facebook.com/tr/?id=${n}`,"&ev=ViewContent",await l(t),...a(s,u)].join(""))}catch(e){console.error(e)}},t.logFacebookPageView=async e=>{const{FB_ID:t,USE_FB_SDK:n}=window.__APP_CONFIG__.ANALYTICS;if(t)if(await i(),n&&window.fbq?.loaded)window.fbq("track","PageView");else try{(0,r.imagePixel)(`https://www.facebook.com/tr/?id=${t}&ev=PageView${await l(e)}`)}catch(e){console.error(e)}}},138:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logGoogleCollectionView=t.logGoogleClickContent=t.logGoogleViewContent=t.logAddToCartGoogleAnalytics=t.event=t.logGooglePageView=t.loadGoogleAnalytics=void 0;const r=n(6);t.loadGoogleAnalytics=()=>{const{GA_ID:e,GA_USE_GTM:t}=window.__APP_CONFIG__.ANALYTICS;e&&(window.gtag||(window.gtag=function(...e){window.dataLayer=window.dataLayer||[],window.dataLayer.push(e)},window.gtag("js",new Date)),t?function(e,t,n,r,o){e[r]=e[r]||[],e[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var i=t.getElementsByTagName(n)[0],a=t.createElement(n);a.async=!0,a.src="https://www.googletagmanager.com/gtm.js?id="+o,i.parentNode.insertBefore(a,i)}(window,document,"script","dataLayer",e):(0,r.loadScript)({src:`https://www.googletagmanager.com/gtag/js?id=${e}`,id:"google-analytics",defer:!1,async:!0}))};let o="";function i(e,t,n={},r=!0){void 0!==window.gtag&&window.gtag("event",e,{...n,currency:"USD",items:t,non_interaction:r})}function a(e,t,n){return{item_id:e.selected_variant?.sku||e.product.id?.toString()||"",item_name:[e.product.title,e.selected_variant?.title].filter((e=>!!e)).join(" "),item_category:e.product.type??"",price:e.product.price,item_brand:e.product.vendor,item_list_id:t.url,item_list_name:t.title,item_variant:e.selected_variant?.id?.toString(),index:n,quantity:e.quantity||1,affiliation:void 0,coupon:void 0,discount:void 0,location_id:void 0}}t.logGooglePageView=()=>{const{GA_ID:e,ADDITIONAL_GA:t}=window.__APP_CONFIG__.ANALYTICS;if(!e)return;const n=`${document.location.pathname}${document.location.search}`,i=window.gtag;if(i&&o!==n&&(o=n,(0,r.ccpa_dns)()&&i("set",{restricted_data_processing:!0}),i("config",e,{page_path:n}),t))for(const e of t)i("config",e,{page_path:n})},t.event=({action:e,category:t,label:n,value:r,non_interaction:o})=>{window.gtag&&window.gtag("event",e,{event_category:t,event_label:n,value:r,non_interaction:o})},t.logAddToCartGoogleAnalytics=e=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&i("add_to_cart",[a((0,r.cartItemToBentoAnalyticsItem)(e),{title:document.title,id:-1,url:window.location.toString()})],{},!1)},t.logGoogleViewContent=e=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&i("view_item",[a((0,r.cartItemToBentoAnalyticsItem)(e),{title:document.title,id:-1,url:window.location.toString()})])},t.logGoogleClickContent=(e,t,n=0)=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&i("select_content",[a(t,e,n)],{content_type:"product"})},t.logGoogleCollectionView=(e,t)=>{window.__APP_CONFIG__.ANALYTICS.GA_ID&&i("view_item_list",t.map(((t,n)=>a(t,e,n))))}},188:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadImapactRadius=function(){const{IMPACTRADIUS_ENABLED:e=!1,IMPACTRADIUS_DELAY:t=5}=window.__APP_CONFIG__.ANALYTICS;e&&(0,r.loadScriptWithDelay)({src:"//d.impactradius-event.com/A2248058-8d0a-428f-b528-d1484c8157851.js",id:"impact-radius-script",timeout:1e3*t,anonymous:!1})};const r=n(6)},186:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadIntellipse=function(){const{ANALYTICS:{INTELLIPSE_ENABLED:e=!1,INTELLIPSE_DELAY:t=10},SHOP_NAME:n}=window.__APP_CONFIG__;e&&(0,r.loadScriptWithDelay)({src:`https://bootstrap.production.intellipse.com/bootstrap.js?shop=${n}.myshopify.com`,id:"intellipse-script",timeout:1e3*t,anonymous:!1})};const r=n(6)},53:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadKlaviyoSubscribe=t.loadKlaviyo=void 0,t.initKlaviyo=function(){a()&&"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",i],["viewContent",o],["loadScript",t.loadKlaviyo]))};const r=n(6);t.loadKlaviyo=()=>{const{ANALYTICS:{KLAVIYO_ID:e,KLAVIYO_DELAY:t=2},SHOP_NAME:n}=window.__APP_CONFIG__;e&&(function(){if(!window.klaviyo){window._klOnsite=window._klOnsite||[];try{window.klaviyo=new Proxy({},{get:function(e,t){return"push"===t?function(){var e;(e=window._klOnsite).push.apply(e,arguments)}:function(){for(var e=arguments.length,n=new Array(e),r=0;r{if(!a())return;const[n]=(0,r.buildProductAndVariant)(e),o=`${document.location.pathname}${document.location.search}`,i={Name:n.title,ProductID:n.id,ImageURL:n.image,URL:o,Brand:n.vendor,Price:n.price,CompareAtPrice:n.compareAtPrice??void 0},c={Name:i.Name,ProductID:i.ProductID,Handle:i.URL,Brand:i.Brand,Price:i.Price,ImageUrl:i.ImageURL,Metadata:{Brand:i.Brand,Price:i.Price,CompareAtPrice:i.CompareAtPrice},event_id:`${t}_${Date.now().toString()}`};window.klaviyo.push(["track","Viewed Product",c]);const l={Name:i.Name,ProductID:i.ProductID,Handle:i.URL,Brand:i.Brand,Price:i.Price,ImageUrl:i.ImageURL,Metadata:{Brand:i.Brand,Price:i.Price,CompareAtPrice:i.CompareAtPrice},event_id:`${t}_${Date.now().toString()}`};window.klaviyo.push(["trackViewedItem",l]),window.geq?.event("Viewed Product Reclaim",l)},i=(e,t)=>{if(!a())return;const[n,o]=(0,r.buildProductAndVariant)(e),i=(0,r.getCurrentPrice)(n,o),c=(0,r.getCartValue)(i),l={Name:n.title,ProductID:n.id,ImageURL:n.image,Handle:n.handle,Brand:n.vendor,Price:i,Properties:e.properties,$value:c,$event_id:`${t}_${Date.now().toString()}`};window.klaviyo.push(["track","Added to Cart",l]),window.geq?.addToCart(l)};function a(){const{KLAVIYO_ID:e}=window.__APP_CONFIG__.ANALYTICS;return!!e}t.loadKlaviyoSubscribe=()=>{const{KLAVIYO_DELAY:e=0}=window.__APP_CONFIG__.ANALYTICS,t={src:"//www.klaviyo.com/media/js/public/klaviyo_subscribe.js",id:"klaviyo-subscribe-script",timeout:1e3*e,anonymous:!1};(0,r.loadScriptWithDelay)(t,(()=>{window.KlaviyoSubscribe?window.KlaviyoSubscribe.attachToForms("#footer_email_signup",{hide_form_on_success:!0}):console.warn("KlaviyoSubscribe not found")}))}},183:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadFacebookSdk=function(){var e,t,n,r,o,i;e=window,t=document,n="script",e.fbq||(r=e.fbq=function(){r.callMethod?r.callMethod.apply(r,arguments):r.queue.push(arguments)},e._fbq||(e._fbq=r),r.push=r,r.loaded=!0,r.version="2.0",r.queue=[],(o=t.createElement(n)).async=!0,o.src="https://connect.facebook.net/en_US/fbevents.js",(i=t.getElementsByTagName(n)[0]).parentNode.insertBefore(o,i))}},181:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadTikTokScript=function(e){!function(t,n,r){t.TiktokAnalyticsObject=r;var o=t[r]=t[r]||[];o.methods=["page","track","identify","instances","debug","on","off","once","ready","alias","group","enableCookie","disableCookie"],o.setAndDefer=function(e,t){e[t]=function(){e.push([t].concat(Array.prototype.slice.call(arguments,0)))}};for(var i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadLoyaltyLion=function(e){return new Promise(((t,n)=>{if(window.loyaltylion&&(window.loyaltylion=window.lion=void 0,function(){for(const e of document.querySelectorAll("[data-lion-react-container]"))e.remove();for(const e of document.querySelectorAll("#loyaltylion"))e.remove()}()),!e.loyaltylion_token||!window.__APP_CONFIG__.ANALYTICS.LOYALTYLION_ENABLED)return console.log("LoyaltyLion wasn't loaded because it isn't enabled for this site."),void t();"function"==typeof window.requestIdleCallback?window.requestIdleCallback((()=>{o(e,t,n)})):setTimeout((()=>{o(e,t,n)}),0)}))};const r=n(185);function o({loggedIn:e,id:t,email:n,first_name:o,last_name:i,loyaltylion_has_account:a,loyaltylion_token:c,rechargeHash:l,loyaltylion_auth_token:s,date:u},d,p){try{(0,r.loadScript)(),a&&e&&n?window.loyaltylion?.init({token:c??"",customer:{id:t??"",email:n,name:`${o??""} ${i??""}`,rechargeHash:l??""},auth:{date:u??"",token:s??""}}):window.loyaltylion?.init({token:c??""}),window.loyaltylion?.on("ready",(()=>{setTimeout((()=>{d()}),0)}))}catch(e){console.error(`Could not load LoyaltyLion: ${JSON.stringify(e)}`),p(e)}}},185:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadScript=function(){!function(e,t){function n(t){var n=e.getElementsByTagName("script")[0],r=e.createElement("script");r.src=t,r.crossOrigin="",r.onload=e=>{e.target.parentNode.removeChild(e.target)},n.parentNode.insertBefore(r,n)}if(!t.isLoyaltyLion){window.loyaltylion=t,void 0===window.lion&&(window.lion=t),t.version=2,t.isLoyaltyLion=!0;var r=new Date,o=r.getFullYear().toString()+r.getMonth().toString()+r.getDate().toString();n("https://sdk.loyaltylion.net/static/2/loader.js?t="+o);var i=!1;t.init=function(e){if(i)throw new Error("Cannot call lion.init more than once");i=!0;var a=t._token=e.token;if(!a)throw new Error("Token must be supplied to lion.init");for(var c=[],l="_push configure bootstrap shutdown on removeListener authenticateCustomer".split(" "),s=0;s(window.addEventListener("unhandledrejection",i),window.addEventListener("error",i),()=>{window.removeEventListener("unhandledrejection",i),window.removeEventListener("error",i)})),[])},t.logOutsmartlyError=i;const r=n(3),o=n(6);function i(e,t){const{postLogger:n,rid:r,vid:o,startTimestamp:i,headTimestamp:a}=window.__APP_CONFIG__;if(n){const c=Math.floor(window.performance.now());n({table:"error",row:{rid:r,vid:o,timelineMark:i+c,elapsedTime:c,headTimestamp:a,source:t??location.pathname,message:"message"in e?e.message:JSON.stringify(e.reason),error:"stack"in e?e.stack:JSON.stringify(e)}})}}function a(e,t){const{postLogger:n,startTimestamp:r,rid:o,vid:i}=window.__APP_CONFIG__;if(!n)return;const a=Math.floor(window.performance.now());n({table:"outcome",row:{rid:o,vid:i,outcome:e,timelineMark:r+a,elapsedTime:a,pathname:window.location.pathname,metadata:t}})}function c(e,t){return[{key:"eventId",value:t},{key:"handle",value:e.handle},{key:"title",value:e.title},{key:"productId",value:e.id},{key:"productType",value:e.productType??"NA"},{key:"imageUrl",value:e.image??"NA"},{key:"vendor",value:e.vendor??"NA"},{key:"price",value:e.price},{key:"compareAtPrice",value:e.compareAtPrice??e.price}].filter((e=>void 0!==e.value))}function l(e){return e.selectedOptions?e.selectedOptions.map((({name:e="NA",value:t="NA"})=>({key:e,value:t}))):e.optionMap?[{key:"Color",value:e.optionMap.Color},{key:"Size",value:e.optionMap.Size}]:[]}t.logOutsmartlyPageView=e=>{const{postLogger:t,rid:n,vid:r,startTimestamp:o}=window.__APP_CONFIG__;if(!t)return;const i=Math.floor(window.performance.now());t({table:"outcome",row:{outcome:"PageView",rid:n,vid:r,timelineMark:o+i,elapsedTime:i,pathname:location.pathname,entryDepth:window.scrollY,scrollTopOnEntry:window.scrollY,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,documentHeight:0,metadata:[{key:"eventId",value:e}]}})},t.logOutsmartlyViewedProduct=(e,t)=>{const[n]=(0,o.buildProductAndVariant)(e);"undefined"!=typeof window&&a("ViewProduct",c(n,t))},t.logOutsmartlySelectedVariant=(e,t)=>{const[n,r]=(0,o.buildProductAndVariant)(e);"undefined"!=typeof window&&a("ViewProductVariant",[...c(n,t),{key:"variantId",value:r.id??""},{key:"eventId",value:t},...l(r)])}},50:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.logPinterestCollectionView=t.logAddToCartPinterest=t.logPinterestPageView=t.loadPinterest=void 0;const o=r(n(140)),i=n(6);t.loadPinterest=()=>{const{PINTEREST_ID:e}=window.__APP_CONFIG__.ANALYTICS;if(e)try{(0,o.default)(e),(new Image).src=`https://ct.pinterest.com/v3/?tid=${e}&noscript=1`}catch(e){console.error(e)}},t.logPinterestPageView=async(e,t)=>{const{PINTEREST_ID:n}=window.__APP_CONFIG__.ANALYTICS;if(!n)return;const r=await t;if(r)(new Image).src=["https://ct.pinterest.com/v3/?event=PageVisit",`&tid=${n}`,r.loggedIn&&r.hashedEmail?`&pd[em]=${r.hashedEmail}`:""].join("");else try{window.pintrk("track","checkout"),(new Image).src=`https://ct.pinterest.com/v3/?tid=${n}&event=pageview&noscript=1`}catch(e){console.error(e)}},t.logAddToCartPinterest=e=>{const{PINTEREST_ID:t}=window.__APP_CONFIG__.ANALYTICS;if(!t)return;const[n,r]=(0,i.buildProductAndVariant)(e);(new Image).src=["https://ct.pinterest.com/v3/?event=AddToCart",`&tid=${t}`,`&ed[line_items][0][product_id]=${n.id??""}`,`&ed[line_items][0][product_variant_id]=${r.id??""}`,`&ed[line_items][0][product_price]=${r.price??""}`,"&ed[line_items][0][product_quantity]=1",`&ed[line_items][0][product_name]=${window.encodeURIComponent(`${n.title??""} - ${r.title??""}`)}`].join("")},t.logPinterestCollectionView=()=>{const{PINTEREST_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&((new Image).src=["https://ct.pinterest.com/v3/?event=ViewCategory",`&tid=${e}`].join(""))}},140:e=>{"use strict";e.exports=function(e){!function(){if(!window.pintrk){window.pintrk=function(){window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var e=window.pintrk;e.queue=[],e.version="3.0";var t=document.createElement("script");t.async=!0,t.src="https://s.pinimg.com/ct/core.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)}}(),window.pintrk("load",e),window.pintrk("page")}},137:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initShopify=function(){"undefined"!=typeof window&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",p],["collectionView",g],["pageView",f],["viewContent",y]))};const r=n(6),o=n(179),i=n(22);function a(){const e=document.querySelector('link[rel="canonical"]')?.getAttribute("href")??"";if(e)return e.indexOf("?")>0?e:e+window.location.search;const t=window.location.href,n=t.indexOf("#");return-1===n?t:t.slice(0,n)}const c=[{pattern:/^\/$/,type:o.AnalyticsPageType.home},{pattern:/^\/products/,type:o.AnalyticsPageType.product},{pattern:/^\/collections\/?$/,type:o.AnalyticsPageType.listCollections},{pattern:/^\/collections/,type:o.AnalyticsPageType.collection},{pattern:/-policy|terms-of-service/,type:o.AnalyticsPageType.policy},{pattern:/^\/account\/login/,type:o.AnalyticsPageType.customersLogin},{pattern:/^\/account\/register/,type:o.AnalyticsPageType.customersRegister},{pattern:/^\/account\/addresses/,type:o.AnalyticsPageType.customersAddresses},{pattern:/^\/account\/reset/,type:o.AnalyticsPageType.customersResetPassword},{pattern:/^\/account\/orders/,type:o.AnalyticsPageType.customersOrder},{pattern:/^\/account/,type:o.AnalyticsPageType.customersAccount},{pattern:/^\/cart/,type:o.AnalyticsPageType.cart},{pattern:/^\/search/,type:o.AnalyticsPageType.search},{pattern:/^\/password/,type:o.AnalyticsPageType.password},{pattern:/^\/content/,type:o.AnalyticsPageType.article}];function l(){const e=window.location.pathname,t=c.find((({pattern:t})=>t.test(e)));return t?.type||o.AnalyticsPageType.page}function s(){const e=(0,r.readCookie)("cart");return e?`gid://shopify/Cart/${e}`:""}function u(){const{SHOP_ID:e}=window.__APP_CONFIG__;return`gid://shopify/Shop/${e.toString()}`}async function d(e){const t=(0,o.getClientBrowserParameters)(),n=await async function(e){const t=await e||await(0,i.loadShopifyAccount)();return t?{account:t,customerId:t.id?`gid://shopify/Customer/${t.id}`:void 0,currency:t.currency||"USD"}:{account:void 0,customerId:void 0,currency:"USD"}}(e);return{...t,...n,canonicalUrl:a(),shopId:u(),cartId:s(),shopifySalesChannel:o.ShopifySalesChannel.headless,ccpaEnforced:(0,r.ccpa_dns)(),gdprEnforced:!1,hasUserConsent:!0,analyticsAllowed:!0,marketingAllowed:!0,saleOfDataAllowed:!0}}const p=async e=>{const t={...await d(),...m(e)};await(0,o.sendShopifyAnalytics)({eventName:o.AnalyticsEventName.ADD_TO_CART,payload:t})},y=async e=>{const t={...await d(),...m(e),pageType:l()};await(0,o.sendShopifyAnalytics)({eventName:o.AnalyticsEventName.PRODUCT_VIEW,payload:t})},f=async(e,t)=>{const n={...await d(t),pageType:l()};await(0,o.sendShopifyAnalytics)({eventName:o.AnalyticsEventName.PAGE_VIEW,payload:n})},g=async(e,t)=>{const n=await d(),r=function(e){return{products:e.map((({product:e,quantity:t,selected_variant:n})=>({productGid:`gid://shopify/Product/${e.id?.toString()??""}`,name:e.title||n?.title||"",price:n?.price?.toFixed(2)??"0.00",quantity:t,variantGid:n?.id?`gid://shopify/ProductVariant/${n.id.toString()}`:void 0,variantName:n?.title,brand:e.vendor||"",sku:n?.sku,category:""})))}}(t),i={...n,...r,collectionHandle:e.url,collectionId:e.id.toString(),pageType:l()};await(0,o.sendShopifyAnalytics)({eventName:o.AnalyticsEventName.COLLECTION_VIEW,payload:i})};function m(e){const[t,n]=(0,r.buildProductAndVariant)(e),o=[t.title,n.title].join(" - "),i=(0,r.getCurrentPrice)(t,n),a=(0,r.getCartValue)(i);return{products:[{productGid:`gid://shopify/Product/${t.id??""}`,name:o,price:i.toFixed(2),quantity:t.quantity,variantGid:n.id?`gid://shopify/ProductVariant/${n.id.toString()}`:void 0,variantName:n.title,brand:n.brand||"",sku:n.sku,category:""}],totalValue:a}}},141:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logAddToCartSnapchat=t.logSnapchatViewContent=t.logSnapchatPageView=t.loadSnapchat=void 0;const r=n(6);t.loadSnapchat=e=>{const{SNAPCHAT_ID:t,SNAPCHAT_DELAY:n=0}=window.__APP_CONFIG__.ANALYTICS;if(t){if(!window.snaptr){const e=(...t)=>{e.handleRequest?e.handleRequest.apply(e,t):e.queue.push(t)};e.queue=[],window.snaptr=e}(0,r.loadScriptWithDelay)({src:"//sc-static.net/scevent.min.js",id:"snapchat-script",timeout:1e3*n,anonymous:!1}),window.snaptr&&window.snaptr("init",t,{user_email:e.email})}},t.logSnapchatPageView=()=>{const{SNAPCHAT_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&window.snaptr&&window.snaptr("track","PAGE_VIEW")},t.logSnapchatViewContent=e=>{const{SNAPCHAT_ID:t}=window.__APP_CONFIG__.ANALYTICS;if(!t||!window.snaptr)return;const[n,o]=(0,r.buildProductAndVariant)(e);window.snaptr("track","VIEW_CONTENT",{currency:"USD",item_category:n.id,item_ids:o.id,description:`${n.title??""} - ${o.title??""}`,price:o.price})},t.logAddToCartSnapchat=e=>{const[t,n]=(0,r.buildProductAndVariant)(e),{SNAPCHAT_ID:o}=window.__APP_CONFIG__.ANALYTICS;o&&window.snaptr&&window.snaptr("track","ADD_CART",{currency:"USD",item_category:t.id,item_ids:n.id,description:`${t.title??""} - ${n.title??""}`,price:n.price})}},180:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initTikTok=function(){if("undefined"==typeof window)return;const{TIKTOK_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&(window._orlyTags||(window._orlyTags=[]),window._orlyTags.push(["addToCart",a],["viewContent",c],["loadScript",i]))};const r=n(6),o=n(181),i=()=>{const{TIKTOK_ID:e}=window.__APP_CONFIG__.ANALYTICS;e&&void 0===window.ttq&&(0,o.loadTikTokScript)(e)},a=(e,t)=>{const[n,o]=(0,r.buildProductAndVariant)(e);try{void 0!==window.ttq&&window.ttq.track("AddToCart",...l(n,o,t))}catch(e){console.log(e)}},c=(e,t)=>{const[n,o]=(0,r.buildProductAndVariant)(e);try{void 0!==window.ttq&&window.ttq.track("ViewContent",...l(n,o,t))}catch(e){console.log(e)}};function l(e,t,n){return[{content_id:e.id,content_type:"product",content_name:`${e.title??""} - ${t.title??""}`,quantity:1,price:t.price,curency:(0,r.readCookie)("cartCurrency")??"USD"},{event_id:n}]}},6:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cartItemToBentoAnalyticsItem=t.getItemCounts=t.getCartValue=t.getCurrentPrice=t.getOldCart=t.updateCart=t.safeParse=t.normalizeCart=t.buildProductAndVariant=void 0,t.loadScript=i,t.loadScriptWithDelay=function(e,t=()=>{}){const{src:n,id:r,useRequestIdleCallback:a=!1}=e;if(document.querySelector(`#${r}`))"function"==typeof window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,0);else if(a&&"function"==typeof window.requestIdleCallback)window.requestIdleCallback((()=>{i(e,t)}));else{const r=e.timeout||window.scriptDelayTime||1e4;o[n]=window.setTimeout(i,r,e,t)}},t.readCookie=a,t.entries=function(e){return Object.entries(e)},t.callOrlyTagHooks=async function(e,...t){const n=(window._orlyTags??[]).filter((([t])=>t===e)).map((async([,n])=>{try{return await n(...t)}catch(n){const r=new Error(`callOrlyTagHooks: error in type: ${e}\nparams: ${JSON.stringify(t,void 0,2)}\nerror: ${JSON.stringify(n,Object.getOwnPropertyNames(n),2)}`);return console.error(r),r}}));await Promise.allSettled(n)},t.getCartComponents=async function(e){try{const t=e.properties._olbid;if(!t)return[e];const n=await fetch("/pages/cart-json"),r=(await n.json()).items.find((e=>Object.fromEntries(e.properties)._olbid===t));return r?c(r.item_components):[e]}catch(t){return console.log(t),[e]}},t.isShopifyCartItem=l,t.isShopifyCartError=function(e){return"object"!=typeof e||null===e?(console.log("not even an object!"),!1):"string"==typeof e.message},t.isShopifyCart=s,t.waitForShopifyY=async function(){await(0,r.loadShopifyAccount)().catch((e=>{console.error("Could not load accout before getting _shopify_y",e)}));const e=a("_shopify_y");return e||console.error("_shopify_y should be defined"),e},t.uuid=function(){const e="xxxx-4xxx-xxxx-xxxxxxxxxxxx";let t="";try{const n=window.crypto||window.msCrypto,r=new Uint16Array(31);n.getRandomValues(r);let o=0;t=e.replace(/[x]/g,(function(e){for(let e=[],t=1;t>>0}catch(t){e=(new Date).getTime()>>>0}try{t=performance.now()>>>0}catch(e){t=0}const n=Math.abs(e+t).toString(16).toLowerCase();return"00000000".substring(0,8-n.length)+n}()+"-"+t},t.cancellableFetch=function(e,t={}){const n=new AbortController,{signal:r}=n;return{response:fetch(e,{...t,signal:r}),cancel:()=>{n.abort()}}},t.sha256=async function(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t);return[...new Uint8Array(n)].map((e=>e.toString(16).padStart(2,"0"))).join("")},t.imagePixel=function(e){const t=new Image;t.height=1,t.width=1,t.setAttribute("style","display:none;"),t.src=e,document.body.append(t)},t.ccpa_dns=function(){return/__ccpa_dns=true/.test(document.cookie)};const r=n(22),o={};function i(e,t=()=>{}){const{src:n,id:r,anonymous:i=!0,defer:a=!0,async:c=!1}=e;if(o[n]&&window.clearTimeout(o[n]),document.querySelector(`#${r}`))return;const l=document.createElement("script");l.src=n,l.defer=a,l.id=r,l.async=c,i&&(l.crossOrigin="anonymous"),l.addEventListener("load","function"==typeof window.requestIdleCallback?()=>window.requestIdleCallback(t):t),document.body.append(l)}function a(e){const t=decodeURIComponent(document.cookie).match(/[^\s,;=]+=[^\s,;=]+/g);if(t)for(const n of t){const[t,r]=n.split("=");if(t===e)return r}}t.buildProductAndVariant=e=>[{id:e.product_id?.toString(),handle:e.handle,title:e.product_title,tags:[],price:e.price?.toString(),compareAtPrice:e.original_price?.toString(),vendor:e.vendor,productType:e.product_type,image:e.image,quantity:e.quantity},{id:e.variant_id?.toString(),sku:e.sku,brand:e.vendor,title:e.variant_title,price:e.price?.toString(),selectedOptions:e.options_with_values}];const c=e=>e.map((e=>({...e,price:.01*e.price,original_price:.01*e.original_price,final_line_price:.01*e.final_line_price,final_price:.01*e.final_price,original_line_price:.01*e.original_line_price,line_price:.01*e.line_price,variant_title:e.variant_title||e.variant_options.join(" / ")||"Default Title"})));function l(e){const t=e;return"string"==typeof t.key&&"number"==typeof t.quantity}function s(e){if("object"!=typeof e||null===e)return console.log("not even an object!"),!1;const{items:t}=e;return Array.isArray(t)&&t.every((e=>l(e)))}t.normalizeCart=e=>({...e,items:c(e.items),total_price:.01*e.total_price,total_discount:.01*e.total_discount,original_total_price:.01*e.original_total_price,items_subtotal_price:.01*e.items_subtotal_price}),t.safeParse=e=>{try{return JSON.parse(e)}catch(t){console.error("Could not parse as JSON:",e,"\nerror:",t)}};const u="outsmartly-shopify-cart";t.updateCart=e=>{window.localStorage.setItem(u,JSON.stringify(e))},t.getOldCart=()=>{const e=window.localStorage.getItem(u)||"";if(!e||0===e.length)return;const n=(0,t.safeParse)(e);return s(n)?n:void 0},t.getCurrentPrice=(e,t)=>{const n=t?.price||e?.price;return Number.parseFloat(n||"0")},t.getCartValue=e=>{const n=(0,t.getOldCart)();return n?.total_price||e||0},t.getItemCounts=e=>{const t=new Map;for(const n of e){const e=t.get(n.id);e?e.quantity+=n.quantity:t.set(n.id,{...n})}return t},t.cartItemToBentoAnalyticsItem=e=>{const t={src:e.featured_image?.url,alt:e.featured_image?.alt,width:e.featured_image?.width,aspect_ratio:e.featured_image?.aspect_ratio};return{product:{id:e.product_id,compare_at_price:e.original_price,price:e.price,selectedOptions:[],title:e.product_title,url:e.url,vendor:e.vendor,type:e.product_type,image:t},selected_variant:{id:e.variant_id,compare_at_price:e.original_price,price:e.price,sku:e.sku,url:e.url,inventory_quantity:1,title:e.variant_title,image:t},quantity:e.quantity}}},54:(e,t,n)=>{var r=n(142);function o(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function i(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}e.exports=r(o),e.exports.strict=r(i),o.proto=o((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return o(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return i(this)},configurable:!0})}))},142:e=>{e.exports=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){r[e]=t[e]})),r;function r(){for(var e=new Array(arguments.length),n=0;n{"use strict";n.r(t),n.d(t,{AddToCartButton:()=>Ee,AnalyticsEventName:()=>Oe,AnalyticsPageType:()=>ke,BuyNowButton:()=>et,CartCheckoutButton:()=>tt,CartCost:()=>at,CartLineProvider:()=>st,CartLineQuantity:()=>ut,CartLineQuantityAdjustButton:()=>dt,CartProvider:()=>he,ExternalVideo:()=>ft,IMAGE_FRAGMENT:()=>Ot,Image:()=>kt,MediaFile:()=>Ht,ModelViewer:()=>Yt,Money:()=>it,ProductPrice:()=>zt,ProductProvider:()=>Ae,RichText:()=>Jt,SHOPIFY_S:()=>ie,SHOPIFY_STOREFRONT_ID_HEADER:()=>te,SHOPIFY_STOREFRONT_S_HEADER:()=>re,SHOPIFY_STOREFRONT_Y_HEADER:()=>ne,SHOPIFY_Y:()=>oe,ShopPayButton:()=>tn,ShopifyProvider:()=>Q,ShopifySalesChannel:()=>xe,Video:()=>Bt,createStorefrontClient:()=>Y,customerAccountApiCustomScalars:()=>yt,decodeEncodedVariant:()=>vt,flattenConnection:()=>D,getAdjacentAndFirstAvailableVariants:()=>Tt,getClientBrowserParameters:()=>Xe,getProductOptions:()=>Et,getShopifyCookies:()=>se,isOptionValueCombinationInEncodedVariant:()=>mt,mapSelectedProductOptionToObject:()=>wt,parseGid:()=>Le,parseMetafield:()=>Wt,sendShopifyAnalytics:()=>Je,storefrontApiCustomScalars:()=>pt,useCart:()=>ve,useCartLine:()=>lt,useLoadScript:()=>Gt,useMoney:()=>nt,useProduct:()=>Se,useSelectedOptionInUrlParam:()=>ln,useShop:()=>X,useShopifyCookies:()=>dn});var r,o,i=n(18),a=n(0);function c(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}(o=r||(r={}))[o.NotStarted=0]="NotStarted",o[o.Running=1]="Running",o[o.Stopped=2]="Stopped";var l={type:"xstate.init"};function s(e){return void 0===e?[]:[].concat(e)}function u(e){return{type:"xstate.assign",assignment:e}}function d(e,t){return"string"==typeof(e="string"==typeof e&&t&&t[e]?t[e]:e)?{type:e}:"function"==typeof e?{type:e.name,exec:e}:e}function p(e){return function(t){return e===t}}function y(e){return"string"==typeof e?{type:e}:e}function f(e,t){return{value:e,context:t,actions:[],changed:!1,matches:p(e)}}function g(e,t,n){var r=t,o=!1;return[e.filter((function(e){if("xstate.assign"===e.type){o=!0;var t=Object.assign({},r);return"function"==typeof e.assignment?t=e.assignment(r,n):Object.keys(e.assignment).forEach((function(o){t[o]="function"==typeof e.assignment[o]?e.assignment[o](r,n):e.assignment[o]})),r=t,!1}return!0})),r,o]}function m(e,t){void 0===t&&(t={});var n=c(g(s(e.states[e.initial].entry).map((function(e){return d(e,t.actions)})),e.context,l),2),r=n[0],o=n[1],i={config:e,_options:t,initialState:{value:e.initial,actions:r,context:o,matches:p(e.initial)},transition:function(t,n){var r,o,a="string"==typeof t?{value:t,context:e.context}:t,l=a.value,u=a.context,m=y(n),v=e.states[l];if(v.on){var h=s(v.on[m.type]);try{for(var w=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(h),_=w.next();!_.done;_=w.next()){var C=_.value;if(void 0===C)return f(l,u);var A="string"==typeof C?{target:C}:C,S=A.target,b=A.actions,I=void 0===b?[]:b,P=A.cond,T=void 0===P?function(){return!0}:P,E=void 0===S,O=null!=S?S:l,k=e.states[O];if(T(u,m)){var x=c(g((E?s(I):[].concat(v.exit,I,k.entry).filter((function(e){return e}))).map((function(e){return d(e,i._options.actions)})),u,m),3),D=x[0],N=x[1],L=x[2],V=null!=S?S:l;return{value:V,context:N,actions:D,changed:S!==l||D.length>0||L,matches:p(V)}}}}catch(e){r={error:e}}finally{try{_&&!_.done&&(o=w.return)&&o.call(w)}finally{if(r)throw r.error}}}return f(l,u)}};return i}var v,h,w,_,C=function(e,t){return e.actions.forEach((function(n){var r=n.exec;return r&&r(e.context,t)}))},A=i.useLayoutEffect,S={exports:{}},b={},I={exports:{}},P={};var T=(_||(_=1,S.exports=function(){if(w)return b;w=1;var e=i.default,t=(h||(h=1,I.exports=function(){if(v)return P;v=1;var e=i.default,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function c(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var i=t(),l=n({inst:{value:i,getSnapshot:t}}),s=l[0].inst,u=l[1];return o((function(){s.value=i,s.getSnapshot=t,c(s)&&u({inst:s})}),[e,i,t]),r((function(){return c(s)&&u({inst:s}),e((function(){c(s)&&u({inst:s})}))}),[e]),a(i),i};return P.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,P}()),I.exports),n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,c=e.useMemo,l=e.useDebugValue;return b.useSyncExternalStoreWithSelector=function(e,t,i,s,u){var d=o(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c((function(){function e(e){if(!a){if(a=!0,r=e,e=s(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return o=t}return o=e}if(t=o,n(r,e))return t;var i=s(e);return void 0!==u&&u(t,i)?t:(r=e,o=i)}var r,o,a=!1,c=void 0===i?null:i;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,i,s,u]);var y=r(e,d[0],d[1]);return a((function(){p.hasValue=!0,p.value=y}),[y]),l(y),y},b}()),S.exports),E=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};function O(e){return e}var k=function(e){var t;return e.subscribe((function(e){t=e})).unsubscribe(),t};var x=function(e,t){return!1===t.changed};function D(e){if(!e){const t=`flattenConnection(): needs a 'connection' to flatten, but received '${e??""}' instead.`;return console.error(t+" Returning an empty array"),[]}return"nodes"in e?e.nodes:"edges"in e&&Array.isArray(e.edges)?e.edges.map((e=>{if(!(null==e?void 0:e.node))throw new Error("flattenConnection(): Connection edges must contain nodes");return e.node})):[]}const N=e=>`\n mutation CartLineAdd(\n $cartId: ID!\n $lines: [CartLineInput!]!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,L=e=>`\n mutation CartCreate(\n $input: CartInput!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartCreate(input: $input) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,V=e=>`\n mutation CartLineRemove(\n $cartId: ID!\n $lines: [ID!]!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartLinesRemove(cartId: $cartId, lineIds: $lines) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,R=e=>`\n mutation CartLineUpdate(\n $cartId: ID!\n $lines: [CartLineUpdateInput!]!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,U=e=>`\n mutation CartNoteUpdate(\n $cartId: ID!\n $note: String!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,$=e=>`\n mutation CartBuyerIdentityUpdate(\n $cartId: ID!\n $buyerIdentity: CartBuyerIdentityInput!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,F=e=>`\n mutation CartAttributesUpdate(\n $attributes: [AttributeInput!]!\n $cartId: ID!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartAttributesUpdate(attributes: $attributes, cartId: $cartId) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,j=e=>`\n mutation CartDiscountCodesUpdate(\n $cartId: ID!\n $discountCodes: [String!]\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart {\n ...CartFragment\n }\n }\n }\n\n ${e}\n`,q=e=>`\n query CartQuery(\n $id: ID!\n $numCartLines: Int = 250\n $country: CountryCode = ZZ\n $language: LanguageCode\n ) @inContext(country: $country, language: $language) {\n cart(id: $id) {\n ...CartFragment\n }\n }\n\n ${e}\n`,M="\n fragment CartFragment on Cart {\n id\n checkoutUrl\n totalQuantity\n buyerIdentity {\n countryCode\n customer {\n id\n email\n firstName\n lastName\n displayName\n }\n email\n phone\n }\n lines(first: $numCartLines) {\n edges {\n node {\n id\n quantity\n attributes {\n key\n value\n }\n cost {\n totalAmount {\n amount\n currencyCode\n }\n compareAtAmountPerQuantity {\n amount\n currencyCode\n }\n }\n merchandise {\n ... on ProductVariant {\n id\n availableForSale\n compareAtPrice {\n ...MoneyFragment\n }\n price {\n ...MoneyFragment\n }\n requiresShipping\n title\n image {\n ...ImageFragment\n }\n product {\n handle\n title\n id\n }\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n cost {\n subtotalAmount {\n ...MoneyFragment\n }\n totalAmount {\n ...MoneyFragment\n }\n totalDutyAmount {\n ...MoneyFragment\n }\n totalTaxAmount {\n ...MoneyFragment\n }\n }\n note\n attributes {\n key\n value\n }\n discountCodes {\n code\n applicable\n }\n }\n\n fragment MoneyFragment on MoneyV2 {\n currencyCode\n amount\n }\n fragment ImageFragment on Image {\n id\n url\n altText\n width\n height\n }\n",G="2025-01",B=e=>e.includes("mock.shop");function Y({storeDomain:e,privateStorefrontToken:t,publicStorefrontToken:n,storefrontApiVersion:r=G,contentType:o}){if(!e)throw new Error(K+"`storeDomain` is required when creating a new Storefront client in production.");r!==G&&z(`The Storefront API version that you're using is different than the version this build of Hydrogen React is targeting.\nYou may run into unexpected errors if these versions don't match. Received version: "${r}"; expected version "${G}"`);const i=t=>{const n=(null==t?void 0:t.storeDomain)??e;return n.includes("://")?n:`https://${n}`};return{getShopifyDomain:i,getStorefrontApiUrl(e){const t=i(e),n=t+(t.endsWith("/")?"api":"/api");return B(t)?n:`${n}/${(null==e?void 0:e.storefrontApiVersion)??r}/graphql.json`},getPrivateTokenHeaders(n){if(!t&&!(null==n?void 0:n.privateStorefrontToken)&&!B(e))throw new Error(K+"You did not pass in a `privateStorefrontToken` while using `createStorefrontClient()` or `getPrivateTokenHeaders()`");return{"content-type":"graphql"===((null==n?void 0:n.contentType)??o)?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":r,"Shopify-Storefront-Private-Token":(null==n?void 0:n.privateStorefrontToken)??t??"",...(null==n?void 0:n.buyerIp)?{"Shopify-Storefront-Buyer-IP":n.buyerIp}:{}}},getPublicTokenHeaders(t){if(!n&&!(null==t?void 0:t.publicStorefrontToken)&&!B(e))throw new Error(K+"You did not pass in a `publicStorefrontToken` while using `createStorefrontClient()` or `getPublicTokenHeaders()`");return H((null==t?void 0:t.contentType)??o??"json",r,(null==t?void 0:t.publicStorefrontToken)??n??"")}}}function H(e,t,n){return{"content-type":"graphql"===e?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":t,"X-Shopify-Storefront-Access-Token":n}}const W=new Set,K="[h2:error:createStorefrontClient] ",z=(e,t="warn")=>{W.has(e)||(console[t](`[h2:${t}:createStorefrontClient] `+e),W.add(e))},Z={storeDomain:"test",storefrontToken:"abc123",storefrontApiVersion:G,countryIsoCode:"US",languageIsoCode:"EN",getStorefrontApiUrl:()=>"",getPublicTokenHeaders:()=>({}),getShopifyDomain:()=>""},J=(0,i.createContext)(Z);function Q({children:e,...t}){if(!(t.countryIsoCode&&t.languageIsoCode&&t.storeDomain&&t.storefrontToken&&t.storefrontApiVersion))throw new Error("Please provide the necessary props to ''");t.storefrontApiVersion!==G&&console.warn(`: This version of Hydrogen React is built for Shopify's Storefront API version ${G}, but it looks like you're using version ${t.storefrontApiVersion}. There may be issues or bugs if you use a mismatched version of Hydrogen React and the Storefront API.`);const n=(0,i.useMemo)((()=>{function e(e){const n=(null==e?void 0:e.storeDomain)??t.storeDomain;return n.includes("://")?n:`https://${n}`}return{...t,getPublicTokenHeaders:e=>H(e.contentType,t.storefrontApiVersion,e.storefrontToken??t.storefrontToken),getShopifyDomain:e,getStorefrontApiUrl(n){const r=e({storeDomain:(null==n?void 0:n.storeDomain)??t.storeDomain});return`${r}${r.endsWith("/")?"":"/"}api/${(null==n?void 0:n.storefrontApiVersion)??t.storefrontApiVersion}/graphql.json`}}}),[t]);return(0,a.jsx)(J.Provider,{value:n,children:e})}function X(){const e=(0,i.useContext)(J);if(!e)throw new Error("'useShop()' must be a descendent of ");return e}const ee="shopifyCartId",te="Shopify-Storefront-Id",ne="Shopify-Storefront-Y",re="Shopify-Storefront-S",oe="_shopify_y",ie="_shopify_s";var ae=new Set(["domain","path","max-age","expires","samesite","secure","httponly"]);const ce="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function le(){let e="";try{const t=window.crypto,n=new Uint16Array(31);t.getRandomValues(n);let r=0;e=ce.replace(/[x]/g,(e=>{const t=n[r]%16;return r++,("x"===e?t:3&t|8).toString(16)})).toUpperCase()}catch(t){e=ce.replace(/[x]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})).toUpperCase()}return`${function(){let e=0,t=0;e=(new Date).getTime()>>>0;try{t=performance.now()>>>0}catch(e){t=0}return Math.abs(e+t).toString(16).toLowerCase().padStart(8,"0")}()}-${e}`}function se(e){const t=function(e){let t,n,r,o,i={},a=0,c=e.split(/;\s*/g);for(;anull==e?void 0:e.cart}),"onCartActionEntry","onCartActionOptimisticUI",e],on:{RESOLVE:{target:(null==t?void 0:t.resolveTarget)||"idle",actions:[u({prevCart:e=>null==e?void 0:e.lastValidCart,cart:(e,t)=>{var n;return null==(n=null==t?void 0:t.payload)?void 0:n.cart},rawCartResult:(e,t)=>{var n;return null==(n=null==t?void 0:t.payload)?void 0:n.rawCartResult},errors:e=>{}})]},ERROR:{target:(null==t?void 0:t.errorTarget)||"error",actions:[u({prevCart:e=>null==e?void 0:e.lastValidCart,cart:e=>null==e?void 0:e.lastValidCart,errors:(e,t)=>{var n;return null==(n=null==t?void 0:t.payload)?void 0:n.errors}})]},CART_COMPLETED:{target:"cartCompleted",actions:u({prevCart:e=>{},cart:e=>{},lastValidCart:e=>{},rawCartResult:e=>{},errors:e=>{}})}},exit:["onCartActionComplete",...(null==t?void 0:t.exitActions)||[]]}}const de={CART_FETCH:{target:"cartFetching"},CART_CREATE:{target:"cartCreating"},CART_SET:{target:"idle",actions:[u({rawCartResult:(e,t)=>t.payload.cart,cart:(e,t)=>fe(t.payload.cart)})]}},pe={CARTLINE_ADD:{target:"cartLineAdding"},CARTLINE_UPDATE:{target:"cartLineUpdating"},CARTLINE_REMOVE:{target:"cartLineRemoving"},NOTE_UPDATE:{target:"noteUpdating"},BUYER_IDENTITY_UPDATE:{target:"buyerIdentityUpdating"},CART_ATTRIBUTES_UPDATE:{target:"cartAttributesUpdating"},DISCOUNT_CODES_UPDATE:{target:"discountCodesUpdating"}};function ye({numCartLines:e,onCartActionEntry:t,onCartActionOptimisticUI:n,onCartActionComplete:o,data:a,cartFragment:c,countryCode:s,languageCode:d}){const{cartFetch:f,cartCreate:g,cartLineAdd:v,cartLineUpdate:h,cartLineRemove:w,noteUpdate:_,buyerIdentityUpdate:S,cartAttributesUpdate:b,discountCodesUpdate:I}=function({numCartLines:e,cartFragment:t,countryCode:n="US",languageCode:r="EN"}){const o=function(){const{storefrontId:e,getPublicTokenHeaders:t,getStorefrontApiUrl:n}=X();return(0,i.useCallback)((({query:r,variables:o})=>{const i=t({contentType:"json"});e&&(i[te]=e);const a=se(document.cookie);return i[ne]=a[oe],i[re]=a[ie],fetch(n(),{method:"POST",headers:i,body:JSON.stringify({query:r.toString(),variables:o})}).then((e=>e.json())).catch((e=>({data:void 0,errors:null==e?void 0:e.toString()})))}),[t,e,n])}(),a=(0,i.useCallback)((i=>o({query:q(t),variables:{id:i,numCartLines:e,country:n,language:r}})),[o,t,e,n,r]),c=(0,i.useCallback)((i=>o({query:L(t),variables:{input:i,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),l=(0,i.useCallback)(((i,a)=>o({query:N(t),variables:{cartId:i,lines:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),s=(0,i.useCallback)(((i,a)=>o({query:R(t),variables:{cartId:i,lines:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),u=(0,i.useCallback)(((i,a)=>o({query:V(t),variables:{cartId:i,lines:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),d=(0,i.useCallback)(((i,a)=>o({query:U(t),variables:{cartId:i,note:a,numCartLines:e,country:n,language:r}})),[o,t,e,n,r]),p=(0,i.useCallback)(((i,a)=>o({query:$(t),variables:{cartId:i,buyerIdentity:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),y=(0,i.useCallback)(((i,a)=>o({query:F(t),variables:{cartId:i,attributes:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]),f=(0,i.useCallback)(((i,a)=>o({query:j(t),variables:{cartId:i,discountCodes:a,numCartLines:e,country:n,language:r}})),[t,n,o,e,r]);return(0,i.useMemo)((()=>({cartFetch:a,cartCreate:c,cartLineAdd:l,cartLineUpdate:s,cartLineRemove:u,noteUpdate:d,buyerIdentityUpdate:p,cartAttributesUpdate:y,discountCodesUpdate:f,cartFragment:t})),[a,c,l,s,u,d,p,y,f,t])}({numCartLines:e,cartFragment:c,countryCode:s,languageCode:d}),P=(0,i.useMemo)((()=>{return m({id:"Cart",initial:(e=a)?"idle":"uninitialized",context:{cart:e&&fe(e)},states:{uninitialized:{on:de},cartCompleted:{on:de},initializationError:{on:de},idle:{on:{...de,...pe}},error:{on:{...de,...pe}},cartFetching:ue("cartFetchAction",{errorTarget:"initializationError"}),cartCreating:ue("cartCreateAction",{errorTarget:"initializationError"}),cartLineRemoving:ue("cartLineRemoveAction"),cartLineUpdating:ue("cartLineUpdateAction"),cartLineAdding:ue("cartLineAddAction"),noteUpdating:ue("noteUpdateAction"),buyerIdentityUpdating:ue("buyerIdentityUpdateAction"),cartAttributesUpdating:ue("cartAttributesUpdateAction"),discountCodesUpdating:ue("discountCodesUpdateAction")}});var e}),[a]),[D,M,G]=function(e,t){var n,o,a=(0,i.useRef)(),c=E((n=function(){var n=[],o=function(e){var t=e.initialState,n=r.NotStarted,o=new Set,i={_machine:e,send:function(i){n===r.Running&&(t=e.transition(t,i),C(t,y(i)),o.forEach((function(e){return e(t)})))},subscribe:function(e){return o.add(e),e(t),{unsubscribe:function(){return o.delete(e)}}},start:function(o){if(o){var a="object"==typeof o?o:{context:e.config.context,value:o};t={value:a.value,actions:[],context:a.context,matches:p(a.value)}}else t=e.initialState;return n=r.Running,C(t,l),i},stop:function(){return n=r.Stopped,o.clear(),i},get state(){return t},get status(){return n}};return i}(m(e.config,t||e._options)),i=o.send;return o.send=function(e){o.status!==r.NotStarted?(i(e),a.current=o.state):n.push(e)},[o,n]},(o=i.useRef()).current||(o.current={v:n()}),o.current.v),2),s=c[0],u=c[1];A((function(){t&&(s._machine._options=t)}));var d=function(e){var t=(0,i.useCallback)((function(){return k(e)}),[e]),n=(0,i.useCallback)((function(t){return e.subscribe(t).unsubscribe}),[e]);return[T.useSyncExternalStoreWithSelector(n,t,t,O,x),e.send,e]}(s);return(0,i.useEffect)((function(){return s.start(a.current),u.forEach(s.send),a.current=s.state,function(){s.stop()}}),[]),d}(P,{actions:{cartFetchAction:async(e,t)=>{var n;if("CART_FETCH"!==t.type)return;const{data:r,errors:o}=await f(null==(n=null==t?void 0:t.payload)?void 0:n.cartId),i=ge(t,null==r?void 0:r.cart,o);M(i)},cartCreateAction:async(e,t)=>{var n;if("CART_CREATE"!==t.type)return;const{data:r,errors:o}=await g(null==t?void 0:t.payload),i=ge(t,null==(n=null==r?void 0:r.cartCreate)?void 0:n.cart,o);M(i)},cartLineAddAction:async(e,t)=>{var n,r;if("CARTLINE_ADD"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await v(e.cart.id,t.payload.lines),a=ge(t,null==(r=null==o?void 0:o.cartLinesAdd)?void 0:r.cart,i);M(a)},cartLineUpdateAction:async(e,t)=>{var n,r;if("CARTLINE_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await h(e.cart.id,t.payload.lines),a=ge(t,null==(r=null==o?void 0:o.cartLinesUpdate)?void 0:r.cart,i);M(a)},cartLineRemoveAction:async(e,t)=>{var n,r;if("CARTLINE_REMOVE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await w(e.cart.id,t.payload.lines),a=ge(t,null==(r=null==o?void 0:o.cartLinesRemove)?void 0:r.cart,i);M(a)},noteUpdateAction:async(e,t)=>{var n,r;if("NOTE_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await _(e.cart.id,t.payload.note),a=ge(t,null==(r=null==o?void 0:o.cartNoteUpdate)?void 0:r.cart,i);M(a)},buyerIdentityUpdateAction:async(e,t)=>{var n,r;if("BUYER_IDENTITY_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await S(e.cart.id,t.payload.buyerIdentity),a=ge(t,null==(r=null==o?void 0:o.cartBuyerIdentityUpdate)?void 0:r.cart,i);M(a)},cartAttributesUpdateAction:async(e,t)=>{var n,r;if("CART_ATTRIBUTES_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await b(e.cart.id,t.payload.attributes),a=ge(t,null==(r=null==o?void 0:o.cartAttributesUpdate)?void 0:r.cart,i);M(a)},discountCodesUpdateAction:async(e,t)=>{var n,r;if("DISCOUNT_CODES_UPDATE"!==t.type||!(null==(n=null==e?void 0:e.cart)?void 0:n.id))return;const{data:o,errors:i}=await I(e.cart.id,t.payload.discountCodes),a=ge(t,null==(r=null==o?void 0:o.cartDiscountCodesUpdate)?void 0:r.cart,i);M(a)},...t&&{onCartActionEntry:(e,n)=>{(function(e){return"CART_CREATE"===e.type||"CARTLINE_ADD"===e.type||"CARTLINE_UPDATE"===e.type||"CARTLINE_REMOVE"===e.type||"NOTE_UPDATE"===e.type||"BUYER_IDENTITY_UPDATE"===e.type||"CART_ATTRIBUTES_UPDATE"===e.type||"DISCOUNT_CODES_UPDATE"===e.type})(n)&&t(e,n)}},...n&&{onCartActionOptimisticUI:u(((e,t)=>n(e,t)))},...o&&{onCartActionComplete:(e,t)=>{(function(e){return"RESOLVE"===e.type||"ERROR"===e.type||"CART_COMPLETED"===e.type})(t)&&o(e,t)}}}});return(0,i.useMemo)((()=>[D,M,G]),[D,M,G])}function fe(e){return{...e,lines:D(null==e?void 0:e.lines),note:e.note??void 0}}function ge(e,t,n){return n?{type:"ERROR",payload:{errors:n,cartActionEvent:e}}:t?{type:"RESOLVE",payload:{cart:fe(t),rawCartResult:t,cartActionEvent:e}}:{type:"CART_COMPLETED",payload:{cartActionEvent:e}}}const me=(0,i.createContext)(null);function ve(){const e=(0,i.useContext)(me);if(!e)throw new Error("Expected a Cart Context, but no Cart Context was found");return e}function he({children:e,numCartLines:t,onCreate:n,onLineAdd:r,onLineRemove:o,onLineUpdate:c,onNoteUpdate:l,onBuyerIdentityUpdate:s,onAttributesUpdate:u,onDiscountCodesUpdate:d,onCreateComplete:p,onLineAddComplete:y,onLineRemoveComplete:f,onLineUpdateComplete:g,onNoteUpdateComplete:m,onBuyerIdentityUpdateComplete:v,onAttributesUpdateComplete:h,onDiscountCodesUpdateComplete:w,data:_,cartFragment:C=M,customerAccessToken:A,countryCode:S,languageCode:b}){var I,P,T,E,O,k,x;const D=X();if(!D)throw new Error(" needs to be a descendant of ");S=(S??D.countryIsoCode??"US").toUpperCase(),b=(b??D.languageIsoCode??"EN").toUpperCase(),S&&(S=S.toUpperCase());const[N,L]=(0,i.useState)(S),[V,R]=(0,i.useState)(A),U=(0,i.useRef)(!1);N===S&&V===A||(L(S),R(A),U.current=!1);const[$,F]=ye({numCartLines:t,data:_,cartFragment:C,countryCode:S,languageCode:b,onCartActionEntry(e,t){try{switch(t.type){case"CART_CREATE":return null==n?void 0:n();case"CARTLINE_ADD":return null==r?void 0:r();case"CARTLINE_REMOVE":return null==o?void 0:o();case"CARTLINE_UPDATE":return null==c?void 0:c();case"NOTE_UPDATE":return null==l?void 0:l();case"BUYER_IDENTITY_UPDATE":return null==s?void 0:s();case"CART_ATTRIBUTES_UPDATE":return null==u?void 0:u();case"DISCOUNT_CODES_UPDATE":return null==d?void 0:d()}}catch(e){console.error("Cart entry action failed",e)}},onCartActionOptimisticUI(e,t){var n,r,o,i;if(!e.cart)return{...e};switch(t.type){case"CARTLINE_REMOVE":return{...e,cart:{...e.cart,lines:null==(r=null==(n=null==e?void 0:e.cart)?void 0:n.lines)?void 0:r.filter((e=>(null==e?void 0:e.id)&&!t.payload.lines.includes(null==e?void 0:e.id)))}};case"CARTLINE_UPDATE":return{...e,cart:{...e.cart,lines:null==(i=null==(o=null==e?void 0:e.cart)?void 0:o.lines)?void 0:i.map((e=>{const n=t.payload.lines.find((({id:t})=>t===(null==e?void 0:e.id)));return n&&n.quantity?{...e,quantity:n.quantity}:e}))}}}return{...e}},onCartActionComplete(e,t){const n=t.payload.cartActionEvent;try{if("RESOLVE"===t.type)switch(n.type){case"CART_CREATE":return null==p?void 0:p();case"CARTLINE_ADD":return null==y?void 0:y();case"CARTLINE_REMOVE":return null==f?void 0:f();case"CARTLINE_UPDATE":return null==g?void 0:g();case"NOTE_UPDATE":return null==m?void 0:m();case"BUYER_IDENTITY_UPDATE":return function(e,t){var n,r;return!(!t.payload.buyerIdentity.countryCode||(null==(r=null==(n=e.cart)?void 0:n.buyerIdentity)?void 0:r.countryCode)===t.payload.buyerIdentity.countryCode)}(e,n)&&(U.current=!0),null==v?void 0:v();case"CART_ATTRIBUTES_UPDATE":return null==h?void 0:h();case"DISCOUNT_CODES_UPDATE":return null==w?void 0:w()}}catch(e){console.error("onCartActionComplete failed",e)}}}),j=(0,i.useRef)(!1),[q,G]=(0,i.useState)(!1),B=$.matches("cartCompleted"),Y=("idle"===$.value||"error"===$.value||"cartCompleted"===$.value)&&S!==(null==(T=null==(P=null==(I=null==$?void 0:$.context)?void 0:I.cart)?void 0:P.buyerIdentity)?void 0:T.countryCode)&&!$.context.errors,H=(0,i.useRef)(!1);(0,i.useEffect)((()=>{if(!j.current&&!H.current){if(!_&&_e("localStorage")){H.current=!0;try{const e=window.localStorage.getItem(ee);e&&F({type:"CART_FETCH",payload:{cartId:e}})}catch(e){console.warn("error fetching cartId"),console.warn(e)}}j.current=!0,G(!0)}}),[_,j,F]),(0,i.useEffect)((()=>{Y&&!U.current&&F({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:{countryCode:S,customerAccessToken:A}}})}),[S,A,Y,U,F]);const W=(0,i.useCallback)((e=>{if(!j.current)return console.warn("Cart isn't ready yet");F(e)}),[F]);(0,i.useEffect)((()=>{var e,t,n;if((null==(t=null==(e=null==$?void 0:$.context)?void 0:e.cart)?void 0:t.id)&&_e("localStorage"))try{window.localStorage.setItem(ee,null==(n=$.context.cart)?void 0:n.id)}catch(e){console.warn("Failed to save cartId to localStorage",e)}}),[null==(O=null==(E=null==$?void 0:$.context)?void 0:E.cart)?void 0:O.id]),(0,i.useEffect)((()=>{if(B&&_e("localStorage"))try{window.localStorage.removeItem(ee)}catch(e){console.warn("Failed to delete cartId from localStorage",e)}}),[B]);const K=(0,i.useCallback)((e=>{var t,n;S&&!(null==(t=e.buyerIdentity)?void 0:t.countryCode)&&(null==e.buyerIdentity&&(e.buyerIdentity={}),e.buyerIdentity.countryCode=S),A&&!(null==(n=e.buyerIdentity)?void 0:n.customerAccessToken)&&(null==e.buyerIdentity&&(e.buyerIdentity={}),e.buyerIdentity.customerAccessToken=A),W({type:"CART_CREATE",payload:e})}),[S,A,W]),z=function(e){const[t,n]=(0,i.useTransition)(),[r,o]=(0,i.useState)(e),a=(0,i.useRef)(!1);t&&(a.current=!0);const c=(0,i.useRef)(!1);return!t&&a.current&&(c.current=!0),(0,i.useEffect)((()=>{n((()=>{c.current||o(e)}))}),[e]),c.current?e:r}($),Z=(0,i.useMemo)((()=>{var e,t,n,r;return{...(null==(e=null==z?void 0:z.context)?void 0:e.cart)??{lines:[],attributes:[]},status:we(z.value),error:null==(t=null==z?void 0:z.context)?void 0:t.errors,totalQuantity:(null==(r=null==(n=null==z?void 0:z.context)?void 0:n.cart)?void 0:r.totalQuantity)??0,cartCreate:K,cartReady:q,linesAdd(e){var t,n;(null==(n=null==(t=null==z?void 0:z.context)?void 0:t.cart)?void 0:n.id)?W({type:"CARTLINE_ADD",payload:{lines:e}}):K({lines:e})},linesRemove(e){W({type:"CARTLINE_REMOVE",payload:{lines:e}})},linesUpdate(e){W({type:"CARTLINE_UPDATE",payload:{lines:e}})},noteUpdate(e){W({type:"NOTE_UPDATE",payload:{note:e}})},buyerIdentityUpdate(e){W({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:e}})},cartAttributesUpdate(e){W({type:"CART_ATTRIBUTES_UPDATE",payload:{attributes:e}})},discountCodesUpdate(e){W({type:"DISCOUNT_CODES_UPDATE",payload:{discountCodes:e}})},cartFragment:C}}),[K,q,null==(k=null==z?void 0:z.context)?void 0:k.cart,null==(x=null==z?void 0:z.context)?void 0:x.errors,z.value,C,W]);return(0,a.jsx)(me.Provider,{value:Z,children:e})}function we(e){switch(e){case"uninitialized":case"initializationError":return"uninitialized";case"idle":case"cartCompleted":case"error":return"idle";case"cartFetching":return"fetching";case"cartCreating":return"creating";case"cartLineAdding":case"cartLineRemoving":case"cartLineUpdating":case"noteUpdating":case"buyerIdentityUpdating":case"cartAttributesUpdating":case"discountCodesUpdating":return"updating"}}function _e(e){let t;try{t=window[e];const n="__storage_test__";return t.setItem(n,n),t.removeItem(n),!0}catch(e){return!(!(e instanceof DOMException)||22!==e.code&&1014!==e.code&&"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||!t||0===t.length)}}const Ce=(0,i.createContext)(null);function Ae({children:e,data:t,initialVariantId:n}){const r=(0,i.useMemo)((()=>D(t.variants??{})),[t.variants]);if(!(o=r)||!Array.isArray(o))throw new Error(" requires 'product.variants.nodes' or 'product.variants.edges'");var o;const c=(0,i.useMemo)((()=>function(e){const t=e.reduce(((e,t)=>{var n;if(!t.selectedOptions)throw new Error("'getOptions' requires 'variant.selectedOptions'");return null==(n=null==t?void 0:t.selectedOptions)||n.forEach((t=>{e[(null==t?void 0:t.name)??""]=e[(null==t?void 0:t.name)??""]||new Set,e[(null==t?void 0:t.name)??""].add((null==t?void 0:t.value)??"")})),e}),{});return Object.keys(t).map((e=>({name:e,values:Array.from(t[e])})))}(r)),[r]),[l,s]=(0,i.useState)((()=>Ie(n,r))),[u,d]=(0,i.useState)((()=>Pe(l)));(0,i.useEffect)((()=>{const e=Ie(n,r);s(e),d(Pe(e))}),[n,r]);const p=(0,i.useCallback)(((e,t)=>{d((n=>{const o={...n,[e]:t};return s(be(r,o)),o}))}),[d,r]),y=(0,i.useCallback)(((e,t)=>{const n=be(r,{...u,[e]:t});return(null==n?void 0:n.availableForSale)??!0}),[u,r]),f=(0,i.useMemo)((()=>D(t.sellingPlanGroups??{}).map((e=>({...e,sellingPlans:D((null==e?void 0:e.sellingPlans)??{})})))),[t.sellingPlanGroups]),[g,m]=(0,i.useState)(void 0),v=(0,i.useMemo)((()=>{var e,t;if(l&&g){if(!(null==(e=l.sellingPlanAllocations)?void 0:e.nodes)&&!(null==(t=l.sellingPlanAllocations)?void 0:t.edges))throw new Error(": You must include 'sellingPlanAllocations.nodes' or 'sellingPlanAllocations.edges' in your variants in order to calculate selectedSellingPlanAllocation");return D(l.sellingPlanAllocations).find((e=>{var t;return(null==(t=null==e?void 0:e.sellingPlan)?void 0:t.id)===g.id}))}}),[l,g]),h=(0,i.useMemo)((()=>({product:t,variants:r,variantsConnection:t.variants,options:c,selectedVariant:l,setSelectedVariant:s,selectedOptions:u,setSelectedOption:p,setSelectedOptions:d,isOptionInStock:y,selectedSellingPlan:g,setSelectedSellingPlan:m,selectedSellingPlanAllocation:v,sellingPlanGroups:f,sellingPlanGroupsConnection:t.sellingPlanGroups})),[t,y,c,u,g,v,l,f,p,r]);return(0,a.jsx)(Ce.Provider,{value:h,children:e})}function Se(){const e=(0,i.useContext)(Ce);if(!e)throw new Error("'useProduct' must be a child of ");return e}function be(e,t){var n,r;if(e.length&&(null==(r=null==(n=null==e?void 0:e[0])?void 0:n.selectedOptions)?void 0:r.length)===Object.keys(t).length)return null==e?void 0:e.find((e=>Object.entries(t).every((([t,n])=>{var r;return null==(r=null==e?void 0:e.selectedOptions)?void 0:r.some((e=>(null==e?void 0:e.name)===t&&(null==e?void 0:e.value)===n))}))))}function Ie(e,t){if(e){const n=t.find((t=>(null==t?void 0:t.id)===e));return n||console.warn(" received a 'initialVariantId' prop, but could not actually find a variant with that ID"),n}return null===e?null:void 0===e?t.find((e=>null==e?void 0:e.availableForSale))||t[0]:void 0}function Pe(e){return(null==e?void 0:e.selectedOptions)?e.selectedOptions.reduce(((e,t)=>(e[(null==t?void 0:t.name)??""]=(null==t?void 0:t.value)??"",e)),{}):{}}function Te(e){const{as:t,onClick:n,defaultOnClick:r,children:o,buttonRef:c,...l}=e,s=(0,i.useCallback)((e=>{if(n){const t=n(e);if("boolean"==typeof t&&!1===t||(null==e?void 0:e.defaultPrevented))return}null==r||r(e)}),[r,n]),u=t||"button";return(0,a.jsx)(u,{ref:c,onClick:s,...l,children:o})}function Ee(e){const[t,n]=(0,i.useState)(!1),{variantId:r,quantity:o=1,attributes:c,sellingPlanId:l,onClick:s,children:u,accessibleAddingToCartLabel:d,...p}=e,{status:y,linesAdd:f}=ve(),{selectedVariant:g}=Se(),m=r??(null==g?void 0:g.id)??"",v=null===r||""===m||null===g||t||p.disabled;(0,i.useEffect)((()=>{t&&"idle"===y&&n(!1)}),[y,t]);const h=(0,i.useCallback)((()=>{n(!0),f([{quantity:o,merchandiseId:m||"",attributes:c,sellingPlanId:l}])}),[f,o,m,c,l]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Te,{...p,disabled:v,onClick:s,defaultOnClick:h,children:u}),d?(0,a.jsx)("p",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},role:"alert","aria-live":"assertive",children:t?d:null}):null]})}const Oe={PAGE_VIEW:"PAGE_VIEW",ADD_TO_CART:"ADD_TO_CART",PAGE_VIEW_2:"PAGE_VIEW_2",COLLECTION_VIEW:"COLLECTION_VIEW",PRODUCT_VIEW:"PRODUCT_VIEW",SEARCH_VIEW:"SEARCH_VIEW"},ke={article:"article",blog:"blog",captcha:"captcha",cart:"cart",collection:"collection",customersAccount:"customers/account",customersActivateAccount:"customers/activate_account",customersAddresses:"customers/addresses",customersLogin:"customers/login",customersOrder:"customers/order",customersRegister:"customers/register",customersResetPassword:"customers/reset_password",giftCard:"gift_card",home:"index",listCollections:"list-collections",forbidden:"403",notFound:"404",page:"page",password:"password",product:"product",policy:"policy",search:"search"},xe={hydrogen:"hydrogen",headless:"headless"},De={hydrogen:"6167201",headless:"12875497473"};function Ne(e,t){return{schema_id:e,payload:t,metadata:{event_created_at_ms:Date.now()}}}function Le(e){const t={id:"",resource:null,resourceId:null,search:"",searchParams:new URLSearchParams,hash:""};if("string"!=typeof e)return t;try{const{search:n,searchParams:r,pathname:o,hash:i}=new URL(e),a=o.split("/"),c=a[a.length-1],l=a[a.length-2];if(!c||!l)return t;return{id:`${c}${n}${i}`||"",resource:l??null,resourceId:c||null,search:n,searchParams:r,hash:i}}catch{return t}}function Ve(e,t){return"object"!=typeof e?{}:(Object.entries(e).forEach((([e,n])=>{n&&(t[e]=n)})),t)}const Re="trekkie_storefront_page_view/1.4",Ue="myshopify.dev";function $e(e){const t=e,{id:n,resource:r}=Le(t.resourceId),o=r?r.toLowerCase():void 0;return[Ne(Re,Ve({pageType:t.pageType,customerId:parseInt(Le(t.customerId).id||"0"),resourceType:o,resourceId:parseInt(n)},Fe(t)))]}function Fe(e){return{appClientId:e.shopifySalesChannel?De[e.shopifySalesChannel]:De.headless,isMerchantRequest:je(e.url),hydrogenSubchannelId:e.storefrontId||e.hydrogenSubchannelId||"0",isPersistentCookie:e.hasUserConsent,uniqToken:e.uniqueToken,visitToken:e.visitToken,microSessionId:le(),microSessionCount:1,url:e.url,path:e.path,search:e.search,referrer:e.referrer,title:e.title,shopId:parseInt(Le(e.shopId).id),currency:e.currency,contentLanguage:e.acceptedLanguage||"en"}}function je(e){if("string"!=typeof e)return!1;const t=new URL(e).hostname;return-1!==t.indexOf(Ue)||"localhost"===t}const qe="2025.1.3",Me="custom_storefront_customer_tracking/1.2",Ge="page_rendered",Be="collection_page_rendered",Ye="product_page_rendered",He="product_added_to_cart",We="search_submitted";function Ke(e){return{canonical_url:e.canonicalUrl||e.url,customer_id:parseInt(Le(e.customerId).id||"0")}}function ze(e){return{source:e.shopifySalesChannel||xe.headless,asset_version_id:e.assetVersionId||qe,hydrogenSubchannelId:e.storefrontId||e.hydrogenSubchannelId||"0",is_persistent_cookie:e.hasUserConsent,deprecated_visit_token:e.visitToken,unique_token:e.uniqueToken,event_time:Date.now(),event_id:le(),event_source_url:e.url,referrer:e.referrer,user_agent:e.userAgent,navigation_type:e.navigationType,navigation_api:e.navigationApi,shop_id:parseInt(Le(e.shopId).id),currency:e.currency,ccpa_enforced:e.ccpaEnforced||!1,gdpr_enforced:e.gdprEnforced||!1,gdpr_enforced_as_string:e.gdprEnforced?"true":"false",analytics_allowed:e.analyticsAllowed||!1,marketing_allowed:e.marketingAllowed||!1,sale_of_data_allowed:e.saleOfDataAllowed||!1}}function Ze(e){return e?e.map((e=>{const t=Ve({variant_gid:e.variantGid,category:e.category,sku:e.sku,product_id:parseInt(Le(e.productGid).id),variant_id:parseInt(Le(e.variantGid).id)},{product_gid:e.productGid,name:e.name,variant:e.variantName||"",brand:e.brand,price:parseFloat(e.price),quantity:Number(e.quantity||0)});return JSON.stringify(t)})):[]}function Je(e,t){const{eventName:n,payload:r}=e;if(!r.hasUserConsent)return Promise.resolve();let o=[];const i=r;return n===Oe.PAGE_VIEW?o=o.concat($e(i),function(e){const t=e,n=Ke(t),r=t.pageType,o=[];switch(o.push(Ne(Me,Ve({event_name:Ge,...n},ze(t)))),r){case ke.collection:o.push(Ne(Me,Ve({event_name:Be,...n,collection_name:t.collectionHandle,collection_id:parseInt(Le(t.collectionId).id)},ze(t))));break;case ke.product:o.push(Ne(Me,Ve({event_name:Ye,...n,products:Ze(t.products),total_value:t.totalValue},ze(t))));break;case ke.search:o.push(Ne(Me,Ve({event_name:We,...n,search_string:t.searchString},ze(t))))}return o}(i)):n===Oe.ADD_TO_CART?o=o.concat(function(e){const t=e,n=Le(t.cartId);return[Ne(Me,Ve({event_name:He,customerId:t.customerId,cart_token:(null==n?void 0:n.id)?`${n.id}`:null,total_value:t.totalValue,products:Ze(t.products),customer_id:parseInt(Le(t.customerId).id||"0")},ze(t)))]}(r)):n===Oe.PAGE_VIEW_2?o=o.concat($e(i),function(e){const t=e,n=Ke(t);return[Ne(Me,Ve({event_name:Ge,...n},ze(t)))]}(i)):n===Oe.COLLECTION_VIEW?o=o.concat(function(e){const t=e,n=Ke(t);return[Ne(Me,Ve({event_name:Be,...n,collection_name:t.collectionHandle,collection_id:parseInt(Le(t.collectionId).id)},ze(t)))]}(i)):n===Oe.PRODUCT_VIEW?o=o.concat(function(e){const t=e,n=Ke(t);return[Ne(Me,Ve({event_name:Ye,...n,products:Ze(t.products),total_value:t.totalValue},ze(t)))]}(i)):n===Oe.SEARCH_VIEW&&(o=o.concat(function(e){const t=e,n=Ke(t);return[Ne(Me,Ve({event_name:We,...n,search_string:t.searchString},ze(t)))]}(i))),o.length?function(e,t){if("undefined"!=typeof window&&window.navigator&&/Chrome-Lighthouse/.test(window.navigator.userAgent))return Promise.resolve();const n={events:e,metadata:{event_sent_at_ms:Date.now()}};try{return fetch(t?`https://${t}/.well-known/shopify/monorail/unstable/produce_batch`:"https://monorail-edge.shopifysvc.com/unstable/produce_batch",{method:"post",headers:{"content-type":"text/plain"},body:JSON.stringify(n)}).then((e=>{if(!e.ok)throw new Error("Response failed");return e.text()})).then((e=>{e&&JSON.parse(e).result.forEach((e=>{200!==e.status&&console.error(Qe,"\n\n",e.message)}))})).catch((e=>{console.error(Qe,e)}))}catch(e){return Promise.resolve()}}(o,t):Promise.resolve()}const Qe="sendShopifyAnalytics request is unsuccessful";function Xe(){if("undefined"==typeof document&&(console.error("getClientBrowserParameters should only be used within the useEffect callback or event handlers"),1))return{uniqueToken:"",visitToken:"",url:"",path:"",search:"",referrer:"",title:"",userAgent:"",navigationType:"",navigationApi:""};const[e,t]=function(){try{let e="PerformanceNavigationTiming",t=function(){try{const e=(null==performance?void 0:performance.getEntriesByType)&&(null==performance?void 0:performance.getEntriesByType("navigation"));if(e&&e[0]){const e=window.performance.getEntriesByType("navigation")[0].type;return e&&e.toString()}}catch(e){}}();return t||(t=function(){var e,t;try{if(PerformanceNavigation&&null!==(null==(e=null==performance?void 0:performance.navigation)?void 0:e.type)&&void 0!==(null==(t=null==performance?void 0:performance.navigation)?void 0:t.type)){const e=performance.navigation.type;switch(e){case PerformanceNavigation.TYPE_NAVIGATE:return"navigate";case PerformanceNavigation.TYPE_RELOAD:return"reload";case PerformanceNavigation.TYPE_BACK_FORWARD:return"back_forward";default:return`unknown: ${e}`}}}catch(e){}}(),e="performance.navigation"),t?[t,e]:["unknown","unknown"]}catch(e){}return["error","error"]}(),n=se(document.cookie);return{uniqueToken:n[oe],visitToken:n[ie],url:location.href,path:location.pathname,search:location.search,referrer:document.referrer,title:document.title,userAgent:navigator.userAgent,navigationType:e,navigationApi:t}}function et(e){const{cartCreate:t,checkoutUrl:n}=ve(),[r,o]=(0,i.useState)(!1),{quantity:c,variantId:l,sellingPlanId:s,onClick:u,attributes:d,children:p,...y}=e;(0,i.useEffect)((()=>{r&&n&&(window.location.href=n)}),[r,n]);const f=(0,i.useCallback)((()=>{o(!0),t({lines:[{quantity:c??1,merchandiseId:l,attributes:d,sellingPlanId:s}]})}),[t,c,l,d,s]);return(0,a.jsx)(Te,{disabled:r??y.disabled,...y,onClick:u,defaultOnClick:f,children:p})}function tt(e){const[t,n]=(0,i.useState)(!1),{status:r,checkoutUrl:o}=ve(),{children:c,...l}=e;return(0,i.useEffect)((()=>{t&&o&&"idle"===r&&(window.location.href=o)}),[t,r,o]),(0,a.jsx)(Te,{...l,disabled:t||l.disabled,onClick:()=>n(!0),children:c})}function nt(e){const{countryIsoCode:t,languageIsoCode:n}=X(),r=n.includes("_")?n.replace("_","-"):`${n}-${t}`;if(!r)throw new Error("useMoney(): Unable to get 'locale' from 'useShop()', which means that 'locale' was not passed to ''. 'locale' is required for 'useMoney()' to work");const o=parseFloat(e.amount),{defaultFormatter:a,nameFormatter:c,narrowSymbolFormatter:l,withoutTrailingZerosFormatter:s,withoutCurrencyFormatter:u,withoutTrailingZerosOrCurrencyFormatter:d}=(0,i.useMemo)((()=>{const t={style:"currency",currency:e.currencyCode};return{defaultFormatter:ot(r,t),nameFormatter:ot(r,{...t,currencyDisplay:"name"}),narrowSymbolFormatter:ot(r,{...t,currencyDisplay:"narrowSymbol"}),withoutTrailingZerosFormatter:ot(r,{...t,minimumFractionDigits:0,maximumFractionDigits:0}),withoutCurrencyFormatter:ot(r),withoutTrailingZerosOrCurrencyFormatter:ot(r,{minimumFractionDigits:0,maximumFractionDigits:0})}}),[e.currencyCode,r]),p=e=>"currency"===e.type,y=(0,i.useMemo)((()=>({original:()=>e,currencyCode:()=>e.currencyCode,localizedString:()=>a().format(o),parts:()=>a().formatToParts(o),withoutTrailingZeros:()=>o%1==0?s().format(o):a().format(o),withoutTrailingZerosAndCurrency:()=>o%1==0?d().format(o):u().format(o),currencyName:()=>{var t;return(null==(t=c().formatToParts(o).find(p))?void 0:t.value)??e.currencyCode},currencySymbol:()=>{var t;return(null==(t=a().formatToParts(o).find(p))?void 0:t.value)??e.currencyCode},currencyNarrowSymbol:()=>{var e;return(null==(e=l().formatToParts(o).find(p))?void 0:e.value)??""},amount:()=>a().formatToParts(o).filter((e=>["decimal","fraction","group","integer","literal"].includes(e.type))).map((e=>e.value)).join("")})),[e,o,c,a,l,u,s,d]);return(0,i.useMemo)((()=>new Proxy(y,{get:(e,t)=>{var n;return null==(n=Reflect.get(e,t))?void 0:n.call(null)}})),[y])}const rt=new Map;function ot(e,t){const n=JSON.stringify([e,t]);return function(){let r=rt.get(n);return r||(r=new Intl.NumberFormat(e,t),rt.set(n,r)),r}}function it({data:e,as:t,withoutCurrency:n,withoutTrailingZeros:r,measurement:o,measurementSeparator:i="/",...c}){if("string"!=typeof(l=e).amount||!l.amount||"string"!=typeof l.currencyCode||!l.currencyCode)throw new Error(" needs a valid 'data' prop that has 'amount' and 'currencyCode'");var l;const s=nt(e),u=t??"div";let d=s.localizedString;return(n||r)&&(d=n&&!r?s.amount:!n&&r?s.withoutTrailingZeros:s.withoutTrailingZerosAndCurrency),(0,a.jsxs)(u,{...c,children:[d,o&&o.referenceUnit&&(0,a.jsxs)(a.Fragment,{children:[i,o.referenceUnit]})]})}function at(e){const{cost:t}=ve(),{amountType:n="total",children:r,...o}=e;let i;return"total"==n?i=null==t?void 0:t.totalAmount:"subtotal"==n?i=null==t?void 0:t.subtotalAmount:"tax"==n?i=null==t?void 0:t.totalTaxAmount:"duty"==n&&(i=null==t?void 0:t.totalDutyAmount),null==i?null:(0,a.jsx)(it,{...o,data:i,children:r})}const ct=(0,i.createContext)(null);function lt(){const e=(0,i.useContext)(ct);if(null==e)throw new Error("Expected a cart line context but none was found");return e}function st({children:e,line:t}){return(0,a.jsx)(ct.Provider,{value:t,children:e})}function ut(e){const t=lt(),{as:n,...r}=e,o=n||"span";return(0,a.jsx)(o,{...r,children:t.quantity})}function dt(e){const{status:t,linesRemove:n,linesUpdate:r}=ve(),o=lt(),{children:c,adjust:l,onClick:s,...u}=e,d=(0,i.useCallback)((()=>{if("remove"===l)return void n([(null==o?void 0:o.id)??""]);const e="decrease"===l?((null==o?void 0:o.quantity)??0)-1:((null==o?void 0:o.quantity)??0)+1;if(e<=0)return void n([(null==o?void 0:o.id)??""]);const t={id:(null==o?void 0:o.id)??"",quantity:e,attributes:(null==o?void 0:o.attributes)??[]};r([t])}),[l,null==o?void 0:o.attributes,null==o?void 0:o.id,null==o?void 0:o.quantity,n,r]),p=u.disabled;return(0,a.jsx)(Te,{...u,onClick:s,defaultOnClick:d,disabled:void 0!==p?p:"idle"!==t,children:c})}const pt={DateTime:"string",Decimal:"string",HTML:"string",URL:"string",Color:"string",UnsignedInt64:"string"},yt={DateTime:"string",Decimal:"string",HTML:"string",ISO8601DateTime:"string",URL:"string",UnsignedInt64:"string"},ft=(0,i.forwardRef)(((e,t)=>{const{data:n,options:r,id:o=n.id,frameBorder:i="0",allow:c="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:l=!0,loading:s="lazy",...u}=e;if(!n.embedUrl)throw new Error(" requires the 'embedUrl' property");let d=n.embedUrl;if(r){const e=new URL(n.embedUrl);for(const[t,n]of Object.entries(r))void 0!==n&&e.searchParams.set(t,n.toString());d=e.toString()}return(0,a.jsx)("iframe",{...u,id:o??n.embedUrl,title:n.alt??n.id??"external video",frameBorder:i,allow:c,allowFullScreen:l,src:d,loading:s,ref:t})})),gt={OPTION:":",END_OF_PREFIX:",",SEQUENCE_GAP:" ",RANGE:"-"},mt=(()=>{const e=new Map;return function(t,n){var r;if(0===t.length)return!1;if(!e.has(n)){const t=new Set;for(const e of vt(n)){t.add(e.join(","));for(let n=0;ne.replace(/^v1_/,"");function wt(e){return Object.assign({},...e.map((e=>({[e.name]:e.value}))))}function _t(e){return JSON.stringify(wt(e))}function Ct(e){return Array.isArray(e)?JSON.stringify(Object.assign({},...e.map((e=>({[e.name]:e.value}))))):JSON.stringify(e)}const At=["options","selectedOrFirstAvailableVariant","adjacentVariants"],St=["handle","encodedVariantExistence","encodedVariantAvailability"];function bt(e){return console.error(`[h2:error:getProductOptions] product.${e} is missing. Make sure you query for this field from the Storefront API.`),!1}function It(e,t=!1){var n;let r=!0;const o=Object.keys(e);if((t?[...At,...St]:At).forEach((e=>{o.includes(e)||(r=bt(e))})),e.options){const o=null==e?void 0:e.options[0];if(t&&!(null==o?void 0:o.name)&&(r=bt("options.name")),null==(n=null==e?void 0:e.options[0])?void 0:n.optionValues){let n=e.options[0].optionValues[0];t&&!(null==n?void 0:n.name)&&(r=bt("options.optionValues.name")),n=e.options[0].optionValues.filter((e=>!!(null==e?void 0:e.firstSelectableVariant)))[0],(null==n?void 0:n.firstSelectableVariant)&&(r=Pt(n.firstSelectableVariant,"options.optionValues.firstSelectableVariant",r,t))}else r=bt("options.optionValues")}return e.selectedOrFirstAvailableVariant&&(r=Pt(e.selectedOrFirstAvailableVariant,"selectedOrFirstAvailableVariant",r,t)),e.adjacentVariants&&e.adjacentVariants[0]&&(r=Pt(e.adjacentVariants[0],"adjacentVariants",r,t)),r?e:{}}function Pt(e,t,n,r){var o;let i=n;if(r&&!(null==(o=e.product)?void 0:o.handle)&&(i=bt(`${t}.product.handle`)),e.selectedOptions){const n=e.selectedOptions[0];(null==n?void 0:n.name)||(i=bt(`${t}.selectedOptions.name`)),(null==n?void 0:n.value)||(i=bt(`${t}.selectedOptions.value`))}else i=bt(`${t}.selectedOptions`);return i}function Tt(e){const t=It(e);if(!t.options)return[];const n={};t.options.map((e=>{var t;null==(t=e.optionValues)||t.map((e=>{if(e.firstSelectableVariant){const t=_t(e.firstSelectableVariant.selectedOptions);n[t]=e.firstSelectableVariant}}))})),t.adjacentVariants.map((e=>{const t=_t(e.selectedOptions);n[t]=e}));const r=t.selectedOrFirstAvailableVariant;if(r){const e=_t(r.selectedOptions);n[e]=r}return Object.values(n)}function Et(e){const t=It(e,!0);if(!t.options)return[];const{options:n,selectedOrFirstAvailableVariant:r,adjacentVariants:o,encodedVariantExistence:i,encodedVariantAvailability:a,handle:c}=t,l=null==r?void 0:r.selectedOptions.map((e=>e.name)),s=n.filter((e=>l&&l.indexOf(e.name)>=0)),u=function(e){return Object.assign({},...e.map((e=>({[e.name]:Object.assign({},...(null==e?void 0:e.optionValues)?e.optionValues.map(((e,t)=>({[e.name]:t}))):[])}))))}(n),d=function(e){return Object.assign({},...e.map((e=>{const t=Ct(e.selectedOptions||[]);return{[t]:e}})))}(r?[r,...o]:o),p=wt(r?r.selectedOptions:[]),y=s.map(((e,t)=>({...e,optionValues:e.optionValues.map((n=>{var r;const o={...p};o[e.name]=n.name;const l=Ct(o||[]),s=function(e,t){return Object.keys(e).map((n=>t[n]?t[n][e[n]]:null)).filter((e=>null!==e))}(o||[],u),y=s.slice(0,t+1),f=mt(y,i||""),g=mt(y,a||""),m=d[l]||n.firstSelectableVariant;let v={};m&&(v=wt(m.selectedOptions||[]));const h=new URLSearchParams(v),w=(null==(r=null==m?void 0:m.product)?void 0:r.handle)||c;return{...n,variant:m,handle:w,variantUriQuery:h.toString(),selected:p[e.name]===n.name,exists:f,available:g,isDifferentProduct:w!==c}}))})));return y}const Ot="#graphql\n fragment Image on Image {\n altText\n url\n width\n height\n }\n",kt=i.forwardRef((({alt:e,aspectRatio:t,crop:n="center",data:r,decoding:o="async",height:c="auto",loader:l=Lt,loading:s="lazy",sizes:u,src:d,srcSetOptions:p={intervals:15,startingWidth:200,incrementSize:200,placeholderWidth:100},width:y="100%",...f},g)=>{const m=i.useMemo((()=>{const e=(null==r?void 0:r.width)&&(null==r?void 0:r.height)?null==r?void 0:r.width:void 0,t=(null==r?void 0:r.width)&&(null==r?void 0:r.height)?null==r?void 0:r.height:void 0;return{width:e,height:t,unitsMatch:Boolean(Vt(e,t))}}),[r]),v=i.useMemo((()=>{const n=Rt((y||"100%").toString()),o=`${n.number}${n.unit}`,i=null==c,a=i?null:Rt(c.toString()),l=a?`${a.number}${a.unit}`:"";return{width:o,height:i?"auto":l,src:d||(null==r?void 0:r.url),alt:(null==r?void 0:r.altText)&&!e?null==r?void 0:r.altText:e||"",aspectRatio:t||(m.unitsMatch?[Ut(m.width),Ut(m.height)].join("/"):void 0)}}),[y,c,d,r,e,t,m,null==f?void 0:f.key]),{intervals:h,startingWidth:w,incrementSize:_,placeholderWidth:C}=p,A=i.useMemo((()=>function(e="100%",t,n,r){const o=Array.from({length:t},((e,t)=>t*r+n)),i=Array.from({length:3},((t,n)=>(n+1)*(Ut(e)??0)));return $t(e)?i:o}(y,h,w,_)),[y,h,w,_]);return $t(v.width)?(0,a.jsx)(xt,{aspectRatio:t,crop:n,decoding:o,height:c,imageWidths:A,loader:l,loading:s,normalizedProps:v,passthroughProps:f,ref:g,width:y,data:r}):(0,a.jsx)(Dt,{aspectRatio:t,crop:n,decoding:o,imageWidths:A,loader:l,loading:s,normalizedProps:v,passthroughProps:f,placeholderWidth:C,ref:g,sizes:u,data:r})})),xt=i.forwardRef((({aspectRatio:e,crop:t,decoding:n,height:r,imageWidths:o,loader:c=Lt,loading:l,normalizedProps:s,passthroughProps:u,width:d,data:p},y)=>{const f=i.useMemo((()=>{const n=Ut(d),i=Ut(r),a=e||(Vt(s.width,s.height)?[n,i].join("/"):s.aspectRatio?s.aspectRatio:void 0),l=void 0===o?void 0:qt(o,a,t,{width:(null==p?void 0:p.width)??void 0,height:(null==p?void 0:p.height)??void 0}),u=i||(a&&n?n*(jt(a)??1):void 0);return{width:n,aspectRatio:a,height:u,srcSet:Ft(s.src,l,c),src:c({src:s.src,width:n,height:u,crop:"auto"===s.height?void 0:t})}}),[e,t,p,r,o,c,s,d]);return(0,a.jsx)("img",{ref:y,alt:s.alt,decoding:n,height:f.height,loading:l,src:f.src,srcSet:f.srcSet,width:f.width,style:{aspectRatio:f.aspectRatio,...u.style},...u})})),Dt=i.forwardRef((({crop:e,decoding:t,imageWidths:n,loader:r=Lt,loading:o,normalizedProps:c,passthroughProps:l,placeholderWidth:s,sizes:u,data:d},p)=>{const y=i.useMemo((()=>{const t=void 0===n?void 0:qt(n,c.aspectRatio,e,{width:(null==d?void 0:d.width)??void 0,height:(null==d?void 0:d.height)??void 0}),o=c.aspectRatio&&s?s*(jt(c.aspectRatio)??1):void 0;return{placeholderHeight:o,srcSet:Ft(c.src,t,r),src:r({src:c.src,width:s,height:o,crop:e})}}),[e,d,n,r,c,s]);return(0,a.jsx)("img",{ref:p,alt:c.alt,decoding:t,height:y.placeholderHeight,loading:o,sizes:u,src:y.src,srcSet:y.srcSet,width:s,...l,style:{width:c.width,aspectRatio:c.aspectRatio,...l.style}})})),Nt="https://placeholder.shopify.com";function Lt({src:e,width:t,height:n,crop:r}){if(!e)return"";const o=new URL(e,Nt);return t&&o.searchParams.append("width",Math.round(t).toString()),n&&o.searchParams.append("height",Math.round(n).toString()),r&&o.searchParams.append("crop",r),o.href.replace(Nt,"")}function Vt(e="100%",t="auto"){return Rt(e.toString()).unit===Rt(t.toString()).unit}function Rt(e){const t=e.replace(/[0-9.]/g,""),n=parseFloat(e.replace(t,""));return{unit:""===t?void 0===n?"auto":"px":t,number:n}}function Ut(e){if(void 0===e)return;const{unit:t,number:n}=Rt(e.toString());switch(t){case"em":case"rem":return 16*n;case"px":case"":return n;default:return}}function $t(e){return"number"==typeof e||/\d(px|em|rem)$/.test(e)}function Ft(e,t,n=Lt){return e?0!==(null==t?void 0:t.length)&&t?t.map(((r,o)=>`${n({src:e,width:r.width,height:r.height,crop:r.crop})} ${3===t.length?`${o+1}x`:`${r.width??0}w`}`)).join(", "):e:""}function jt(e){if(!e)return;const[t,n]=e.split("/");return 1/(Number(t)/Number(n))}function qt(e,t,n="center",r){if(e)return e.map((e=>({width:e,height:t?e*(jt(t)??1):void 0,crop:n}))).filter((({width:e,height:t})=>!((null==r?void 0:r.width)&&e>r.width||(null==r?void 0:r.height)&&t&&t>r.height)))}const Mt={};function Gt(e,t){const[n,r]=(0,i.useState)("loading");return(0,i.useEffect)((()=>{(function(e,t){const n=Mt[e];if(n)return n;const r=new Promise(((n,r)=>{const o=document.createElement("script");(null==t?void 0:t.module)?o.type="module":o.type="text/javascript",o.src=e,o.onload=()=>{n(!0)},o.onerror=()=>{r(!1)},"head"===(null==t?void 0:t.in)?document.head.appendChild(o):document.body.appendChild(o);const i=null==t?void 0:t.attributes;i&&Object.keys(i).forEach((e=>{o.setAttribute(e,i[e])}))}));return Mt[e]=r,r})(e,t).then((()=>r("done"))).catch((()=>r("error")))}),[e]),n}const Bt=(0,i.forwardRef)(((e,t)=>{var n;const{data:r,previewImageOptions:o,id:c=r.id,playsInline:l=!0,controls:s=!0,sourceProps:u={},...d}=e,p=Lt({src:(null==(n=r.previewImage)?void 0:n.url)??"",...o});if(!r.sources)throw new Error("