@shopify/hydrogen 2026.1.2 → 2026.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/index.cjs +2 -2
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +2 -2
- package/dist/development/index.js.map +1 -1
- package/dist/production/index.cjs +2 -2
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +2 -2
- package/dist/production/index.js.map +1 -1
- package/dist/vite/plugin.js +3 -7
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var react=require('react'),reactRouter=require('react-router'),jsxRuntime=require('react/jsx-runtime'),hydrogenReact=require('@shopify/hydrogen-react'),loadScript=require('@shopify/hydrogen-react/load-script'),graphqlClient=require('@shopify/graphql-client'),cookie=require('worktop/cookie'),cs=require('content-security-policy-builder');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var cs__default=/*#__PURE__*/_interopDefault(cs);var an=Object.defineProperty;var Pr=(e,t)=>()=>(e&&(t=e(e=0)),t);var vr=(e,t)=>{for(var r in t)an(e,r,{get:t[r],enumerable:true});};var Vo={};vr(Vo,{VIRTUAL_ROUTES_DIR:()=>$e,VIRTUAL_ROUTES_DIR_PARTS:()=>No,VIRTUAL_ROUTES_ROUTES_DIR_PARTS:()=>Fe,createVirtualRoutesPath:()=>Mo,getVirtualRoutesV3:()=>gs});function Mo(e,t,r){let o=new URL("../",e),n=t.reduce((s,c)=>new URL(`${c}/`,s),o),a=new URL(r,n).pathname.replace(/^\/[a-zA-Z]:\//,"/");return decodeURIComponent(a)}function Ve(e,t){return Mo((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)),e,t)}async function gs(){return {routes:[{id:`${$e}/graphiql`,path:"graphiql",file:Ve(Fe,"graphiql.jsx"),index:false},{id:`${$e}/subrequest-profiler`,path:"subrequest-profiler",file:Ve(Fe,"subrequest-profiler.jsx"),index:false},{id:`${$e}/[.]well-known.appspecific.com[.]chrome[.]devtools[.]json`,path:".well-known/appspecific/com.chrome.devtools.json",file:Ve(Fe,"[.]well-known.appspecific.com[.]chrome[.]devtools[.]json.jsx"),index:false},{id:`${$e}/index`,path:"",file:Ve(Fe,"index.jsx"),index:true}],layout:{file:Ve(No,"layout.jsx")}}}var $e,Fe,No;var Zo={};vr(Zo,{default:()=>Jo,logSeoTags:()=>Xo});function Jo({headTags:e}){return Xo(e),null}function Xo(e){console.log(" "),console.log("%cSEO Meta Tags",`${zs}`),console.log(" "),e.forEach(t=>{if(t.tag==="script"){if(console.log("%c\u2022 JSON LD ",Sr),t.children)try{console.table(JSON.parse(t.children),["name","content"]);}catch{console.log(t.children);}}else {if(console.log(`%c\u2022 ${t.tag} `,Sr),t.children)if(typeof t.children=="string")console.log(`\u21B3 ${t.children}`);else try{Object.entries(JSON.parse(t.children)).map(([r,o])=>console.log(`\u21B3 ${o}`));}catch{console.log(t.children);}if(t.props.property==="og:image:url"){let r=t.props.content;Js(r).then(o=>{let n=`font-size: 400px; padding: 10px; background: white url(${o}) no-repeat center; background-size: contain;`;console.log("%c\u2022 Share image preview",Sr),console.log("%c ",n),console.log(`\u21B3 ${r}`);}).catch(o=>{console.error(o);});}Object.entries(t.props).map(([r,o])=>{console.log(`\u21B3 ${r} \u2192 ${o}`);});}console.log(" ");});}async function Js(e){let o=await(await(await fetch(e)).blob()).arrayBuffer();return `data:image/png;base64,${Xs(o)}`}function Xs(e){let t="",r=new Uint8Array(e),o=r.byteLength;for(let n=0;n<o;n++)t+=String.fromCharCode(r[n]);return btoa(t)}var Sr,zs,en=Pr(()=>{Sr="text-transform: uppercase;",zs="text-transform: uppercase; font-weight: bold; text-transform: uppercase;font-weight: bold";});function le(e){let{type:t,data:r={},customData:o}=e,n=reactRouter.useLocation(),{publish:a,cart:s,prevCart:c,shop:i,customData:u}=Y(),p=n.pathname+n.search,y={...r,customData:{...u,...o},cart:s,prevCart:c,shop:i};return react.useEffect(()=>{i?.shopId&&(y={...y,url:window.location.href},a(t,y));},[a,p,i?.shopId]),null}function Rr(e){return jsxRuntime.jsx(le,{...e,type:"page_viewed"})}function Ir(e){return jsxRuntime.jsx(le,{...e,type:"product_viewed"})}function Tr(e){return jsxRuntime.jsx(le,{...e,type:"collection_viewed"})}function Er(e){return jsxRuntime.jsx(le,{...e,type:"cart_viewed"})}function br(e){return jsxRuntime.jsx(le,{...e,type:"search_viewed"})}function wr(e){return jsxRuntime.jsx(le,{...e})}var F={PAGE_VIEWED:"page_viewed",PRODUCT_VIEWED:"product_viewed",COLLECTION_VIEWED:"collection_viewed",CART_VIEWED:"cart_viewed",SEARCH_VIEWED:"search_viewed",CART_UPDATED:"cart_updated",PRODUCT_ADD_TO_CART:"product_added_to_cart",PRODUCT_REMOVED_FROM_CART:"product_removed_from_cart",CUSTOM_EVENT:"custom_"};var Qe="Custom-Storefront-Request-Group-ID",We="X-Shopify-Storefront-Access-Token",Ct="X-SDK-Variant",ht="X-SDK-Variant-Source",At="X-SDK-Version",St="X-Shopify-Client-IP",Re="X-Shopify-Client-IP-Sig",je="_sfapi_proxy",Ke="_server_tracking";function un(e){return Object.entries(e).map(([t,r])=>r?`${t};desc=${r}`:void 0).filter(Boolean).join(", ")}function Ie(e,t){let r=typeof t=="string"?t:un(t);r&&e.headers.append("Server-Timing",r);}var dn=["_y","_s","_cmp"];function Dr(e){let t={};if(!e)return t;let r=new RegExp(`\\b(${dn.join("|")});desc="?([^",]+)"?`,"g"),o;for(;(o=r.exec(e))!==null;)t[o[1]]=o[2];return t}function xr(e){if(typeof window>"u")return false;try{return !!window.performance.getEntriesByType("navigation")[0]?.serverTiming?.some(r=>r.name===e)}catch{return false}}function Or(){return xr(je)}function _r(){return xr(Ke)}var gn="https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.2/consent-tracking-api.js",Cn="https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js";function vt(e){console.error(`[h2:error:useCustomerPrivacy] Unable to setup Customer Privacy API: Missing consent.${e} configuration.`);}function Rt(e){let{withPrivacyBanner:t=false,onVisitorConsentCollected:r,onReady:o,checkoutDomain:n,storefrontAccessToken:a,country:s,locale:c,sameDomainForStorefrontApi:i}=e,u=react.useMemo(()=>i??Or(),[i]),p=react.useMemo(()=>u&&!_r(),[u]),y=hydrogenReact.useShopifyCookies({fetchTrackingValues:p,storefrontAccessToken:a,ignoreDeprecatedCookies:true}),g=react.useMemo(hydrogenReact.getTrackingValues,[y]),{revalidate:m}=reactRouter.useRevalidator();loadScript.useLoadScript(t?Cn:gn,{attributes:{id:"customer-privacy-api"}});let{observing:d,setLoaded:l,apisLoaded:P}=An({withPrivacyBanner:t}),f=react.useMemo(()=>{n||vt("checkoutDomain"),a||vt("storefrontAccessToken"),(a.startsWith("shpat_")||a.length!==32)&&console.error("[h2:error:useCustomerPrivacy] It looks like you passed a private access token, make sure to use the public token");let h=Sn(n);return {checkoutRootDomain:u&&typeof window<"u"?window.location.host:n,storefrontRootDomain:h?"."+h:void 0,storefrontAccessToken:a,country:s,locale:c}},[vt,n,a,s,c]);react.useEffect(()=>{let h=A=>{let C=hydrogenReact.getTrackingValues();if((g.visitToken!==C.visitToken||g.uniqueToken!==C.uniqueToken)&&m().catch(()=>{console.warn("[h2:warn:useCustomerPrivacy] Revalidation failed after consent change.");}),r){let R=re();if(R?.shouldShowBanner()){let I=R.currentVisitorConsent();if(I&&I.marketing===""&&I.analytics===""&&I.preferences==="")return}r(A.detail);}};return document.addEventListener("visitorConsentCollected",h),()=>{document.removeEventListener("visitorConsentCollected",h);}},[r]),react.useEffect(()=>{if(!t||d.current.privacyBanner)return;d.current.privacyBanner=true;let h=window.privacyBanner||void 0;Object.defineProperty(window,"privacyBanner",{configurable:true,get(){return h},set(C){typeof C=="object"&&C!==null&&"showPreferences"in C&&"loadBanner"in C&&(h=kr({privacyBanner:C,config:f}),l.privacyBanner());}});},[t,f,kr,l.privacyBanner]),react.useEffect(()=>{if(d.current.customerPrivacy)return;d.current.customerPrivacy=true;let h=null,A=window.Shopify||void 0;Object.defineProperty(window,"Shopify",{configurable:true,get(){return A},set(C){typeof C=="object"&&C!==null&&Object.keys(C).length===0&&(A=C,Object.defineProperty(window.Shopify,"customerPrivacy",{configurable:true,get(){return h},set(R){if(typeof R=="object"&&R!==null&&"setTrackingConsent"in R){let I=R;h={...I,setTrackingConsent:Lr({customerPrivacy:I,config:f})},A={...A,customerPrivacy:h},l.customerPrivacy();}}}));}});},[f,Lr,l.customerPrivacy]),react.useEffect(()=>{if(!P||!y)return;let h=re();if(h&&!h.cachedConsent){let A=hydrogenReact.getTrackingValues();A.consent&&(h.cachedConsent=A.consent);}if(t){let A=Te();A&&A.loadBanner(f);}hn(),o?.();},[P,y]);let v={customerPrivacy:re()};return t&&(v.privacyBanner=Te()),v}var Ur=false;function hn(){if(Ur)return;Ur=true;let e=new CustomEvent("shopifyCustomerPrivacyApiLoaded");document.dispatchEvent(e);}function An({withPrivacyBanner:e}){let t=react.useRef({customerPrivacy:false,privacyBanner:false}),[r,o]=react.useState(e?[false,false]:[false]),n=r.every(Boolean);return {observing:t,setLoaded:{customerPrivacy:()=>{o(e?s=>[true,s[1]]:()=>[true]);},privacyBanner:()=>{e&&o(s=>[s[0],true]);}},apisLoaded:n}}function Sn(e){if(typeof window>"u")return;let t=window.location.host,r=e.split(".").reverse(),o=t.split(".").reverse(),n=[];return r.forEach((a,s)=>{a===o[s]&&n.push(a);}),n.reverse().join(".")||void 0}function Lr({customerPrivacy:e,config:t}){let r=e.setTrackingConsent,{locale:o,country:n,...a}=t;function s(c,i){r({...a,headlessStorefront:true,...c},i);}return s}function kr({privacyBanner:e,config:t}){let r=e.loadBanner,o=e.showPreferences;function n(s){if(typeof s=="object"){r({...t,...s});return}r(t);}function a(s){if(typeof s=="object"){o({...t,...s});return}o(t);}return {loadBanner:n,showPreferences:a}}function re(){try{return window.Shopify&&window.Shopify.customerPrivacy?window.Shopify?.customerPrivacy:null}catch{return null}}function Te(){try{return window&&window?.privacyBanner?window.privacyBanner:null}catch{return null}}var Nr="2026.1.2";function En(){let e=re();if(!e)throw new Error("Shopify Customer Privacy API not available. Must be used within a useEffect. Make sure to load the Shopify Customer Privacy API with useCustomerPrivacy() or <AnalyticsProvider>.");return e}function Vr({consent:e,onReady:t,domain:r}){let{subscribe:o,register:n,canTrack:a}=Y(),[s,c]=react.useState(false),[i,u]=react.useState(false),[p,y]=react.useState(""),g=react.useRef(false),{checkoutDomain:m,storefrontAccessToken:d,language:l}=e,{ready:P}=n("Internal_Shopify_Analytics");Rt({...e,locale:l,checkoutDomain:m||"mock.shop",storefrontAccessToken:d||"abcdefghijklmnopqrstuvwxyz123456",onReady:()=>!e.withPrivacyBanner&&u(true),onVisitorConsentCollected:v=>{try{y(JSON.stringify(v));}catch{}u(true);}});let f=react.useMemo(()=>i?a():true,[i,a,p]);return hydrogenReact.useShopifyCookies({hasUserConsent:f,domain:r,checkoutDomain:m,fetchTrackingValues:false,ignoreDeprecatedCookies:!i}),react.useEffect(()=>{g.current||(g.current=true,o(F.PAGE_VIEWED,wn),o(F.PRODUCT_VIEWED,Dn),o(F.COLLECTION_VIEWED,xn),o(F.SEARCH_VIEWED,On),o(F.PRODUCT_ADD_TO_CART,_n),c(true));},[o]),react.useEffect(()=>{s&&i&&(P(),t());},[s,i,t]),null}function Je(e){console.error(`[h2:error:ShopifyAnalytics] Unable to send Shopify analytics: Missing shop.${e} configuration.`);}function we(e){let t=En(),r=t.analyticsProcessingAllowed();if(!e?.shop?.shopId){Je("shopId");return}if(!e?.shop?.acceptedLanguage){Je("acceptedLanguage");return}if(!e?.shop?.currency){Je("currency");return}if(!e?.shop?.hydrogenSubchannelId){Je("hydrogenSubchannelId");return}return {shopifySalesChannel:"hydrogen",assetVersionId:Nr,...e.shop,hasUserConsent:r,...hydrogenReact.getClientBrowserParameters(),analyticsAllowed:t.analyticsProcessingAllowed(),marketingAllowed:t.marketingAllowed(),saleOfDataAllowed:t.saleOfDataAllowed(),ccpaEnforced:!t.saleOfDataAllowed(),gdprEnforced:!(t.marketingAllowed()&&t.analyticsProcessingAllowed())}}function bn(e,t){if(t===null)return;let r=we(e);return r?{...r,cartId:t.id}:void 0}var oe={};function wn(e){let t=we(e);t&&(hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PAGE_VIEW_2,payload:{...t,...oe}}),oe={});}function Dn(e){let t=we(e);if(t&&$r({type:"product",products:e.products})){let r=Tt(e.products);oe={pageType:hydrogenReact.AnalyticsPageType.product,resourceId:r[0].productGid},t={...t,...oe,products:Tt(e.products)},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PRODUCT_VIEW,payload:t});}}function xn(e){let t=we(e);t&&(oe={pageType:hydrogenReact.AnalyticsPageType.collection,resourceId:e.collection.id},t={...t,...oe,collectionHandle:e.collection.handle,collectionId:e.collection.id},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.COLLECTION_VIEW,payload:t}));}function On(e){let t=we(e);t&&(oe={pageType:hydrogenReact.AnalyticsPageType.search},t={...t,...oe,searchString:e.searchTerm},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.SEARCH_VIEW,payload:t}));}function _n(e){let{cart:t,currentLine:r}=e,o=bn(e,t);!o||!r?.id||Un({matchedLine:r,eventPayload:o});}function Un({matchedLine:e,eventPayload:t}){let r={id:e.merchandise.product.id,variantId:e.merchandise.id,title:e.merchandise.product.title,variantTitle:e.merchandise.title,vendor:e.merchandise.product.vendor,price:e.merchandise.price.amount,quantity:e.quantity,productType:e.merchandise.product.productType,sku:e.merchandise.sku};$r({type:"cart",products:[r]})&&hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.ADD_TO_CART,payload:{...t,products:Tt([r])}});}function ce(e,t,r,o){if(e==="cart"){let n=`${r?"merchandise":"merchandise.product"}.${t}`;console.error(`[h2:error:ShopifyAnalytics] Can't set up cart analytics events because the \`cart.lines[].${n}\` value is missing from your GraphQL cart query. In your project, search for where \`fragment CartLine on CartLine\` is defined and make sure \`${n}\` is part of your cart query. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/lib/fragments.ts#L25-L56.`);}else {let n=`${o||t}`;console.error(`[h2:error:ShopifyAnalytics] Can't set up product view analytics events because the \`${n}\` is missing from your \`<Analytics.ProductView>\`. Make sure \`${n}\` is part of your products data prop. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/routes/products.%24handle.tsx#L159-L165.`);}}function $r({type:e,products:t}){return !t||t.length===0?(ce(e,"",false,"data.products"),false):(t.forEach(r=>{if(!r.id)return ce(e,"id",false),false;if(!r.title)return ce(e,"title",false),false;if(!r.price)return ce(e,"price.amount",true,"price"),false;if(!r.vendor)return ce(e,"vendor",false),false;if(!r.variantId)return ce(e,"id",true,"variantId"),false;if(!r.variantTitle)return ce(e,"title",true,"variantTitle"),false}),true)}function Tt(e){return e.map(t=>{let r={productGid:t.id,variantGid:t.variantId,name:t.title,variantName:t.variantTitle,brand:t.vendor,price:t.price,quantity:t.quantity||1,category:t.productType};return t.sku&&(r.sku=t.sku),t.productType&&(r.category=t.productType),r})}function qr(e){console.error(`[h2:error:CartAnalytics] Can't set up cart analytics events because the \`cart.${e}\` value is missing from your GraphQL cart query. In your project, search for where \`fragment CartApiQuery on Cart\` is defined and make sure \`${e}\` is part of your cart query. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/lib/fragments.ts#L59.`);}function Gr({cart:e,setCarts:t}){let{publish:r,shop:o,customData:n,canTrack:a,cart:s,prevCart:c}=Y(),i=react.useRef(null);return react.useEffect(()=>{if(e)return Promise.resolve(e).then(u=>{if(u&&u.lines){if(!u.id){qr("id");return}if(!u.updatedAt){qr("updatedAt");return}}t(({cart:p,prevCart:y})=>u?.updatedAt!==p?.updatedAt?{cart:u,prevCart:p}:{cart:p,prevCart:y});}),()=>{}},[t,e]),react.useEffect(()=>{if(!s||!s?.updatedAt||s?.updatedAt===c?.updatedAt)return;let u;try{u=JSON.parse(localStorage.getItem("cartLastUpdatedAt")||"");}catch{u=null;}if(s.id===u?.id&&s.updatedAt===u?.updatedAt)return;let p={eventTimestamp:Date.now(),cart:s,prevCart:c,shop:o,customData:n};if(s.updatedAt===i.current)return;i.current=s.updatedAt,r("cart_updated",p),localStorage.setItem("cartLastUpdatedAt",JSON.stringify({id:s.id,updatedAt:s.updatedAt}));let y=c?.lines?hydrogenReact.flattenConnection(c?.lines):[],g=s.lines?hydrogenReact.flattenConnection(s.lines):[];y?.forEach(m=>{let d=g.filter(l=>m.id===l.id);if(d?.length===1){let l=d[0];m.quantity<l.quantity?r("product_added_to_cart",{...p,prevLine:m,currentLine:l}):m.quantity>l.quantity&&r("product_removed_from_cart",{...p,prevLine:m,currentLine:l});}else r("product_removed_from_cart",{...p,prevLine:m});}),g?.forEach(m=>{let d=y.filter(l=>m.id===l.id);(!d||d.length===0)&&r("product_added_to_cart",{...p,currentLine:m});});},[s,c,r,o,n,a]),null}var $n="https://cdn.shopify.com/shopifycloud/perf-kit/shopify-perf-kit-spa.min.js";function Br({shop:e}){let t=react.useRef(false),{subscribe:r,register:o}=Y(),{ready:n}=o("Internal_Shopify_Perf_Kit"),a=hydrogenReact.useLoadScript($n,{attributes:{id:"perfkit","data-application":"hydrogen","data-shop-id":hydrogenReact.parseGid(e.shopId).id.toString(),"data-storefront-id":e.hydrogenSubchannelId,"data-monorail-region":"global","data-spa-mode":"true","data-resource-timing-sampling-rate":"100"}});return react.useEffect(()=>{a!=="done"||t.current||(t.current=true,r(F.PAGE_VIEWED,()=>{window.PerfKit?.navigate();}),r(F.PRODUCT_VIEWED,()=>{window.PerfKit?.setPageType("product");}),r(F.COLLECTION_VIEWED,()=>{window.PerfKit?.setPageType("collection");}),r(F.SEARCH_VIEWED,()=>{window.PerfKit?.setPageType("search");}),r(F.CART_VIEWED,()=>{window.PerfKit?.setPageType("cart");}),n());},[r,n,a]),null}var Qr=new Set,B=e=>{Qr.has(e)||(console.warn(e),Qr.add(e));},Wr=new Set,bt=e=>{Wr.has(e)||(console.error(new Error(e)),Wr.add(e));};var Bn={canTrack:()=>false,cart:null,customData:{},prevCart:null,publish:()=>{},shop:null,subscribe:()=>{},register:()=>({ready:()=>{}}),customerPrivacy:null,privacyBanner:null},Xr=react.createContext(Bn),Ze=new Map,xe={};function Zr(){return Object.values(xe).every(Boolean)}function jr(e,t){Ze.has(e)||Ze.set(e,new Map),Ze.get(e)?.set(t.toString(),t);}var et=new Map;function Kr(e,t){if(!Zr()){et.set(e,t);return}eo(e,t);}function eo(e,t){(Ze.get(e)??new Map).forEach((r,o)=>{try{r(t);}catch(n){typeof n=="object"&&n instanceof Error?console.error("Analytics publish error",n.message,o,n.stack):console.error("Analytics publish error",n,o);}});}function Yr(e){return xe.hasOwnProperty(e)||(xe[e]=false),{ready:()=>{xe[e]=true,Zr()&&et.size>0&&(et.forEach((t,r)=>{eo(r,t);}),et.clear());}}}function zr(){try{return window.Shopify.customerPrivacy.analyticsProcessingAllowed()}catch{}return false}function Jr(e,t){return `[h2:error:Analytics.Provider] - ${e} is required. Make sure ${t} is defined in your environment variables. See https://h2o.fyi/analytics/consent to learn how to setup environment variables in the Shopify admin.`}function Qn({canTrack:e,cart:t,children:r,consent:o,customData:n={},shop:a=null,cookieDomain:s}){let{shop:c}=Wn(a),[i,u]=react.useState(!!e),[p,y]=react.useState(false),[g,m]=react.useState({cart:null,prevCart:null}),[d,l]=react.useState(e?()=>e:()=>zr);if(c)if(/\/68817551382$/.test(c.shopId))B("[h2:error:Analytics.Provider] - Mock shop is used. Analytics will not work properly.");else {if(!o.checkoutDomain){let f=Jr("consent.checkoutDomain","PUBLIC_CHECKOUT_DOMAIN");bt(f);}if(!o.storefrontAccessToken){let f=Jr("consent.storefrontAccessToken","PUBLIC_STOREFRONT_API_TOKEN");bt(f);}o?.country||(o.country="US"),o?.language||(o.language="EN"),o.withPrivacyBanner===void 0&&(o.withPrivacyBanner=false);}let P=react.useMemo(()=>({canTrack:d,...g,customData:n,publish:d()?Kr:()=>{},shop:c,subscribe:jr,register:Yr,customerPrivacy:re(),privacyBanner:Te()}),[i,d,g,g.cart?.updatedAt,g.prevCart,Kr,jr,n,c,Yr,JSON.stringify(xe),re,Te]);return jsxRuntime.jsxs(Xr.Provider,{value:P,children:[r,!!c&&jsxRuntime.jsx(Rr,{}),!!c&&!!t&&jsxRuntime.jsx(Gr,{cart:t,setCarts:m}),!!c&&jsxRuntime.jsx(Vr,{consent:o,onReady:()=>{u(true),l(e?()=>e:()=>zr),y(true);},domain:s}),!!c&&p&&jsxRuntime.jsx(Br,{shop:c})]})}function Y(){let e=react.useContext(Xr);if(!e)throw new Error("[h2:error:useAnalytics] 'useAnalytics()' must be a descendent of <AnalyticsProvider/>");return e}function Wn(e){let[t,r]=react.useState(null);return react.useEffect(()=>(Promise.resolve(e).then(r),()=>{}),[r,e]),{shop:t}}async function jn({storefront:e,publicStorefrontId:t="0"}){return e.query(Kn,{cache:e.CacheLong()}).then(({shop:r,localization:o})=>({shopId:r.id,acceptedLanguage:o.language.isoCode,currency:o.country.currency.isoCode,hydrogenSubchannelId:t}))}var Kn=`#graphql
|
|
1
|
+
'use strict';var react=require('react'),reactRouter=require('react-router'),jsxRuntime=require('react/jsx-runtime'),hydrogenReact=require('@shopify/hydrogen-react'),loadScript=require('@shopify/hydrogen-react/load-script'),graphqlClient=require('@shopify/graphql-client'),cookie=require('worktop/cookie'),cs=require('content-security-policy-builder');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var cs__default=/*#__PURE__*/_interopDefault(cs);var an=Object.defineProperty;var Pr=(e,t)=>()=>(e&&(t=e(e=0)),t);var vr=(e,t)=>{for(var r in t)an(e,r,{get:t[r],enumerable:true});};var Vo={};vr(Vo,{VIRTUAL_ROUTES_DIR:()=>$e,VIRTUAL_ROUTES_DIR_PARTS:()=>No,VIRTUAL_ROUTES_ROUTES_DIR_PARTS:()=>Fe,createVirtualRoutesPath:()=>Mo,getVirtualRoutesV3:()=>gs});function Mo(e,t,r){let o=new URL("../",e),n=t.reduce((s,c)=>new URL(`${c}/`,s),o),a=new URL(r,n).pathname.replace(/^\/[a-zA-Z]:\//,"/");return decodeURIComponent(a)}function Ve(e,t){return Mo((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)),e,t)}async function gs(){return {routes:[{id:`${$e}/graphiql`,path:"graphiql",file:Ve(Fe,"graphiql.jsx"),index:false},{id:`${$e}/subrequest-profiler`,path:"subrequest-profiler",file:Ve(Fe,"subrequest-profiler.jsx"),index:false},{id:`${$e}/[.]well-known.appspecific.com[.]chrome[.]devtools[.]json`,path:".well-known/appspecific/com.chrome.devtools.json",file:Ve(Fe,"[.]well-known.appspecific.com[.]chrome[.]devtools[.]json.jsx"),index:false},{id:`${$e}/index`,path:"",file:Ve(Fe,"index.jsx"),index:true}],layout:{file:Ve(No,"layout.jsx")}}}var $e,Fe,No;var Zo={};vr(Zo,{default:()=>Jo,logSeoTags:()=>Xo});function Jo({headTags:e}){return Xo(e),null}function Xo(e){console.log(" "),console.log("%cSEO Meta Tags",`${zs}`),console.log(" "),e.forEach(t=>{if(t.tag==="script"){if(console.log("%c\u2022 JSON LD ",Sr),t.children)try{console.table(JSON.parse(t.children),["name","content"]);}catch{console.log(t.children);}}else {if(console.log(`%c\u2022 ${t.tag} `,Sr),t.children)if(typeof t.children=="string")console.log(`\u21B3 ${t.children}`);else try{Object.entries(JSON.parse(t.children)).map(([r,o])=>console.log(`\u21B3 ${o}`));}catch{console.log(t.children);}if(t.props.property==="og:image:url"){let r=t.props.content;Js(r).then(o=>{let n=`font-size: 400px; padding: 10px; background: white url(${o}) no-repeat center; background-size: contain;`;console.log("%c\u2022 Share image preview",Sr),console.log("%c ",n),console.log(`\u21B3 ${r}`);}).catch(o=>{console.error(o);});}Object.entries(t.props).map(([r,o])=>{console.log(`\u21B3 ${r} \u2192 ${o}`);});}console.log(" ");});}async function Js(e){let o=await(await(await fetch(e)).blob()).arrayBuffer();return `data:image/png;base64,${Xs(o)}`}function Xs(e){let t="",r=new Uint8Array(e),o=r.byteLength;for(let n=0;n<o;n++)t+=String.fromCharCode(r[n]);return btoa(t)}var Sr,zs,en=Pr(()=>{Sr="text-transform: uppercase;",zs="text-transform: uppercase; font-weight: bold; text-transform: uppercase;font-weight: bold";});function le(e){let{type:t,data:r={},customData:o}=e,n=reactRouter.useLocation(),{publish:a,cart:s,prevCart:c,shop:i,customData:u}=Y(),p=n.pathname+n.search,y={...r,customData:{...u,...o},cart:s,prevCart:c,shop:i};return react.useEffect(()=>{i?.shopId&&(y={...y,url:window.location.href},a(t,y));},[a,p,i?.shopId]),null}function Rr(e){return jsxRuntime.jsx(le,{...e,type:"page_viewed"})}function Ir(e){return jsxRuntime.jsx(le,{...e,type:"product_viewed"})}function Tr(e){return jsxRuntime.jsx(le,{...e,type:"collection_viewed"})}function Er(e){return jsxRuntime.jsx(le,{...e,type:"cart_viewed"})}function br(e){return jsxRuntime.jsx(le,{...e,type:"search_viewed"})}function wr(e){return jsxRuntime.jsx(le,{...e})}var F={PAGE_VIEWED:"page_viewed",PRODUCT_VIEWED:"product_viewed",COLLECTION_VIEWED:"collection_viewed",CART_VIEWED:"cart_viewed",SEARCH_VIEWED:"search_viewed",CART_UPDATED:"cart_updated",PRODUCT_ADD_TO_CART:"product_added_to_cart",PRODUCT_REMOVED_FROM_CART:"product_removed_from_cart",CUSTOM_EVENT:"custom_"};var Qe="Custom-Storefront-Request-Group-ID",We="X-Shopify-Storefront-Access-Token",Ct="X-SDK-Variant",ht="X-SDK-Variant-Source",At="X-SDK-Version",St="X-Shopify-Client-IP",Re="X-Shopify-Client-IP-Sig",je="_sfapi_proxy",Ke="_server_tracking";function un(e){return Object.entries(e).map(([t,r])=>r?`${t};desc=${r}`:void 0).filter(Boolean).join(", ")}function Ie(e,t){let r=typeof t=="string"?t:un(t);r&&e.headers.append("Server-Timing",r);}var dn=["_y","_s","_cmp"];function Dr(e){let t={};if(!e)return t;let r=new RegExp(`\\b(${dn.join("|")});desc="?([^",]+)"?`,"g"),o;for(;(o=r.exec(e))!==null;)t[o[1]]=o[2];return t}function xr(e){if(typeof window>"u")return false;try{return !!window.performance.getEntriesByType("navigation")[0]?.serverTiming?.some(r=>r.name===e)}catch{return false}}function Or(){return xr(je)}function _r(){return xr(Ke)}var gn="https://cdn.shopify.com/shopifycloud/consent-tracking-api/v0.2/consent-tracking-api.js",Cn="https://cdn.shopify.com/shopifycloud/privacy-banner/storefront-banner.js";function vt(e){console.error(`[h2:error:useCustomerPrivacy] Unable to setup Customer Privacy API: Missing consent.${e} configuration.`);}function Rt(e){let{withPrivacyBanner:t=false,onVisitorConsentCollected:r,onReady:o,checkoutDomain:n,storefrontAccessToken:a,country:s,locale:c,sameDomainForStorefrontApi:i}=e,u=react.useMemo(()=>i??Or(),[i]),p=react.useMemo(()=>u&&!_r(),[u]),y=hydrogenReact.useShopifyCookies({fetchTrackingValues:p,storefrontAccessToken:a,ignoreDeprecatedCookies:true}),g=react.useMemo(hydrogenReact.getTrackingValues,[y]),{revalidate:m}=reactRouter.useRevalidator();loadScript.useLoadScript(t?Cn:gn,{attributes:{id:"customer-privacy-api"}});let{observing:d,setLoaded:l,apisLoaded:P}=An({withPrivacyBanner:t}),f=react.useMemo(()=>{n||vt("checkoutDomain"),a||vt("storefrontAccessToken"),(a.startsWith("shpat_")||a.length!==32)&&console.error("[h2:error:useCustomerPrivacy] It looks like you passed a private access token, make sure to use the public token");let h=Sn(n);return {checkoutRootDomain:u&&typeof window<"u"?window.location.host:n,storefrontRootDomain:h?"."+h:void 0,storefrontAccessToken:a,country:s,locale:c}},[vt,n,a,s,c]);react.useEffect(()=>{let h=A=>{let C=hydrogenReact.getTrackingValues();if((g.visitToken!==C.visitToken||g.uniqueToken!==C.uniqueToken)&&m().catch(()=>{console.warn("[h2:warn:useCustomerPrivacy] Revalidation failed after consent change.");}),r){let R=re();if(R?.shouldShowBanner()){let I=R.currentVisitorConsent();if(I&&I.marketing===""&&I.analytics===""&&I.preferences==="")return}r(A.detail);}};return document.addEventListener("visitorConsentCollected",h),()=>{document.removeEventListener("visitorConsentCollected",h);}},[r]),react.useEffect(()=>{if(!t||d.current.privacyBanner)return;d.current.privacyBanner=true;let h=window.privacyBanner||void 0;Object.defineProperty(window,"privacyBanner",{configurable:true,get(){return h},set(C){typeof C=="object"&&C!==null&&"showPreferences"in C&&"loadBanner"in C&&(h=kr({privacyBanner:C,config:f}),l.privacyBanner());}});},[t,f,kr,l.privacyBanner]),react.useEffect(()=>{if(d.current.customerPrivacy)return;d.current.customerPrivacy=true;let h=null,A=window.Shopify||void 0;Object.defineProperty(window,"Shopify",{configurable:true,get(){return A},set(C){typeof C=="object"&&C!==null&&Object.keys(C).length===0&&(A=C,Object.defineProperty(window.Shopify,"customerPrivacy",{configurable:true,get(){return h},set(R){if(typeof R=="object"&&R!==null&&"setTrackingConsent"in R){let I=R;h={...I,setTrackingConsent:Lr({customerPrivacy:I,config:f})},A={...A,customerPrivacy:h},l.customerPrivacy();}}}));}});},[f,Lr,l.customerPrivacy]),react.useEffect(()=>{if(!P||!y)return;let h=re();if(h&&!h.cachedConsent){let A=hydrogenReact.getTrackingValues();A.consent&&(h.cachedConsent=A.consent);}if(t){let A=Te();A&&A.loadBanner(f);}hn(),o?.();},[P,y]);let v={customerPrivacy:re()};return t&&(v.privacyBanner=Te()),v}var Ur=false;function hn(){if(Ur)return;Ur=true;let e=new CustomEvent("shopifyCustomerPrivacyApiLoaded");document.dispatchEvent(e);}function An({withPrivacyBanner:e}){let t=react.useRef({customerPrivacy:false,privacyBanner:false}),[r,o]=react.useState(e?[false,false]:[false]),n=r.every(Boolean);return {observing:t,setLoaded:{customerPrivacy:()=>{o(e?s=>[true,s[1]]:()=>[true]);},privacyBanner:()=>{e&&o(s=>[s[0],true]);}},apisLoaded:n}}function Sn(e){if(typeof window>"u")return;let t=window.location.host,r=e.split(".").reverse(),o=t.split(".").reverse(),n=[];return r.forEach((a,s)=>{a===o[s]&&n.push(a);}),n.reverse().join(".")||void 0}function Lr({customerPrivacy:e,config:t}){let r=e.setTrackingConsent,{locale:o,country:n,...a}=t;function s(c,i){r({...a,headlessStorefront:true,...c},i);}return s}function kr({privacyBanner:e,config:t}){let r=e.loadBanner,o=e.showPreferences;function n(s){if(typeof s=="object"){r({...t,...s});return}r(t);}function a(s){if(typeof s=="object"){o({...t,...s});return}o(t);}return {loadBanner:n,showPreferences:a}}function re(){try{return window.Shopify&&window.Shopify.customerPrivacy?window.Shopify?.customerPrivacy:null}catch{return null}}function Te(){try{return window&&window?.privacyBanner?window.privacyBanner:null}catch{return null}}var Nr="2026.1.3";function En(){let e=re();if(!e)throw new Error("Shopify Customer Privacy API not available. Must be used within a useEffect. Make sure to load the Shopify Customer Privacy API with useCustomerPrivacy() or <AnalyticsProvider>.");return e}function Vr({consent:e,onReady:t,domain:r}){let{subscribe:o,register:n,canTrack:a}=Y(),[s,c]=react.useState(false),[i,u]=react.useState(false),[p,y]=react.useState(""),g=react.useRef(false),{checkoutDomain:m,storefrontAccessToken:d,language:l}=e,{ready:P}=n("Internal_Shopify_Analytics");Rt({...e,locale:l,checkoutDomain:m||"mock.shop",storefrontAccessToken:d||"abcdefghijklmnopqrstuvwxyz123456",onReady:()=>!e.withPrivacyBanner&&u(true),onVisitorConsentCollected:v=>{try{y(JSON.stringify(v));}catch{}u(true);}});let f=react.useMemo(()=>i?a():true,[i,a,p]);return hydrogenReact.useShopifyCookies({hasUserConsent:f,domain:r,checkoutDomain:m,fetchTrackingValues:false,ignoreDeprecatedCookies:!i}),react.useEffect(()=>{g.current||(g.current=true,o(F.PAGE_VIEWED,wn),o(F.PRODUCT_VIEWED,Dn),o(F.COLLECTION_VIEWED,xn),o(F.SEARCH_VIEWED,On),o(F.PRODUCT_ADD_TO_CART,_n),c(true));},[o]),react.useEffect(()=>{s&&i&&(P(),t());},[s,i,t]),null}function Je(e){console.error(`[h2:error:ShopifyAnalytics] Unable to send Shopify analytics: Missing shop.${e} configuration.`);}function we(e){let t=En(),r=t.analyticsProcessingAllowed();if(!e?.shop?.shopId){Je("shopId");return}if(!e?.shop?.acceptedLanguage){Je("acceptedLanguage");return}if(!e?.shop?.currency){Je("currency");return}if(!e?.shop?.hydrogenSubchannelId){Je("hydrogenSubchannelId");return}return {shopifySalesChannel:"hydrogen",assetVersionId:Nr,...e.shop,hasUserConsent:r,...hydrogenReact.getClientBrowserParameters(),analyticsAllowed:t.analyticsProcessingAllowed(),marketingAllowed:t.marketingAllowed(),saleOfDataAllowed:t.saleOfDataAllowed(),ccpaEnforced:!t.saleOfDataAllowed(),gdprEnforced:!(t.marketingAllowed()&&t.analyticsProcessingAllowed())}}function bn(e,t){if(t===null)return;let r=we(e);return r?{...r,cartId:t.id}:void 0}var oe={};function wn(e){let t=we(e);t&&(hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PAGE_VIEW_2,payload:{...t,...oe}}),oe={});}function Dn(e){let t=we(e);if(t&&$r({type:"product",products:e.products})){let r=Tt(e.products);oe={pageType:hydrogenReact.AnalyticsPageType.product,resourceId:r[0].productGid},t={...t,...oe,products:Tt(e.products)},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.PRODUCT_VIEW,payload:t});}}function xn(e){let t=we(e);t&&(oe={pageType:hydrogenReact.AnalyticsPageType.collection,resourceId:e.collection.id},t={...t,...oe,collectionHandle:e.collection.handle,collectionId:e.collection.id},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.COLLECTION_VIEW,payload:t}));}function On(e){let t=we(e);t&&(oe={pageType:hydrogenReact.AnalyticsPageType.search},t={...t,...oe,searchString:e.searchTerm},hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.SEARCH_VIEW,payload:t}));}function _n(e){let{cart:t,currentLine:r}=e,o=bn(e,t);!o||!r?.id||Un({matchedLine:r,eventPayload:o});}function Un({matchedLine:e,eventPayload:t}){let r={id:e.merchandise.product.id,variantId:e.merchandise.id,title:e.merchandise.product.title,variantTitle:e.merchandise.title,vendor:e.merchandise.product.vendor,price:e.merchandise.price.amount,quantity:e.quantity,productType:e.merchandise.product.productType,sku:e.merchandise.sku};$r({type:"cart",products:[r]})&&hydrogenReact.sendShopifyAnalytics({eventName:hydrogenReact.AnalyticsEventName.ADD_TO_CART,payload:{...t,products:Tt([r])}});}function ce(e,t,r,o){if(e==="cart"){let n=`${r?"merchandise":"merchandise.product"}.${t}`;console.error(`[h2:error:ShopifyAnalytics] Can't set up cart analytics events because the \`cart.lines[].${n}\` value is missing from your GraphQL cart query. In your project, search for where \`fragment CartLine on CartLine\` is defined and make sure \`${n}\` is part of your cart query. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/lib/fragments.ts#L25-L56.`);}else {let n=`${o||t}`;console.error(`[h2:error:ShopifyAnalytics] Can't set up product view analytics events because the \`${n}\` is missing from your \`<Analytics.ProductView>\`. Make sure \`${n}\` is part of your products data prop. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/routes/products.%24handle.tsx#L159-L165.`);}}function $r({type:e,products:t}){return !t||t.length===0?(ce(e,"",false,"data.products"),false):(t.forEach(r=>{if(!r.id)return ce(e,"id",false),false;if(!r.title)return ce(e,"title",false),false;if(!r.price)return ce(e,"price.amount",true,"price"),false;if(!r.vendor)return ce(e,"vendor",false),false;if(!r.variantId)return ce(e,"id",true,"variantId"),false;if(!r.variantTitle)return ce(e,"title",true,"variantTitle"),false}),true)}function Tt(e){return e.map(t=>{let r={productGid:t.id,variantGid:t.variantId,name:t.title,variantName:t.variantTitle,brand:t.vendor,price:t.price,quantity:t.quantity||1,category:t.productType};return t.sku&&(r.sku=t.sku),t.productType&&(r.category=t.productType),r})}function qr(e){console.error(`[h2:error:CartAnalytics] Can't set up cart analytics events because the \`cart.${e}\` value is missing from your GraphQL cart query. In your project, search for where \`fragment CartApiQuery on Cart\` is defined and make sure \`${e}\` is part of your cart query. Check the Hydrogen Skeleton template for reference: https://github.com/Shopify/hydrogen/blob/main/templates/skeleton/app/lib/fragments.ts#L59.`);}function Gr({cart:e,setCarts:t}){let{publish:r,shop:o,customData:n,canTrack:a,cart:s,prevCart:c}=Y(),i=react.useRef(null);return react.useEffect(()=>{if(e)return Promise.resolve(e).then(u=>{if(u&&u.lines){if(!u.id){qr("id");return}if(!u.updatedAt){qr("updatedAt");return}}t(({cart:p,prevCart:y})=>u?.updatedAt!==p?.updatedAt?{cart:u,prevCart:p}:{cart:p,prevCart:y});}),()=>{}},[t,e]),react.useEffect(()=>{if(!s||!s?.updatedAt||s?.updatedAt===c?.updatedAt)return;let u;try{u=JSON.parse(localStorage.getItem("cartLastUpdatedAt")||"");}catch{u=null;}if(s.id===u?.id&&s.updatedAt===u?.updatedAt)return;let p={eventTimestamp:Date.now(),cart:s,prevCart:c,shop:o,customData:n};if(s.updatedAt===i.current)return;i.current=s.updatedAt,r("cart_updated",p),localStorage.setItem("cartLastUpdatedAt",JSON.stringify({id:s.id,updatedAt:s.updatedAt}));let y=c?.lines?hydrogenReact.flattenConnection(c?.lines):[],g=s.lines?hydrogenReact.flattenConnection(s.lines):[];y?.forEach(m=>{let d=g.filter(l=>m.id===l.id);if(d?.length===1){let l=d[0];m.quantity<l.quantity?r("product_added_to_cart",{...p,prevLine:m,currentLine:l}):m.quantity>l.quantity&&r("product_removed_from_cart",{...p,prevLine:m,currentLine:l});}else r("product_removed_from_cart",{...p,prevLine:m});}),g?.forEach(m=>{let d=y.filter(l=>m.id===l.id);(!d||d.length===0)&&r("product_added_to_cart",{...p,currentLine:m});});},[s,c,r,o,n,a]),null}var $n="https://cdn.shopify.com/shopifycloud/perf-kit/shopify-perf-kit-spa.min.js";function Br({shop:e}){let t=react.useRef(false),{subscribe:r,register:o}=Y(),{ready:n}=o("Internal_Shopify_Perf_Kit"),a=hydrogenReact.useLoadScript($n,{attributes:{id:"perfkit","data-application":"hydrogen","data-shop-id":hydrogenReact.parseGid(e.shopId).id.toString(),"data-storefront-id":e.hydrogenSubchannelId,"data-monorail-region":"global","data-spa-mode":"true","data-resource-timing-sampling-rate":"100"}});return react.useEffect(()=>{a!=="done"||t.current||(t.current=true,r(F.PAGE_VIEWED,()=>{window.PerfKit?.navigate();}),r(F.PRODUCT_VIEWED,()=>{window.PerfKit?.setPageType("product");}),r(F.COLLECTION_VIEWED,()=>{window.PerfKit?.setPageType("collection");}),r(F.SEARCH_VIEWED,()=>{window.PerfKit?.setPageType("search");}),r(F.CART_VIEWED,()=>{window.PerfKit?.setPageType("cart");}),n());},[r,n,a]),null}var Qr=new Set,B=e=>{Qr.has(e)||(console.warn(e),Qr.add(e));},Wr=new Set,bt=e=>{Wr.has(e)||(console.error(new Error(e)),Wr.add(e));};var Bn={canTrack:()=>false,cart:null,customData:{},prevCart:null,publish:()=>{},shop:null,subscribe:()=>{},register:()=>({ready:()=>{}}),customerPrivacy:null,privacyBanner:null},Xr=react.createContext(Bn),Ze=new Map,xe={};function Zr(){return Object.values(xe).every(Boolean)}function jr(e,t){Ze.has(e)||Ze.set(e,new Map),Ze.get(e)?.set(t.toString(),t);}var et=new Map;function Kr(e,t){if(!Zr()){et.set(e,t);return}eo(e,t);}function eo(e,t){(Ze.get(e)??new Map).forEach((r,o)=>{try{r(t);}catch(n){typeof n=="object"&&n instanceof Error?console.error("Analytics publish error",n.message,o,n.stack):console.error("Analytics publish error",n,o);}});}function Yr(e){return xe.hasOwnProperty(e)||(xe[e]=false),{ready:()=>{xe[e]=true,Zr()&&et.size>0&&(et.forEach((t,r)=>{eo(r,t);}),et.clear());}}}function zr(){try{return window.Shopify.customerPrivacy.analyticsProcessingAllowed()}catch{}return false}function Jr(e,t){return `[h2:error:Analytics.Provider] - ${e} is required. Make sure ${t} is defined in your environment variables. See https://h2o.fyi/analytics/consent to learn how to setup environment variables in the Shopify admin.`}function Qn({canTrack:e,cart:t,children:r,consent:o,customData:n={},shop:a=null,cookieDomain:s}){let{shop:c}=Wn(a),[i,u]=react.useState(!!e),[p,y]=react.useState(false),[g,m]=react.useState({cart:null,prevCart:null}),[d,l]=react.useState(e?()=>e:()=>zr);if(c)if(/\/68817551382$/.test(c.shopId))B("[h2:error:Analytics.Provider] - Mock shop is used. Analytics will not work properly.");else {if(!o.checkoutDomain){let f=Jr("consent.checkoutDomain","PUBLIC_CHECKOUT_DOMAIN");bt(f);}if(!o.storefrontAccessToken){let f=Jr("consent.storefrontAccessToken","PUBLIC_STOREFRONT_API_TOKEN");bt(f);}o?.country||(o.country="US"),o?.language||(o.language="EN"),o.withPrivacyBanner===void 0&&(o.withPrivacyBanner=false);}let P=react.useMemo(()=>({canTrack:d,...g,customData:n,publish:d()?Kr:()=>{},shop:c,subscribe:jr,register:Yr,customerPrivacy:re(),privacyBanner:Te()}),[i,d,g,g.cart?.updatedAt,g.prevCart,Kr,jr,n,c,Yr,JSON.stringify(xe),re,Te]);return jsxRuntime.jsxs(Xr.Provider,{value:P,children:[r,!!c&&jsxRuntime.jsx(Rr,{}),!!c&&!!t&&jsxRuntime.jsx(Gr,{cart:t,setCarts:m}),!!c&&jsxRuntime.jsx(Vr,{consent:o,onReady:()=>{u(true),l(e?()=>e:()=>zr),y(true);},domain:s}),!!c&&p&&jsxRuntime.jsx(Br,{shop:c})]})}function Y(){let e=react.useContext(Xr);if(!e)throw new Error("[h2:error:useAnalytics] 'useAnalytics()' must be a descendent of <AnalyticsProvider/>");return e}function Wn(e){let[t,r]=react.useState(null);return react.useEffect(()=>(Promise.resolve(e).then(r),()=>{}),[r,e]),{shop:t}}async function jn({storefront:e,publicStorefrontId:t="0"}){return e.query(Kn,{cache:e.CacheLong()}).then(({shop:r,localization:o})=>({shopId:r.id,acceptedLanguage:o.language.isoCode,currency:o.country.currency.isoCode,hydrogenSubchannelId:t}))}var Kn=`#graphql
|
|
2
2
|
query ShopData(
|
|
3
3
|
$country: CountryCode
|
|
4
4
|
$language: LanguageCode
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
`,Yn={CartView:Er,CollectionView:Tr,CustomView:wr,ProductView:Ir,Provider:Qn,SearchView:br};function W(e,t){return wt(e.headers,t)}function wt(e,t){let r=e?.get?.(t)??e?.[t];return typeof r=="string"?r:null}function ne(e){return {requestId:e?W(e,"request-id"):void 0,purpose:e?W(e,"purpose"):void 0}}function to(e){return {requestGroupId:W(e,"request-id"),buyerIp:W(e,"oxygen-buyer-ip"),buyerIpSig:W(e,Re),cookie:W(e,"cookie"),purpose:W(e,"sec-purpose")||W(e,"purpose")}}var Dt=/^\/api\/(unstable|2\d{3}-\d{2})\/graphql\.json$/,xt=e=>{try{return new URL(e,"http://e.c").pathname}catch{return "/"}};function Ot(e,t){return t.reduce((r,o)=>{let n=e(o);return n&&r.push([o,n]),r},[])}function fe(e,t={}){let r=new Error,o=(n,a="Error")=>{let s=(r.stack??"").split(`
|
|
21
21
|
`).slice(3+(t.stackOffset??0)).join(`
|
|
22
22
|
`).replace(/ at loader(\d+) \(/,(c,i)=>c.replace(i,""));return `${a}: ${n}
|
|
23
|
-
`+s};return e.then(n=>{if(n?.errors&&Array.isArray(n.errors)){let a=typeof t.logErrors=="function"?t.logErrors:()=>t.logErrors??false;n.errors.forEach(s=>{s&&(s.stack=o(s.message,s.name),a(s)&&console.error(s));});}return n}).catch(n=>{throw n&&(n.stack=o(n.message,n.name)),n})}var j=void 0;var tt="public",Jn="private",_t="no-store",ro={maxAge:"max-age",staleWhileRevalidate:"stale-while-revalidate",sMaxAge:"s-maxage",staleIfError:"stale-if-error"};function Oe(e){let t=[];return Object.keys(e).forEach(r=>{r==="mode"?t.push(e[r]):ro[r]&&t.push(`${ro[r]}=${e[r]}`);}),t.join(", ")}function Ut(){return {mode:_t}}function Lt(e){if(e?.mode&&e?.mode!==tt&&e?.mode!==Jn)throw Error("'mode' must be either 'public' or 'private'")}function ue(e){return Lt(e),{mode:tt,maxAge:1,staleWhileRevalidate:9,...e}}function kt(e){return Lt(e),{mode:tt,maxAge:3600,staleWhileRevalidate:82800,...e}}function me(e){return Lt(e),{mode:tt,maxAge:1,staleWhileRevalidate:86399,...e}}function Nt(e){return e}function z(e){return String(e).includes("__proto__")?JSON.parse(e,Xn):JSON.parse(e)}function Xn(e,t){if(e!=="__proto__")return t}function rt(e,t){return e&&t?{...e,...t}:e||me()}function Mt(e){return Oe(rt(e))}async function Zn(e,t){if(!e)return;let r=await e.match(t);if(!r){return}return r}async function ea(e,t,r,o){if(!e)return;let n=rt(o),a=Mt(rt(n,{maxAge:(n.maxAge||0)+(n.staleWhileRevalidate||0)})),s=Mt(rt(n));r.headers.set("cache-control",a),r.headers.set("real-cache-control",s),r.headers.set("cache-put-date",String(Date.now())),await e.put(t,r);}async function ta(e,t){e&&await e.delete(t);}function ra(e,t){let r=e.headers.get("real-cache-control"),o=0;if(r){let a=r.match(/max-age=(\d*)/);a&&a.length>1&&(o=parseFloat(a[1]));}return [(Date.now()-Number(t))/1e3,o]}function oa(e,t){let r=t.headers.get("cache-put-date");if(!r)return false;let[o,n]=ra(t,r),a=o>n;return a}var ot={get:Zn,set:ea,delete:ta,generateDefaultCacheControlHeader:Mt,isStale:oa};function _e(e){return `https://shopify.dev/?${e}`}function na(e){return e||me()}async function oo(e,t){if(!e)return;let r=_e(t),o=new Request(r),n=await ot.get(e,o);if(!n)return;let a=await n.text();try{return [z(a),n]}catch{return [a,n]}}async function no(e,t,r,o){if(!e)return;let n=_e(t),a=new Request(n),s=new Response(JSON.stringify(r));await ot.set(e,a,s,na(o));}function ao(e,t){return ot.isStale(new Request(_e(e)),t)}function so(e){let t=Array.isArray(e)?e:[e],r="";for(let o of t)o!=null&&(typeof o=="object"?r+=JSON.stringify(o):r+=o.toString());return encodeURIComponent(r)}var Vt=new Set;async function nt(e,t,{strategy:r=ue(),cacheInstance:o,shouldCacheResult:n=()=>true,waitUntil:a,debugInfo:s}){let i=so([...typeof e=="string"?[e]:e]),y=f=>{({displayName:f.displayName,url:f.response?.url,responseInit:{status:f.response?.status||0,statusText:f.response?.statusText||"",headers:Array.from(f.response?.headers.entries()||[])}});},m=void 0;if(!o||!r||r.mode===_t){let f=await t({addDebugData:y});return f}let d=f=>no(o,i,{value:f,debugInfo:void 0},r),l=await oo(o,i);if(l&&typeof l[0]!="string"){let[{value:f,debugInfo:v},h]=l;let A=ao(i,h)?"STALE":"HIT";if(!Vt.has(i)&&A==="STALE"){Vt.add(i);let C=Promise.resolve().then(async()=>{let R=Date.now();try{let I=await t({addDebugData:y});n(I)&&(await d(I),m?.({result:I,cacheStatus:"PUT",overrideStartTime:R}));}catch(I){I.message&&(I.message="SWR in sub-request failed: "+I.message),console.error(I);}finally{Vt.delete(i);}});a?.(C);}return f}let P=await t({addDebugData:y});if(n(P)){let f=Promise.resolve().then(async()=>{await d(P);});a?.(f);}return P}var sa=["set-cookie","server-timing"];function io(e,t){return [e,{status:t.status,statusText:t.statusText,headers:[...t.headers].filter(([r])=>!sa.includes(r.toLowerCase()))}]}function co([e,t]){return [e,new Response(e,t)]}async function at(e,t,{cacheInstance:r,cache:o,cacheKey:n=[e,t],shouldCacheResponse:a,waitUntil:s,debugInfo:c,streamConfig:i,onRawHeaders:u}){return !o&&(!t.method||t.method==="GET")&&(o=ue()),nt(n,async()=>{if(i){let g=null,d=await graphqlClient.createGraphQLClient({url:e,customFetchApi:async(f,v)=>(g=await fetch(f,v),u?.(g.headers),g),headers:t.headers}).requestStream(i.query,{variables:i.variables}),l,P;for await(let f of d){let{data:v,errors:h}=f;l=v,P=h?.graphQLErrors??h;}return g?.ok?io({data:l,errors:P},g):g}let p=await fetch(e,t);if(u?.(p.headers),!p.ok)return p;let y=await p.text().catch(()=>"");try{y&&(y=z(y));}catch{}return io(y,p)},{cacheInstance:r,waitUntil:s,strategy:o??null,debugInfo:c,shouldCacheResult:p=>"ok"in p?!1:a(...co(p))}).then(p=>"ok"in p?[null,p]:co(p))}function ia(e){let{cache:t,waitUntil:r,request:o}=e;return {run:({cacheKey:n,cacheStrategy:a,shouldCacheResult:s},c)=>nt(n,c,{shouldCacheResult:s,strategy:a,cacheInstance:t,waitUntil:r,debugInfo:{...ne(o),stackInfo:j?.()}}),fetch:(n,a,s)=>at(n,a??{},{waitUntil:r,cacheKey:[n,a],cacheInstance:t,debugInfo:{url:n,...ne(o),stackInfo:j?.(),displayName:s?.displayName},cache:s.cacheStrategy,...s}).then(([c,i])=>({data:c,response:i}))}}var $t=class{#e;constructor(){this.#e=new Map;}add(t){throw new Error("Method not implemented. Use `put` instead.")}addAll(t){throw new Error("Method not implemented. Use `put` instead.")}matchAll(t,r){throw new Error("Method not implemented. Use `match` instead.")}async put(t,r){if(t.method!=="GET")throw new TypeError("Cannot cache response to non-GET request.");if(r.status===206)throw new TypeError("Cannot cache response to a range request (206 Partial Content).");if(r.headers.get("vary")?.includes("*"))throw new TypeError("Cannot cache response with 'Vary: *' header.");this.#e.set(t.url,{body:new Uint8Array(await r.arrayBuffer()),status:r.status,headers:[...r.headers],timestamp:Date.now()});}async match(t){if(t.method!=="GET")return;let r=this.#e.get(t.url);if(!r)return;let{body:o,timestamp:n,...a}=r,s=new Headers(a.headers),c=s.get("cache-control")||s.get("real-cache-control")||"",i=parseInt(c.match(/max-age=(\d+)/)?.[1]||"0",10),u=parseInt(c.match(/stale-while-revalidate=(\d+)/)?.[1]||"0",10),p=(Date.now()-n)/1e3;if(p>i+u){this.#e.delete(t.url);return}let g=p>i;return s.set("cache",g?"STALE":"HIT"),s.set("date",new Date(n).toUTCString()),new Response(o,{status:a.status??200,headers:s})}async delete(t){return this.#e.has(t.url)?(this.#e.delete(t.url),true):false}keys(t){let r=[];for(let o of this.#e.keys())(!t||t.url===o)&&r.push(new Request(o));return Promise.resolve(r)}};var uo="cartFormInput";function J({children:e,action:t,inputs:r,route:o,fetcherKey:n}){let a=reactRouter.useFetcher({key:n});return jsxRuntime.jsxs(a.Form,{action:o||"",method:"post",children:[(t||r)&&jsxRuntime.jsx("input",{type:"hidden",name:uo,value:JSON.stringify({action:t,inputs:r})}),typeof e=="function"?e(a):e]})}J.INPUT_NAME=uo;J.ACTIONS={AttributesUpdateInput:"AttributesUpdateInput",BuyerIdentityUpdate:"BuyerIdentityUpdate",Create:"Create",DiscountCodesUpdate:"DiscountCodesUpdate",GiftCardCodesUpdate:"GiftCardCodesUpdate",GiftCardCodesAdd:"GiftCardCodesAdd",GiftCardCodesRemove:"GiftCardCodesRemove",LinesAdd:"LinesAdd",LinesRemove:"LinesRemove",LinesUpdate:"LinesUpdate",NoteUpdate:"NoteUpdate",SelectedDeliveryOptionsUpdate:"SelectedDeliveryOptionsUpdate",MetafieldsSet:"MetafieldsSet",MetafieldDelete:"MetafieldDelete",DeliveryAddressesAdd:"DeliveryAddressesAdd",DeliveryAddressesUpdate:"DeliveryAddressesUpdate",DeliveryAddressesRemove:"DeliveryAddressesRemove",DeliveryAddressesReplace:"DeliveryAddressesReplace"};function ua(e){let t={};for(let s of e.entries()){let c=s[0],i=e.getAll(c);t[c]=i.length>1?i:s[1],t[c]==="on"?t[c]=true:t[c]==="off"&&(t[c]=false);}let{cartFormInput:r,...o}=t,{action:n,inputs:a}=r?JSON.parse(String(r)):{};return {action:n,inputs:{...a,...o}}}J.getFormInput=ua;var Ft=e=>{let t=cookie.parse(wt(e,"Cookie")||"");return ()=>t.cart?`gid://shopify/Cart/${t.cart}`:void 0};var Ht=e=>t=>{let r=new Headers;return r.append("Set-Cookie",cookie.stringify("cart",t.split("/").pop()||"",{path:"/",...e})),r};function st(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`weak-${Math.random().toString(16).substring(2)}`}var Ue="2026.1.
|
|
23
|
+
`+s};return e.then(n=>{if(n?.errors&&Array.isArray(n.errors)){let a=typeof t.logErrors=="function"?t.logErrors:()=>t.logErrors??false;n.errors.forEach(s=>{s&&(s.stack=o(s.message,s.name),a(s)&&console.error(s));});}return n}).catch(n=>{throw n&&(n.stack=o(n.message,n.name)),n})}var j=void 0;var tt="public",Jn="private",_t="no-store",ro={maxAge:"max-age",staleWhileRevalidate:"stale-while-revalidate",sMaxAge:"s-maxage",staleIfError:"stale-if-error"};function Oe(e){let t=[];return Object.keys(e).forEach(r=>{r==="mode"?t.push(e[r]):ro[r]&&t.push(`${ro[r]}=${e[r]}`);}),t.join(", ")}function Ut(){return {mode:_t}}function Lt(e){if(e?.mode&&e?.mode!==tt&&e?.mode!==Jn)throw Error("'mode' must be either 'public' or 'private'")}function ue(e){return Lt(e),{mode:tt,maxAge:1,staleWhileRevalidate:9,...e}}function kt(e){return Lt(e),{mode:tt,maxAge:3600,staleWhileRevalidate:82800,...e}}function me(e){return Lt(e),{mode:tt,maxAge:1,staleWhileRevalidate:86399,...e}}function Nt(e){return e}function z(e){return String(e).includes("__proto__")?JSON.parse(e,Xn):JSON.parse(e)}function Xn(e,t){if(e!=="__proto__")return t}function rt(e,t){return e&&t?{...e,...t}:e||me()}function Mt(e){return Oe(rt(e))}async function Zn(e,t){if(!e)return;let r=await e.match(t);if(!r){return}return r}async function ea(e,t,r,o){if(!e)return;let n=rt(o),a=Mt(rt(n,{maxAge:(n.maxAge||0)+(n.staleWhileRevalidate||0)})),s=Mt(rt(n));r.headers.set("cache-control",a),r.headers.set("real-cache-control",s),r.headers.set("cache-put-date",String(Date.now())),await e.put(t,r);}async function ta(e,t){e&&await e.delete(t);}function ra(e,t){let r=e.headers.get("real-cache-control"),o=0;if(r){let a=r.match(/max-age=(\d*)/);a&&a.length>1&&(o=parseFloat(a[1]));}return [(Date.now()-Number(t))/1e3,o]}function oa(e,t){let r=t.headers.get("cache-put-date");if(!r)return false;let[o,n]=ra(t,r),a=o>n;return a}var ot={get:Zn,set:ea,delete:ta,generateDefaultCacheControlHeader:Mt,isStale:oa};function _e(e){return `https://shopify.dev/?${e}`}function na(e){return e||me()}async function oo(e,t){if(!e)return;let r=_e(t),o=new Request(r),n=await ot.get(e,o);if(!n)return;let a=await n.text();try{return [z(a),n]}catch{return [a,n]}}async function no(e,t,r,o){if(!e)return;let n=_e(t),a=new Request(n),s=new Response(JSON.stringify(r));await ot.set(e,a,s,na(o));}function ao(e,t){return ot.isStale(new Request(_e(e)),t)}function so(e){let t=Array.isArray(e)?e:[e],r="";for(let o of t)o!=null&&(typeof o=="object"?r+=JSON.stringify(o):r+=o.toString());return encodeURIComponent(r)}var Vt=new Set;async function nt(e,t,{strategy:r=ue(),cacheInstance:o,shouldCacheResult:n=()=>true,waitUntil:a,debugInfo:s}){let i=so([...typeof e=="string"?[e]:e]),y=f=>{({displayName:f.displayName,url:f.response?.url,responseInit:{status:f.response?.status||0,statusText:f.response?.statusText||"",headers:Array.from(f.response?.headers.entries()||[])}});},m=void 0;if(!o||!r||r.mode===_t){let f=await t({addDebugData:y});return f}let d=f=>no(o,i,{value:f,debugInfo:void 0},r),l=await oo(o,i);if(l&&typeof l[0]!="string"){let[{value:f,debugInfo:v},h]=l;let A=ao(i,h)?"STALE":"HIT";if(!Vt.has(i)&&A==="STALE"){Vt.add(i);let C=Promise.resolve().then(async()=>{let R=Date.now();try{let I=await t({addDebugData:y});n(I)&&(await d(I),m?.({result:I,cacheStatus:"PUT",overrideStartTime:R}));}catch(I){I.message&&(I.message="SWR in sub-request failed: "+I.message),console.error(I);}finally{Vt.delete(i);}});a?.(C);}return f}let P=await t({addDebugData:y});if(n(P)){let f=Promise.resolve().then(async()=>{await d(P);});a?.(f);}return P}var sa=["set-cookie","server-timing"];function io(e,t){return [e,{status:t.status,statusText:t.statusText,headers:[...t.headers].filter(([r])=>!sa.includes(r.toLowerCase()))}]}function co([e,t]){return [e,new Response(e,t)]}async function at(e,t,{cacheInstance:r,cache:o,cacheKey:n=[e,t],shouldCacheResponse:a,waitUntil:s,debugInfo:c,streamConfig:i,onRawHeaders:u}){return !o&&(!t.method||t.method==="GET")&&(o=ue()),nt(n,async()=>{if(i){let g=null,d=await graphqlClient.createGraphQLClient({url:e,customFetchApi:async(f,v)=>(g=await fetch(f,v),u?.(g.headers),g),headers:t.headers}).requestStream(i.query,{variables:i.variables}),l,P;for await(let f of d){let{data:v,errors:h}=f;l=v,P=h?.graphQLErrors??h;}return g?.ok?io({data:l,errors:P},g):g}let p=await fetch(e,t);if(u?.(p.headers),!p.ok)return p;let y=await p.text().catch(()=>"");try{y&&(y=z(y));}catch{}return io(y,p)},{cacheInstance:r,waitUntil:s,strategy:o??null,debugInfo:c,shouldCacheResult:p=>"ok"in p?!1:a(...co(p))}).then(p=>"ok"in p?[null,p]:co(p))}function ia(e){let{cache:t,waitUntil:r,request:o}=e;return {run:({cacheKey:n,cacheStrategy:a,shouldCacheResult:s},c)=>nt(n,c,{shouldCacheResult:s,strategy:a,cacheInstance:t,waitUntil:r,debugInfo:{...ne(o),stackInfo:j?.()}}),fetch:(n,a,s)=>at(n,a??{},{waitUntil:r,cacheKey:[n,a],cacheInstance:t,debugInfo:{url:n,...ne(o),stackInfo:j?.(),displayName:s?.displayName},cache:s.cacheStrategy,...s}).then(([c,i])=>({data:c,response:i}))}}var $t=class{#e;constructor(){this.#e=new Map;}add(t){throw new Error("Method not implemented. Use `put` instead.")}addAll(t){throw new Error("Method not implemented. Use `put` instead.")}matchAll(t,r){throw new Error("Method not implemented. Use `match` instead.")}async put(t,r){if(t.method!=="GET")throw new TypeError("Cannot cache response to non-GET request.");if(r.status===206)throw new TypeError("Cannot cache response to a range request (206 Partial Content).");if(r.headers.get("vary")?.includes("*"))throw new TypeError("Cannot cache response with 'Vary: *' header.");this.#e.set(t.url,{body:new Uint8Array(await r.arrayBuffer()),status:r.status,headers:[...r.headers],timestamp:Date.now()});}async match(t){if(t.method!=="GET")return;let r=this.#e.get(t.url);if(!r)return;let{body:o,timestamp:n,...a}=r,s=new Headers(a.headers),c=s.get("cache-control")||s.get("real-cache-control")||"",i=parseInt(c.match(/max-age=(\d+)/)?.[1]||"0",10),u=parseInt(c.match(/stale-while-revalidate=(\d+)/)?.[1]||"0",10),p=(Date.now()-n)/1e3;if(p>i+u){this.#e.delete(t.url);return}let g=p>i;return s.set("cache",g?"STALE":"HIT"),s.set("date",new Date(n).toUTCString()),new Response(o,{status:a.status??200,headers:s})}async delete(t){return this.#e.has(t.url)?(this.#e.delete(t.url),true):false}keys(t){let r=[];for(let o of this.#e.keys())(!t||t.url===o)&&r.push(new Request(o));return Promise.resolve(r)}};var uo="cartFormInput";function J({children:e,action:t,inputs:r,route:o,fetcherKey:n}){let a=reactRouter.useFetcher({key:n});return jsxRuntime.jsxs(a.Form,{action:o||"",method:"post",children:[(t||r)&&jsxRuntime.jsx("input",{type:"hidden",name:uo,value:JSON.stringify({action:t,inputs:r})}),typeof e=="function"?e(a):e]})}J.INPUT_NAME=uo;J.ACTIONS={AttributesUpdateInput:"AttributesUpdateInput",BuyerIdentityUpdate:"BuyerIdentityUpdate",Create:"Create",DiscountCodesUpdate:"DiscountCodesUpdate",GiftCardCodesUpdate:"GiftCardCodesUpdate",GiftCardCodesAdd:"GiftCardCodesAdd",GiftCardCodesRemove:"GiftCardCodesRemove",LinesAdd:"LinesAdd",LinesRemove:"LinesRemove",LinesUpdate:"LinesUpdate",NoteUpdate:"NoteUpdate",SelectedDeliveryOptionsUpdate:"SelectedDeliveryOptionsUpdate",MetafieldsSet:"MetafieldsSet",MetafieldDelete:"MetafieldDelete",DeliveryAddressesAdd:"DeliveryAddressesAdd",DeliveryAddressesUpdate:"DeliveryAddressesUpdate",DeliveryAddressesRemove:"DeliveryAddressesRemove",DeliveryAddressesReplace:"DeliveryAddressesReplace"};function ua(e){let t={};for(let s of e.entries()){let c=s[0],i=e.getAll(c);t[c]=i.length>1?i:s[1],t[c]==="on"?t[c]=true:t[c]==="off"&&(t[c]=false);}let{cartFormInput:r,...o}=t,{action:n,inputs:a}=r?JSON.parse(String(r)):{};return {action:n,inputs:{...a,...o}}}J.getFormInput=ua;var Ft=e=>{let t=cookie.parse(wt(e,"Cookie")||"");return ()=>t.cart?`gid://shopify/Cart/${t.cart}`:void 0};var Ht=e=>t=>{let r=new Headers;return r.append("Set-Cookie",cookie.stringify("cart",t.split("/").pop()||"",{path:"/",...e})),r};function st(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`weak-${Math.random().toString(16).substring(2)}`}var Ue="2026.1.3";function ge(e){return e.replace(/\s*#.*$/gm,"").replace(/\s+/gm," ").trim()}var fa=/(^|}\s)query[\s({]/im,ma=/(^|}\s)mutation[\s({]/im;function it(e,t){if(!fa.test(e))throw new Error(`[h2:error:${t}] Can only execute queries`)}function ct(e,t){if(!ma.test(e))throw new Error(`[h2:error:${t}] Can only execute mutations`)}var de=class extends Error{locations;path;extensions;constructor(t,r={}){let n=(r.clientOperation?`[h2:error:${r.clientOperation}] `:"")+t+(r.requestId?` - Request ID: ${r.requestId}`:"");super(n),this.name="GraphQLError",this.extensions=r.extensions,this.locations=r.locations,this.path=r.path,this.stack=r.stack||void 0;try{this.cause=JSON.stringify({...typeof r.cause=="object"?r.cause:{},requestId:r.requestId});}catch{r.cause&&(this.cause=r.cause);}}get[Symbol.toStringTag](){return this.name}toString(){let t=`${this.name}: ${this.message}`;if(this.path)try{t+=` | path: ${JSON.stringify(this.path)}`;}catch{}if(this.extensions)try{t+=` | extensions: ${JSON.stringify(this.extensions)}`;}catch{}return t+=`
|
|
24
24
|
`,this.stack&&(t+=`${this.stack.slice(this.stack.indexOf(`
|
|
25
25
|
`)+1)}
|
|
26
26
|
`),t}toJSON(){return {name:"Error",message:""}}};function Le({url:e,response:t,errors:r,type:o,query:n,queryVariables:a,ErrorConstructor:s=Error,client:c="storefront"}){let i=(typeof r=="string"?r:r?.map?.(p=>p.message).join(`
|