@shopify/hydrogen-react 2023.1.7 → 2023.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/dist/browser-dev/CartProvider.mjs.map +1 -1
  2. package/dist/browser-dev/Image.mjs +336 -90
  3. package/dist/browser-dev/Image.mjs.map +1 -1
  4. package/dist/browser-dev/MediaFile.mjs.map +1 -1
  5. package/dist/browser-dev/ModelViewer.mjs.map +1 -1
  6. package/dist/browser-dev/Money.mjs.map +1 -1
  7. package/dist/browser-dev/ProductProvider.mjs +2 -2
  8. package/dist/browser-dev/ProductProvider.mjs.map +1 -1
  9. package/dist/browser-dev/Video.mjs +2 -2
  10. package/dist/browser-dev/Video.mjs.map +1 -1
  11. package/dist/browser-dev/analytics-utils.mjs +1 -1
  12. package/dist/browser-dev/analytics-utils.mjs.map +1 -1
  13. package/dist/browser-dev/index.mjs +2 -3
  14. package/dist/browser-dev/index.mjs.map +1 -1
  15. package/dist/browser-dev/node_modules/@xstate/react/es/useConstant.mjs +2 -2
  16. package/dist/browser-dev/node_modules/@xstate/react/es/useConstant.mjs.map +1 -1
  17. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +2 -2
  18. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs +2 -2
  19. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
  20. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +2 -2
  21. package/dist/browser-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs +2 -2
  22. package/dist/browser-dev/storefront-api-constants.mjs +1 -1
  23. package/dist/browser-dev/storefront-api-constants.mjs.map +1 -1
  24. package/dist/browser-dev/useCartAPIStateMachine.mjs.map +1 -1
  25. package/dist/browser-dev/useCartActions.mjs.map +1 -1
  26. package/dist/browser-prod/CartProvider.mjs.map +1 -1
  27. package/dist/browser-prod/Image.mjs +302 -82
  28. package/dist/browser-prod/Image.mjs.map +1 -1
  29. package/dist/browser-prod/MediaFile.mjs.map +1 -1
  30. package/dist/browser-prod/ModelViewer.mjs.map +1 -1
  31. package/dist/browser-prod/Money.mjs.map +1 -1
  32. package/dist/browser-prod/ProductProvider.mjs +2 -2
  33. package/dist/browser-prod/ProductProvider.mjs.map +1 -1
  34. package/dist/browser-prod/Video.mjs +2 -2
  35. package/dist/browser-prod/Video.mjs.map +1 -1
  36. package/dist/browser-prod/analytics-utils.mjs +1 -1
  37. package/dist/browser-prod/analytics-utils.mjs.map +1 -1
  38. package/dist/browser-prod/index.mjs +2 -3
  39. package/dist/browser-prod/index.mjs.map +1 -1
  40. package/dist/browser-prod/node_modules/@xstate/react/es/useConstant.mjs +2 -2
  41. package/dist/browser-prod/node_modules/@xstate/react/es/useConstant.mjs.map +1 -1
  42. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +2 -2
  43. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs +2 -2
  44. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
  45. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +2 -2
  46. package/dist/browser-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs +2 -2
  47. package/dist/browser-prod/storefront-api-constants.mjs +1 -1
  48. package/dist/browser-prod/storefront-api-constants.mjs.map +1 -1
  49. package/dist/browser-prod/useCartAPIStateMachine.mjs.map +1 -1
  50. package/dist/browser-prod/useCartActions.mjs.map +1 -1
  51. package/dist/node-dev/AddToCartButton.js +4 -4
  52. package/dist/node-dev/AddToCartButton.js.map +1 -1
  53. package/dist/node-dev/BaseButton.js +2 -2
  54. package/dist/node-dev/BaseButton.js.map +1 -1
  55. package/dist/node-dev/BuyNowButton.js +4 -4
  56. package/dist/node-dev/BuyNowButton.js.map +1 -1
  57. package/dist/node-dev/CartCheckoutButton.js +3 -3
  58. package/dist/node-dev/CartCheckoutButton.js.map +1 -1
  59. package/dist/node-dev/CartLineProvider.js +3 -3
  60. package/dist/node-dev/CartLineProvider.js.map +1 -1
  61. package/dist/node-dev/CartLineQuantityAdjustButton.js +2 -2
  62. package/dist/node-dev/CartLineQuantityAdjustButton.js.map +1 -1
  63. package/dist/node-dev/CartProvider.js +20 -20
  64. package/dist/node-dev/CartProvider.js.map +1 -1
  65. package/dist/node-dev/CartProvider.mjs.map +1 -1
  66. package/dist/node-dev/Image.js +350 -87
  67. package/dist/node-dev/Image.js.map +1 -1
  68. package/dist/node-dev/Image.mjs +336 -90
  69. package/dist/node-dev/Image.mjs.map +1 -1
  70. package/dist/node-dev/MediaFile.js.map +1 -1
  71. package/dist/node-dev/MediaFile.mjs.map +1 -1
  72. package/dist/node-dev/ModelViewer.js +4 -4
  73. package/dist/node-dev/ModelViewer.js.map +1 -1
  74. package/dist/node-dev/ModelViewer.mjs.map +1 -1
  75. package/dist/node-dev/Money.js.map +1 -1
  76. package/dist/node-dev/Money.mjs.map +1 -1
  77. package/dist/node-dev/ProductProvider.js +16 -16
  78. package/dist/node-dev/ProductProvider.js.map +1 -1
  79. package/dist/node-dev/ProductProvider.mjs +2 -2
  80. package/dist/node-dev/ProductProvider.mjs.map +1 -1
  81. package/dist/node-dev/ShopifyProvider.js +4 -4
  82. package/dist/node-dev/ShopifyProvider.js.map +1 -1
  83. package/dist/node-dev/Video.js +4 -4
  84. package/dist/node-dev/Video.js.map +1 -1
  85. package/dist/node-dev/Video.mjs +2 -2
  86. package/dist/node-dev/Video.mjs.map +1 -1
  87. package/dist/node-dev/analytics-utils.js +1 -1
  88. package/dist/node-dev/analytics-utils.js.map +1 -1
  89. package/dist/node-dev/analytics-utils.mjs +1 -1
  90. package/dist/node-dev/analytics-utils.mjs.map +1 -1
  91. package/dist/node-dev/cart-hooks.js +2 -2
  92. package/dist/node-dev/cart-hooks.js.map +1 -1
  93. package/dist/node-dev/index.js +1 -2
  94. package/dist/node-dev/index.js.map +1 -1
  95. package/dist/node-dev/index.mjs +2 -3
  96. package/dist/node-dev/index.mjs.map +1 -1
  97. package/dist/node-dev/load-script.js +3 -3
  98. package/dist/node-dev/load-script.js.map +1 -1
  99. package/dist/node-dev/node_modules/@xstate/react/es/fsm.js +6 -6
  100. package/dist/node-dev/node_modules/@xstate/react/es/fsm.js.map +1 -1
  101. package/dist/node-dev/node_modules/@xstate/react/es/useConstant.js +3 -3
  102. package/dist/node-dev/node_modules/@xstate/react/es/useConstant.js.map +1 -1
  103. package/dist/node-dev/node_modules/@xstate/react/es/useConstant.mjs +2 -2
  104. package/dist/node-dev/node_modules/@xstate/react/es/useConstant.mjs.map +1 -1
  105. package/dist/node-dev/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js +2 -2
  106. package/dist/node-dev/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js.map +1 -1
  107. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +3 -3
  108. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -1
  109. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +2 -2
  110. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +2 -2
  111. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js.map +1 -1
  112. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs +2 -2
  113. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
  114. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +6 -6
  115. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -1
  116. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +2 -2
  117. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +2 -2
  118. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js.map +1 -1
  119. package/dist/node-dev/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs +2 -2
  120. package/dist/node-dev/storefront-api-constants.js +1 -1
  121. package/dist/node-dev/storefront-api-constants.js.map +1 -1
  122. package/dist/node-dev/storefront-api-constants.mjs +1 -1
  123. package/dist/node-dev/storefront-api-constants.mjs.map +1 -1
  124. package/dist/node-dev/useCartAPIStateMachine.js +3 -3
  125. package/dist/node-dev/useCartAPIStateMachine.js.map +1 -1
  126. package/dist/node-dev/useCartAPIStateMachine.mjs.map +1 -1
  127. package/dist/node-dev/useCartActions.js +11 -11
  128. package/dist/node-dev/useCartActions.js.map +1 -1
  129. package/dist/node-dev/useCartActions.mjs.map +1 -1
  130. package/dist/node-dev/useMoney.js +5 -5
  131. package/dist/node-dev/useMoney.js.map +1 -1
  132. package/dist/node-dev/useShopifyCookies.js +2 -2
  133. package/dist/node-dev/useShopifyCookies.js.map +1 -1
  134. package/dist/node-prod/AddToCartButton.js +4 -4
  135. package/dist/node-prod/AddToCartButton.js.map +1 -1
  136. package/dist/node-prod/BaseButton.js +2 -2
  137. package/dist/node-prod/BaseButton.js.map +1 -1
  138. package/dist/node-prod/BuyNowButton.js +4 -4
  139. package/dist/node-prod/BuyNowButton.js.map +1 -1
  140. package/dist/node-prod/CartCheckoutButton.js +3 -3
  141. package/dist/node-prod/CartCheckoutButton.js.map +1 -1
  142. package/dist/node-prod/CartLineProvider.js +3 -3
  143. package/dist/node-prod/CartLineProvider.js.map +1 -1
  144. package/dist/node-prod/CartLineQuantityAdjustButton.js +2 -2
  145. package/dist/node-prod/CartLineQuantityAdjustButton.js.map +1 -1
  146. package/dist/node-prod/CartProvider.js +20 -20
  147. package/dist/node-prod/CartProvider.js.map +1 -1
  148. package/dist/node-prod/CartProvider.mjs.map +1 -1
  149. package/dist/node-prod/Image.js +317 -80
  150. package/dist/node-prod/Image.js.map +1 -1
  151. package/dist/node-prod/Image.mjs +302 -82
  152. package/dist/node-prod/Image.mjs.map +1 -1
  153. package/dist/node-prod/MediaFile.js.map +1 -1
  154. package/dist/node-prod/MediaFile.mjs.map +1 -1
  155. package/dist/node-prod/ModelViewer.js +4 -4
  156. package/dist/node-prod/ModelViewer.js.map +1 -1
  157. package/dist/node-prod/ModelViewer.mjs.map +1 -1
  158. package/dist/node-prod/Money.js.map +1 -1
  159. package/dist/node-prod/Money.mjs.map +1 -1
  160. package/dist/node-prod/ProductProvider.js +16 -16
  161. package/dist/node-prod/ProductProvider.js.map +1 -1
  162. package/dist/node-prod/ProductProvider.mjs +2 -2
  163. package/dist/node-prod/ProductProvider.mjs.map +1 -1
  164. package/dist/node-prod/ShopifyProvider.js +4 -4
  165. package/dist/node-prod/ShopifyProvider.js.map +1 -1
  166. package/dist/node-prod/Video.js +4 -4
  167. package/dist/node-prod/Video.js.map +1 -1
  168. package/dist/node-prod/Video.mjs +2 -2
  169. package/dist/node-prod/Video.mjs.map +1 -1
  170. package/dist/node-prod/analytics-utils.js +1 -1
  171. package/dist/node-prod/analytics-utils.js.map +1 -1
  172. package/dist/node-prod/analytics-utils.mjs +1 -1
  173. package/dist/node-prod/analytics-utils.mjs.map +1 -1
  174. package/dist/node-prod/cart-hooks.js +2 -2
  175. package/dist/node-prod/cart-hooks.js.map +1 -1
  176. package/dist/node-prod/index.js +1 -2
  177. package/dist/node-prod/index.js.map +1 -1
  178. package/dist/node-prod/index.mjs +2 -3
  179. package/dist/node-prod/index.mjs.map +1 -1
  180. package/dist/node-prod/load-script.js +3 -3
  181. package/dist/node-prod/load-script.js.map +1 -1
  182. package/dist/node-prod/node_modules/@xstate/react/es/fsm.js +6 -6
  183. package/dist/node-prod/node_modules/@xstate/react/es/fsm.js.map +1 -1
  184. package/dist/node-prod/node_modules/@xstate/react/es/useConstant.js +3 -3
  185. package/dist/node-prod/node_modules/@xstate/react/es/useConstant.js.map +1 -1
  186. package/dist/node-prod/node_modules/@xstate/react/es/useConstant.mjs +2 -2
  187. package/dist/node-prod/node_modules/@xstate/react/es/useConstant.mjs.map +1 -1
  188. package/dist/node-prod/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js +2 -2
  189. package/dist/node-prod/node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js.map +1 -1
  190. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +3 -3
  191. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js.map +1 -1
  192. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.mjs +2 -2
  193. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +2 -2
  194. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js.map +1 -1
  195. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs +2 -2
  196. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.mjs.map +1 -1
  197. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +6 -6
  198. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js.map +1 -1
  199. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.mjs +2 -2
  200. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js +2 -2
  201. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js.map +1 -1
  202. package/dist/node-prod/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.mjs +2 -2
  203. package/dist/node-prod/storefront-api-constants.js +1 -1
  204. package/dist/node-prod/storefront-api-constants.js.map +1 -1
  205. package/dist/node-prod/storefront-api-constants.mjs +1 -1
  206. package/dist/node-prod/storefront-api-constants.mjs.map +1 -1
  207. package/dist/node-prod/useCartAPIStateMachine.js +3 -3
  208. package/dist/node-prod/useCartAPIStateMachine.js.map +1 -1
  209. package/dist/node-prod/useCartAPIStateMachine.mjs.map +1 -1
  210. package/dist/node-prod/useCartActions.js +11 -11
  211. package/dist/node-prod/useCartActions.js.map +1 -1
  212. package/dist/node-prod/useCartActions.mjs.map +1 -1
  213. package/dist/node-prod/useMoney.js +5 -5
  214. package/dist/node-prod/useMoney.js.map +1 -1
  215. package/dist/node-prod/useShopifyCookies.js +2 -2
  216. package/dist/node-prod/useShopifyCookies.js.map +1 -1
  217. package/dist/types/CartProvider.d.ts +4 -2
  218. package/dist/types/Image.d.ts +235 -38
  219. package/dist/types/MediaFile.d.ts +2 -2
  220. package/dist/types/ModelViewer.d.ts +1 -1
  221. package/dist/types/Money.d.ts +1 -1
  222. package/dist/types/ProductProvider.d.ts +8 -4
  223. package/dist/types/Video.d.ts +3 -3
  224. package/dist/types/index.d.cts +1 -2
  225. package/dist/types/index.d.ts +1 -2
  226. package/dist/types/storefront-api-constants.d.ts +1 -1
  227. package/dist/types/storefront-api-types.d.ts +862 -118
  228. package/dist/types/useCartAPIStateMachine.d.ts +2 -2
  229. package/dist/types/useCartActions.d.ts +2 -2
  230. package/dist/umd/hydrogen-react.dev.js +334 -182
  231. package/dist/umd/hydrogen-react.dev.js.map +1 -1
  232. package/dist/umd/hydrogen-react.prod.js +22 -15
  233. package/dist/umd/hydrogen-react.prod.js.map +1 -1
  234. package/package.json +2 -2
  235. package/storefront.schema.json +1 -1
  236. package/dist/browser-dev/CartLinePrice.mjs +0 -21
  237. package/dist/browser-dev/CartLinePrice.mjs.map +0 -1
  238. package/dist/browser-dev/image-size.mjs +0 -80
  239. package/dist/browser-dev/image-size.mjs.map +0 -1
  240. package/dist/browser-prod/CartLinePrice.mjs +0 -18
  241. package/dist/browser-prod/CartLinePrice.mjs.map +0 -1
  242. package/dist/browser-prod/image-size.mjs +0 -80
  243. package/dist/browser-prod/image-size.mjs.map +0 -1
  244. package/dist/node-dev/CartLinePrice.js +0 -21
  245. package/dist/node-dev/CartLinePrice.js.map +0 -1
  246. package/dist/node-dev/CartLinePrice.mjs +0 -21
  247. package/dist/node-dev/CartLinePrice.mjs.map +0 -1
  248. package/dist/node-dev/image-size.js +0 -80
  249. package/dist/node-dev/image-size.js.map +0 -1
  250. package/dist/node-dev/image-size.mjs +0 -80
  251. package/dist/node-dev/image-size.mjs.map +0 -1
  252. package/dist/node-prod/CartLinePrice.js +0 -18
  253. package/dist/node-prod/CartLinePrice.js.map +0 -1
  254. package/dist/node-prod/CartLinePrice.mjs +0 -18
  255. package/dist/node-prod/CartLinePrice.mjs.map +0 -1
  256. package/dist/node-prod/image-size.js +0 -80
  257. package/dist/node-prod/image-size.js.map +0 -1
  258. package/dist/node-prod/image-size.mjs +0 -80
  259. package/dist/node-prod/image-size.mjs.map +0 -1
  260. package/dist/types/CartLinePrice.d.ts +0 -31
  261. package/dist/types/image-size.d.ts +0 -36
@@ -1,4 +1,4 @@
1
- (function(E,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],u):(E=typeof globalThis<"u"?globalThis:E||self,u(E.hydrogenreact={},E.React))})(this,function(E,u){"use strict";function vt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const W=vt(u);/*! *****************************************************************************
1
+ (function(E,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],u):(E=typeof globalThis<"u"?globalThis:E||self,u(E.hydrogenreact={},E.React))})(this,function(E,u){"use strict";function Pt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const V=Pt(u);/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -11,7 +11,7 @@
11
11
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */function ke(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,s=r.call(e),i=[];try{for(;(t===void 0||t-- >0)&&!(n=s.next()).done;)i.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return i}var j;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(j||(j={}));var Ue={type:"xstate.init"};function Se(e){return e===void 0?[]:[].concat(e)}function z(e){return{type:"xstate.assign",assignment:e}}function Ne(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function ce(e){return function(t){return e===t}}function $e(e){return typeof e=="string"?{type:e}:e}function Oe(e,t){return{value:e,context:t,actions:[],changed:!1,matches:ce(e)}}function Ve(e,t,r){var n=t,o=!1;return[e.filter(function(s){if(s.type==="xstate.assign"){o=!0;var i=Object.assign({},n);return typeof s.assignment=="function"?i=s.assignment(n,r):Object.keys(s.assignment).forEach(function(a){i[a]=typeof s.assignment[a]=="function"?s.assignment[a](n,r):s.assignment[a]}),n=i,!1}return!0}),n,o]}function Le(e,t){t===void 0&&(t={});var r=ke(Ve(Se(e.states[e.initial].entry).map(function(i){return Ne(i,t.actions)}),e.context,Ue),2),n=r[0],o=r[1],s={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:ce(e.initial)},transition:function(i,a){var c,y,l=typeof i=="string"?{value:i,context:e.context}:i,d=l.value,p=l.context,m=$e(a),h=e.states[d];if(h.on){var P=Se(h.on[m.type]);try{for(var T=function(b){var Q=typeof Symbol=="function"&&Symbol.iterator,w=Q&&b[Q],Ce=0;if(w)return w.call(b);if(b&&typeof b.length=="number")return{next:function(){return b&&Ce>=b.length&&(b=void 0),{value:b&&b[Ce++],done:!b}}};throw new TypeError(Q?"Object is not iterable.":"Symbol.iterator is not defined.")}(P),k=T.next();!k.done;k=T.next()){var _=k.value;if(_===void 0)return Oe(d,p);var O=typeof _=="string"?{target:_}:_,g=O.target,f=O.actions,S=f===void 0?[]:f,I=O.cond,D=I===void 0?function(){return!0}:I,A=g===void 0,v=g??d,U=e.states[v];if(D(p,m)){var M=ke(Ve((A?Se(S):[].concat(h.exit,S,U.entry).filter(function(b){return b})).map(function(b){return Ne(b,s._options.actions)}),p,m),3),Z=M[0],Ee=M[1],pe=M[2],se=g??d;return{value:se,context:Ee,actions:Z,changed:g!==d||Z.length>0||pe,matches:ce(se)}}}}catch(b){c={error:b}}finally{try{k&&!k.done&&(y=T.return)&&y.call(T)}finally{if(c)throw c.error}}}return Oe(d,p)}};return s}var Me=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function bt(e){var t=e.initialState,r=j.NotStarted,n=new Set,o={_machine:e,send:function(s){r===j.Running&&(t=e.transition(t,s),Me(t,$e(s)),n.forEach(function(i){return i(t)}))},subscribe:function(s){return n.add(s),s(t),{unsubscribe:function(){return n.delete(s)}}},start:function(s){if(s){var i=typeof s=="object"?s:{context:e.config.context,value:s};t={value:i.value,actions:[],context:i.context,matches:ce(i.value)}}else t=e.initialState;return r=j.Running,Me(t,Ue),o},stop:function(){return r=j.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var wt=u.useLayoutEffect,Te={},It={get exports(){return Te},set exports(e){Te=e}},Re={},_e={},Dt={get exports(){return _e},set exports(e){_e=e}},xe={};/**
14
+ ***************************************************************************** */function $e(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),s=[];try{for(;(t===void 0||t-- >0)&&!(n=a.next()).done;)s.push(n.value)}catch(i){o={error:i}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return s}var Z;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Z||(Z={}));var Ne={type:"xstate.init"};function _e(e){return e===void 0?[]:[].concat(e)}function K(e){return{type:"xstate.assign",assignment:e}}function Me(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function fe(e){return function(t){return e===t}}function Ve(e){return typeof e=="string"?{type:e}:e}function Re(e,t){return{value:e,context:t,actions:[],changed:!1,matches:fe(e)}}function Le(e,t,r){var n=t,o=!1;return[e.filter(function(a){if(a.type==="xstate.assign"){o=!0;var s=Object.assign({},n);return typeof a.assignment=="function"?s=a.assignment(n,r):Object.keys(a.assignment).forEach(function(i){s[i]=typeof a.assignment[i]=="function"?a.assignment[i](n,r):a.assignment[i]}),n=s,!1}return!0}),n,o]}function xe(e,t){t===void 0&&(t={});var r=$e(Le(_e(e.states[e.initial].entry).map(function(s){return Me(s,t.actions)}),e.context,Ne),2),n=r[0],o=r[1],a={config:e,_options:t,initialState:{value:e.initial,actions:n,context:o,matches:fe(e.initial)},transition:function(s,i){var c,h,l=typeof s=="string"?{value:s,context:e.context}:s,y=l.value,m=l.context,p=Ve(i),d=e.states[y];if(d.on){var I=_e(d.on[p.type]);try{for(var T=function(b){var J=typeof Symbol=="function"&&Symbol.iterator,k=J&&b[J],Te=0;if(k)return k.call(b);if(b&&typeof b.length=="number")return{next:function(){return b&&Te>=b.length&&(b=void 0),{value:b&&b[Te++],done:!b}}};throw new TypeError(J?"Object is not iterable.":"Symbol.iterator is not defined.")}(I),w=T.next();!w.done;w=T.next()){var A=w.value;if(A===void 0)return Re(y,m);var O=typeof A=="string"?{target:A}:A,g=O.target,f=O.actions,C=f===void 0?[]:f,P=O.cond,D=P===void 0?function(){return!0}:P,_=g===void 0,v=g??y,U=e.states[v];if(D(m,p)){var L=$e(Le((_?_e(C):[].concat(d.exit,C,U.entry).filter(function(b){return b})).map(function(b){return Me(b,a._options.actions)}),m,p),3),q=L[0],re=L[1],ne=L[2],Q=g??y;return{value:Q,context:re,actions:q,changed:g!==y||q.length>0||ne,matches:fe(Q)}}}}catch(b){c={error:b}}finally{try{w&&!w.done&&(h=T.return)&&h.call(T)}finally{if(c)throw c.error}}}return Re(y,m)}};return a}var Fe=function(e,t){return e.actions.forEach(function(r){var n=r.exec;return n&&n(e.context,t)})};function kt(e){var t=e.initialState,r=Z.NotStarted,n=new Set,o={_machine:e,send:function(a){r===Z.Running&&(t=e.transition(t,a),Fe(t,Ve(a)),n.forEach(function(s){return s(t)}))},subscribe:function(a){return n.add(a),a(t),{unsubscribe:function(){return n.delete(a)}}},start:function(a){if(a){var s=typeof a=="object"?a:{context:e.config.context,value:a};t={value:s.value,actions:[],context:s.context,matches:fe(s.value)}}else t=e.initialState;return r=Z.Running,Fe(t,Ne),o},stop:function(){return r=Z.Stopped,n.clear(),o},get state(){return t},get status(){return r}};return o}var Ut=u.useLayoutEffect,Ae={},Ot={get exports(){return Ae},set exports(e){Ae=e}},qe={},ve={},$t={get exports(){return ve},set exports(e){ve=e}},He={};/**
15
15
  * @license React
16
16
  * use-sync-external-store-shim.production.min.js
17
17
  *
@@ -19,7 +19,7 @@
19
19
  *
20
20
  * This source code is licensed under the MIT license found in the
21
21
  * LICENSE file in the root directory of this source tree.
22
- */var J=u;function Pt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:Pt,Ut=J.useState,Nt=J.useEffect,$t=J.useLayoutEffect,Ot=J.useDebugValue;function Vt(e,t){var r=t(),n=Ut({inst:{value:r,getSnapshot:t}}),o=n[0].inst,s=n[1];return $t(function(){o.value=r,o.getSnapshot=t,Ae(o)&&s({inst:o})},[e,r,t]),Nt(function(){return Ae(o)&&s({inst:o}),e(function(){Ae(o)&&s({inst:o})})},[e]),Ot(r),r}function Ae(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!kt(e,r)}catch{return!0}}function Lt(e,t){return t()}var Mt=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Lt:Vt;xe.useSyncExternalStore=J.useSyncExternalStore!==void 0?J.useSyncExternalStore:Mt,function(e){e.exports=xe}(Dt);/**
22
+ */var X=u;function Nt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mt=typeof Object.is=="function"?Object.is:Nt,Vt=X.useState,Rt=X.useEffect,Lt=X.useLayoutEffect,xt=X.useDebugValue;function Ft(e,t){var r=t(),n=Vt({inst:{value:r,getSnapshot:t}}),o=n[0].inst,a=n[1];return Lt(function(){o.value=r,o.getSnapshot=t,be(o)&&a({inst:o})},[e,r,t]),Rt(function(){return be(o)&&a({inst:o}),e(function(){be(o)&&a({inst:o})})},[e]),xt(r),r}function be(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Mt(e,r)}catch{return!0}}function qt(e,t){return t()}var Ht=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qt:Ft;He.useSyncExternalStore=X.useSyncExternalStore!==void 0?X.useSyncExternalStore:Ht,function(e){e.exports=He}($t);/**
23
23
  * @license React
24
24
  * use-sync-external-store-shim/with-selector.production.min.js
25
25
  *
@@ -27,7 +27,7 @@
27
27
  *
28
28
  * This source code is licensed under the MIT license found in the
29
29
  * LICENSE file in the root directory of this source tree.
30
- */var le=u,Rt=_e;function xt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ft=typeof Object.is=="function"?Object.is:xt,qt=Rt.useSyncExternalStore,Bt=le.useRef,Ht=le.useEffect,Yt=le.useMemo,jt=le.useDebugValue;Re.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var s=Bt(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=Yt(function(){function c(m){if(!y){if(y=!0,l=m,m=n(m),o!==void 0&&i.hasValue){var h=i.value;if(o(h,m))return d=h}return d=m}if(h=d,Ft(l,m))return h;var P=n(m);return o!==void 0&&o(h,P)?h:(l=m,d=P)}var y=!1,l,d,p=r===void 0?null:r;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,r,n,o]);var a=qt(e,s[0],s[1]);return Ht(function(){i.hasValue=!0,i.value=a},[a]),jt(a),a},function(e){e.exports=Re}(It);function Gt(e){var t=W.useRef();return t.current||(t.current={v:e()}),t.current.v}var Zt=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return s};function Qt(e){return e}var Wt=function(e){var t;return e.subscribe(function(r){t=r}).unsubscribe(),t};function zt(e,t){var r=u.useRef(),n=Zt(Gt(function(){var a=[],c=bt(Le(e.config,t||e._options)),y=c.send;return c.send=function(l){if(c.status===j.NotStarted){a.push(l);return}y(l),r.current=c.state},[c,a]}),2),o=n[0],s=n[1];wt(function(){t&&(o._machine._options=t)});var i=Kt(o);return u.useEffect(function(){return o.start(r.current),s.forEach(o.send),r.current=o.state,function(){o.stop()}},[]),i}var Jt=function(e,t){return t.changed===!1};function Kt(e){var t=u.useCallback(function(){return Wt(e)},[e]),r=u.useCallback(function(o){var s=e.subscribe(o).unsubscribe;return s},[e]),n=Te.useSyncExternalStoreWithSelector(r,t,t,Qt,Jt);return[n,e.send,e]}function q(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(t=>{if(!(t!=null&&t.node))throw new Error("flattenConnection(): Connection edges must contain nodes");return t.node}):[]}const Xt=e=>`
30
+ */var ye=u,Bt=ve;function Yt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jt=typeof Object.is=="function"?Object.is:Yt,Gt=Bt.useSyncExternalStore,Zt=ye.useRef,Wt=ye.useEffect,Qt=ye.useMemo,Jt=ye.useDebugValue;qe.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var a=Zt(null);if(a.current===null){var s={hasValue:!1,value:null};a.current=s}else s=a.current;a=Qt(function(){function c(p){if(!h){if(h=!0,l=p,p=n(p),o!==void 0&&s.hasValue){var d=s.value;if(o(d,p))return y=d}return y=p}if(d=y,jt(l,p))return d;var I=n(p);return o!==void 0&&o(d,I)?d:(l=p,y=I)}var h=!1,l,y,m=r===void 0?null:r;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,r,n,o]);var i=Gt(e,a[0],a[1]);return Wt(function(){s.hasValue=!0,s.value=i},[i]),Jt(i),i},function(e){e.exports=qe}(Ot);function Kt(e){var t=V.useRef();return t.current||(t.current={v:e()}),t.current.v}var Xt=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],s;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(i){s={error:i}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a};function zt(e){return e}var er=function(e){var t;return e.subscribe(function(r){t=r}).unsubscribe(),t};function tr(e,t){var r=u.useRef(),n=Xt(Kt(function(){var i=[],c=kt(xe(e.config,t||e._options)),h=c.send;return c.send=function(l){if(c.status===Z.NotStarted){i.push(l);return}h(l),r.current=c.state},[c,i]}),2),o=n[0],a=n[1];Ut(function(){t&&(o._machine._options=t)});var s=nr(o);return u.useEffect(function(){return o.start(r.current),a.forEach(o.send),r.current=o.state,function(){o.stop()}},[]),s}var rr=function(e,t){return t.changed===!1};function nr(e){var t=u.useCallback(function(){return er(e)},[e]),r=u.useCallback(function(o){var a=e.subscribe(o).unsubscribe;return a},[e]),n=Ae.useSyncExternalStoreWithSelector(r,t,t,zt,rr);return[n,e.send,e]}function B(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(t=>{if(!(t!=null&&t.node))throw new Error("flattenConnection(): Connection edges must contain nodes");return t.node}):[]}const or=e=>`
31
31
  mutation CartLineAdd(
32
32
  $cartId: ID!
33
33
  $lines: [CartLineInput!]!
@@ -42,7 +42,7 @@
42
42
  }
43
43
 
44
44
  ${e}
45
- `,er=e=>`
45
+ `,ir=e=>`
46
46
  mutation CartCreate(
47
47
  $input: CartInput!
48
48
  $numCartLines: Int = 250
@@ -56,7 +56,7 @@
56
56
  }
57
57
 
58
58
  ${e}
59
- `,tr=e=>`
59
+ `,ar=e=>`
60
60
  mutation CartLineRemove(
61
61
  $cartId: ID!
62
62
  $lines: [ID!]!
@@ -71,7 +71,7 @@
71
71
  }
72
72
 
73
73
  ${e}
74
- `,rr=e=>`
74
+ `,sr=e=>`
75
75
  mutation CartLineUpdate(
76
76
  $cartId: ID!
77
77
  $lines: [CartLineUpdateInput!]!
@@ -86,7 +86,7 @@
86
86
  }
87
87
 
88
88
  ${e}
89
- `,nr=e=>`
89
+ `,ur=e=>`
90
90
  mutation CartNoteUpdate(
91
91
  $cartId: ID!
92
92
  $note: String
@@ -101,7 +101,7 @@
101
101
  }
102
102
 
103
103
  ${e}
104
- `,or=e=>`
104
+ `,cr=e=>`
105
105
  mutation CartBuyerIdentityUpdate(
106
106
  $cartId: ID!
107
107
  $buyerIdentity: CartBuyerIdentityInput!
@@ -116,7 +116,7 @@
116
116
  }
117
117
 
118
118
  ${e}
119
- `,ar=e=>`
119
+ `,lr=e=>`
120
120
  mutation CartAttributesUpdate(
121
121
  $attributes: [AttributeInput!]!
122
122
  $cartId: ID!
@@ -131,7 +131,7 @@
131
131
  }
132
132
 
133
133
  ${e}
134
- `,ir=e=>`
134
+ `,dr=e=>`
135
135
  mutation CartDiscountCodesUpdate(
136
136
  $cartId: ID!
137
137
  $discountCodes: [String!]
@@ -146,7 +146,7 @@
146
146
  }
147
147
 
148
148
  ${e}
149
- `,sr=e=>`
149
+ `,fr=e=>`
150
150
  query CartQuery(
151
151
  $id: ID!
152
152
  $numCartLines: Int = 250
@@ -158,7 +158,7 @@
158
158
  }
159
159
 
160
160
  ${e}
161
- `,ur=`
161
+ `,yr=`
162
162
  fragment CartFragment on Cart {
163
163
  id
164
164
  checkoutUrl
@@ -258,7 +258,14 @@
258
258
  width
259
259
  height
260
260
  }
261
- `,te="2023-01";function cr(e){const{storeDomain:t,privateStorefrontToken:r,publicStorefrontToken:n,storefrontApiVersion:o,contentType:s}=e;return o!==te&&lr(`StorefrontClient: The Storefront API version that you're using is different than the version this build of Hydrogen React is targeting. You may run into unexpected errors if these versions don't match. Received verion: "${o}"; expected version "${te}"`),{getShopifyDomain(i){return(i==null?void 0:i.storeDomain)??t},getStorefrontApiUrl(i){const a=(i==null?void 0:i.storeDomain)??t;return`${a}${a.endsWith("/")?"":"/"}api/${(i==null?void 0:i.storefrontApiVersion)??o}/graphql.json`},getPrivateTokenHeaders(i){if(!r&&!(i!=null&&i.privateStorefrontToken))throw new Error("StorefrontClient: You did not pass in a 'privateStorefrontToken' while using 'getPrivateTokenHeaders()'");return{"content-type":((i==null?void 0:i.contentType)??s)==="graphql"?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":o,"Shopify-Storefront-Private-Token":(i==null?void 0:i.privateStorefrontToken)??r??"",...i!=null&&i.buyerIp?{"Shopify-Storefront-Buyer-IP":i.buyerIp}:{}}},getPublicTokenHeaders(i){if(!n&&!(i!=null&&i.publicStorefrontToken))throw new Error("StorefrontClient: You did not pass in a 'publicStorefrontToken' while using 'getPublicTokenHeaders()'");const a=(i==null?void 0:i.contentType)??s??"json";return Fe(a,o,(i==null?void 0:i.publicStorefrontToken)??n??"")}}}function Fe(e,t,r){return{"content-type":e==="graphql"?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":t,"X-Shopify-Storefront-Access-Token":r}}const qe=new Set,lr=e=>{qe.has(e)||(console.warn(e),qe.add(e))},Be={storeDomain:"test",storefrontToken:"abc123",storefrontApiVersion:te,countryIsoCode:"US",languageIsoCode:"EN",getStorefrontApiUrl(){return""},getPublicTokenHeaders(){return{}},getShopifyDomain(){return""}},He=u.createContext(Be);function dr({children:e,...t}){if(!t.countryIsoCode||!t.languageIsoCode||!t.storeDomain||!t.storefrontToken||!t.storefrontApiVersion)throw new Error("Please provide the necessary props to '<ShopifyProvider/>'");t.storefrontApiVersion!==te&&console.warn(`<ShopifyProvider/>: This version of Hydrogen React is built for Shopify's Storefront API version ${te}, 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 r=u.useMemo(()=>{function n(o){return(o==null?void 0:o.storeDomain)??t.storeDomain}return{...t,getPublicTokenHeaders(o){return Fe(o.contentType,t.storefrontApiVersion,o.storefrontToken??t.storefrontToken)},getShopifyDomain:n,getStorefrontApiUrl(o){const s=n({storeDomain:(o==null?void 0:o.storeDomain)??t.storeDomain});return`${s}${s.endsWith("/")?"":"/"}api/${(o==null?void 0:o.storefrontApiVersion)??t.storefrontApiVersion}/graphql.json`}}},[t]);return u.createElement(He.Provider,{value:r},e)}function de(){const e=u.useContext(He);if(!e)throw new Error("'useShop()' must be a descendent of <ShopifyProvider/>");return e}const ve="shopifyCartId",Ye="Shopify-Storefront-Id",je="Shopify-Storefront-Y",Ge="Shopify-Storefront-S",B="_shopify_y",H="_shopify_s";var fr=new Set(["domain","path","max-age","expires","samesite","secure","httponly"]);function yr(e){let t={},r,n,o=0,s=e.split(/;\s*/g),i,a;for(;o<s.length;o++)if(n=s[o],r=n.indexOf("="),~r){if(i=n.substring(0,r++).trim(),a=n.substring(r).trim(),a[0]==='"'&&(a=a.substring(1,a.length-1)),~a.indexOf("%"))try{a=decodeURIComponent(a)}catch{}fr.has(n=i.toLowerCase())?n==="expires"?t.expires=new Date(a):n==="max-age"?t.maxage=+a:t[n]=a:t[i]=a}else(i=n.trim().toLowerCase())&&(i==="httponly"||i==="secure")&&(t[i]=!0);return t}function hr(e,t,r={}){let n=e+"="+encodeURIComponent(t);return r.expires&&(n+="; Expires="+new Date(r.expires).toUTCString()),r.maxage!=null&&r.maxage>=0&&(n+="; Max-Age="+(r.maxage|0)),r.domain&&(n+="; Domain="+r.domain),r.path&&(n+="; Path="+r.path),r.samesite&&(n+="; SameSite="+r.samesite),(r.secure||r.samesite==="None")&&(n+="; Secure"),r.httponly&&(n+="; HttpOnly"),n}const Ze="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function fe(){let e="";try{const t=window.crypto,r=new Uint16Array(31);t.getRandomValues(r);let n=0;e=Ze.replace(/[x]/g,o=>{const s=r[n]%16,i=o==="x"?s:s&3|8;return n++,i.toString(16)}).toUpperCase()}catch{e=Ze.replace(/[x]/g,r=>{const n=Math.random()*16|0;return(r==="x"?n:n&3|8).toString(16)}).toUpperCase()}return`${gr()}-${e}`}function gr(){let e=0,t=0;e=new Date().getTime()>>>0;try{t=performance.now()>>>0}catch{t=0}const r=Math.abs(e+t).toString(16).toLowerCase();return r.padStart(8-r.length,"0")}function ye(e){const t=yr(e);return{[B]:t[B]||"",[H]:t[H]||""}}function mr(){const{storefrontId:e,getPublicTokenHeaders:t,getStorefrontApiUrl:r}=de();return u.useCallback(({query:n,variables:o})=>{const s=t({contentType:"json"});e&&(s[Ye]=e);const i=ye(document.cookie);return s[je]=i[B],s[Ge]=i[H],fetch(r(),{method:"POST",headers:s,body:JSON.stringify({query:n.toString(),variables:o})}).then(a=>a.json()).catch(a=>({data:void 0,errors:a==null?void 0:a.toString()}))},[t,e,r])}function Er({numCartLines:e,cartFragment:t,countryCode:r="US"}){const n=mr(),o=u.useCallback(m=>n({query:sr(t),variables:{id:m,numCartLines:e,country:r}}),[n,t,e,r]),s=u.useCallback(m=>n({query:er(t),variables:{input:m,numCartLines:e,country:r}}),[t,r,n,e]),i=u.useCallback((m,h)=>n({query:Xt(t),variables:{cartId:m,lines:h,numCartLines:e,country:r}}),[t,r,n,e]),a=u.useCallback((m,h)=>n({query:rr(t),variables:{cartId:m,lines:h,numCartLines:e,country:r}}),[t,r,n,e]),c=u.useCallback((m,h)=>n({query:tr(t),variables:{cartId:m,lines:h,numCartLines:e,country:r}}),[t,r,n,e]),y=u.useCallback((m,h)=>n({query:nr(t),variables:{cartId:m,note:h,numCartLines:e,country:r}}),[n,t,e,r]),l=u.useCallback((m,h)=>n({query:or(t),variables:{cartId:m,buyerIdentity:h,numCartLines:e,country:r}}),[t,r,n,e]),d=u.useCallback((m,h)=>n({query:ar(t),variables:{cartId:m,attributes:h,numCartLines:e,country:r}}),[t,r,n,e]),p=u.useCallback((m,h)=>n({query:ir(t),variables:{cartId:m,discountCodes:h,numCartLines:e,country:r}}),[t,r,n,e]);return u.useMemo(()=>({cartFetch:o,cartCreate:s,cartLineAdd:i,cartLineUpdate:a,cartLineRemove:c,noteUpdate:y,buyerIdentityUpdate:l,cartAttributesUpdate:d,discountCodesUpdate:p,cartFragment:t}),[o,s,i,a,c,y,l,d,p,t])}function R(e,t){return{entry:[...(t==null?void 0:t.entryActions)||[],z({lastValidCart:r=>r==null?void 0:r.cart}),"onCartActionEntry","onCartActionOptimisticUI",e],on:{RESOLVE:{target:(t==null?void 0:t.resolveTarget)||"idle",actions:[z({prevCart:r=>r==null?void 0:r.lastValidCart,cart:(r,n)=>{var o;return(o=n==null?void 0:n.payload)==null?void 0:o.cart},rawCartResult:(r,n)=>{var o;return(o=n==null?void 0:n.payload)==null?void 0:o.rawCartResult},errors:r=>{}})]},ERROR:{target:(t==null?void 0:t.errorTarget)||"error",actions:[z({prevCart:r=>r==null?void 0:r.lastValidCart,cart:r=>r==null?void 0:r.lastValidCart,errors:(r,n)=>{var o;return(o=n==null?void 0:n.payload)==null?void 0:o.errors}})]},CART_COMPLETED:{target:"cartCompleted",actions:z({prevCart:r=>{},cart:r=>{},lastValidCart:r=>{},rawCartResult:r=>{},errors:r=>{}})}},exit:["onCartActionComplete",...(t==null?void 0:t.exitActions)||[]]}}const re={CART_FETCH:{target:"cartFetching"},CART_CREATE:{target:"cartCreating"},CART_SET:{target:"idle",actions:[z({rawCartResult:(e,t)=>t.payload.cart,cart:(e,t)=>be(t.payload.cart)})]}},Qe={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 pr(e){return Le({id:"Cart",initial:e?"idle":"uninitialized",context:{cart:e&&be(e)},states:{uninitialized:{on:re},cartCompleted:{on:re},initializationError:{on:re},idle:{on:{...re,...Qe}},error:{on:{...re,...Qe}},cartFetching:R("cartFetchAction",{errorTarget:"initializationError"}),cartCreating:R("cartCreateAction",{errorTarget:"initializationError"}),cartLineRemoving:R("cartLineRemoveAction"),cartLineUpdating:R("cartLineUpdateAction"),cartLineAdding:R("cartLineAddAction"),noteUpdating:R("noteUpdateAction"),buyerIdentityUpdating:R("buyerIdentityUpdateAction"),cartAttributesUpdating:R("cartAttributesUpdateAction"),discountCodesUpdating:R("discountCodesUpdateAction")}})}function Cr({numCartLines:e,onCartActionEntry:t,onCartActionOptimisticUI:r,onCartActionComplete:n,data:o,cartFragment:s,countryCode:i}){const{cartFetch:a,cartCreate:c,cartLineAdd:y,cartLineUpdate:l,cartLineRemove:d,noteUpdate:p,buyerIdentityUpdate:m,cartAttributesUpdate:h,discountCodesUpdate:P}=Er({numCartLines:e,cartFragment:s,countryCode:i}),T=u.useMemo(()=>pr(o),[o]),[k,_,O]=zt(T,{actions:{cartFetchAction:async(g,f)=>{var A;if(f.type!=="CART_FETCH")return;const{data:S,errors:I}=await a((A=f==null?void 0:f.payload)==null?void 0:A.cartId),D=x(f,S==null?void 0:S.cart,I);_(D)},cartCreateAction:async(g,f)=>{var A;if(f.type!=="CART_CREATE")return;const{data:S,errors:I}=await c(f==null?void 0:f.payload),D=x(f,(A=S==null?void 0:S.cartCreate)==null?void 0:A.cart,I);_(D)},cartLineAddAction:async(g,f)=>{var A,v;if(f.type!=="CARTLINE_ADD"||!((A=g==null?void 0:g.cart)!=null&&A.id))return;const{data:S,errors:I}=await y(g.cart.id,f.payload.lines),D=x(f,(v=S==null?void 0:S.cartLinesAdd)==null?void 0:v.cart,I);_(D)},cartLineUpdateAction:async(g,f)=>{var A,v;if(f.type!=="CARTLINE_UPDATE"||!((A=g==null?void 0:g.cart)!=null&&A.id))return;const{data:S,errors:I}=await l(g.cart.id,f.payload.lines),D=x(f,(v=S==null?void 0:S.cartLinesUpdate)==null?void 0:v.cart,I);_(D)},cartLineRemoveAction:async(g,f)=>{var A,v;if(f.type!=="CARTLINE_REMOVE"||!((A=g==null?void 0:g.cart)!=null&&A.id))return;const{data:S,errors:I}=await d(g.cart.id,f.payload.lines),D=x(f,(v=S==null?void 0:S.cartLinesRemove)==null?void 0:v.cart,I);_(D)},noteUpdateAction:async(g,f)=>{var A,v;if(f.type!=="NOTE_UPDATE"||!((A=g==null?void 0:g.cart)!=null&&A.id))return;const{data:S,errors:I}=await p(g.cart.id,f.payload.note),D=x(f,(v=S==null?void 0:S.cartNoteUpdate)==null?void 0:v.cart,I);_(D)},buyerIdentityUpdateAction:async(g,f)=>{var A,v;if(f.type!=="BUYER_IDENTITY_UPDATE"||!((A=g==null?void 0:g.cart)!=null&&A.id))return;const{data:S,errors:I}=await m(g.cart.id,f.payload.buyerIdentity),D=x(f,(v=S==null?void 0:S.cartBuyerIdentityUpdate)==null?void 0:v.cart,I);_(D)},cartAttributesUpdateAction:async(g,f)=>{var A,v;if(f.type!=="CART_ATTRIBUTES_UPDATE"||!((A=g==null?void 0:g.cart)!=null&&A.id))return;const{data:S,errors:I}=await h(g.cart.id,f.payload.attributes),D=x(f,(v=S==null?void 0:S.cartAttributesUpdate)==null?void 0:v.cart,I);_(D)},discountCodesUpdateAction:async(g,f)=>{var A,v;if(f.type!=="DISCOUNT_CODES_UPDATE"||!((A=g==null?void 0:g.cart)!=null&&A.id))return;const{data:S,errors:I}=await P(g.cart.id,f.payload.discountCodes),D=x(f,(v=S==null?void 0:S.cartDiscountCodesUpdate)==null?void 0:v.cart,I);_(D)},...t&&{onCartActionEntry:(g,f)=>{Sr(f)&&t(g,f)}},...r&&{onCartActionOptimisticUI:z((g,f)=>r(g,f))},...n&&{onCartActionComplete:(g,f)=>{Tr(f)&&n(g,f)}}}});return u.useMemo(()=>[k,_,O],[k,_,O])}function be(e){return{...e,lines:q(e==null?void 0:e.lines),note:e.note??void 0}}function x(e,t,r){return r?{type:"ERROR",payload:{errors:r,cartActionEvent:e}}:t?{type:"RESOLVE",payload:{cart:be(t),rawCartResult:t,cartActionEvent:e}}:{type:"CART_COMPLETED",payload:{cartActionEvent:e}}}function Sr(e){return e.type==="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"}function Tr(e){return e.type==="RESOLVE"||e.type==="ERROR"||e.type==="CART_COMPLETED"}const We=u.createContext(null);function K(){const e=u.useContext(We);if(!e)throw new Error("Expected a Cart Context, but no Cart Context was found");return e}function _r({children:e,numCartLines:t,onCreate:r,onLineAdd:n,onLineRemove:o,onLineUpdate:s,onNoteUpdate:i,onBuyerIdentityUpdate:a,onAttributesUpdate:c,onDiscountCodesUpdate:y,onCreateComplete:l,onLineAddComplete:d,onLineRemoveComplete:p,onLineUpdateComplete:m,onNoteUpdateComplete:h,onBuyerIdentityUpdateComplete:P,onAttributesUpdateComplete:T,onDiscountCodesUpdateComplete:k,data:_,cartFragment:O=ur,customerAccessToken:g,countryCode:f="US"}){var Et,pt,Ct,St,Tt,_t,At;f&&(f=f.toUpperCase());const[S,I]=u.useState(f),[D,A]=u.useState(g),v=u.useRef(!1);(S!==f||D!==g)&&(I(f),A(g),v.current=!1);const[U,M]=Cr({numCartLines:t,data:_,cartFragment:O,countryCode:f,onCartActionEntry(C,N){try{switch(N.type){case"CART_CREATE":return r==null?void 0:r();case"CARTLINE_ADD":return n==null?void 0:n();case"CARTLINE_REMOVE":return o==null?void 0:o();case"CARTLINE_UPDATE":return s==null?void 0:s();case"NOTE_UPDATE":return i==null?void 0:i();case"BUYER_IDENTITY_UPDATE":return a==null?void 0:a();case"CART_ATTRIBUTES_UPDATE":return c==null?void 0:c();case"DISCOUNT_CODES_UPDATE":return y==null?void 0:y()}}catch(V){console.error("Cart entry action failed",V)}},onCartActionOptimisticUI(C,N){var V,F,$,ue;if(!C.cart)return{...C};switch(N.type){case"CARTLINE_REMOVE":return{...C,cart:{...C.cart,lines:(F=(V=C==null?void 0:C.cart)==null?void 0:V.lines)==null?void 0:F.filter(L=>(L==null?void 0:L.id)&&!N.payload.lines.includes(L==null?void 0:L.id))}};case"CARTLINE_UPDATE":return{...C,cart:{...C.cart,lines:(ue=($=C==null?void 0:C.cart)==null?void 0:$.lines)==null?void 0:ue.map(L=>{const Pe=N.payload.lines.find(({id:_n})=>_n===(L==null?void 0:L.id));return Pe&&Pe.quantity?{...L,quantity:Pe.quantity}:L})}}}return{...C}},onCartActionComplete(C,N){const V=N.payload.cartActionEvent;try{switch(N.type){case"RESOLVE":switch(V.type){case"CART_CREATE":return l==null?void 0:l();case"CARTLINE_ADD":return d==null?void 0:d();case"CARTLINE_REMOVE":return p==null?void 0:p();case"CARTLINE_UPDATE":return m==null?void 0:m();case"NOTE_UPDATE":return h==null?void 0:h();case"BUYER_IDENTITY_UPDATE":return br(C,V)&&(v.current=!0),P==null?void 0:P();case"CART_ATTRIBUTES_UPDATE":return T==null?void 0:T();case"DISCOUNT_CODES_UPDATE":return k==null?void 0:k()}}}catch(F){console.error("onCartActionComplete failed",F)}}}),Z=u.useRef(!1),Ee=U.matches("cartCompleted"),pe=(U.value==="idle"||U.value==="error"||U.value==="cartCompleted")&&f!==((Ct=(pt=(Et=U==null?void 0:U.context)==null?void 0:Et.cart)==null?void 0:pt.buyerIdentity)==null?void 0:Ct.countryCode)&&!U.context.errors,se=u.useRef(!1);u.useEffect(()=>{if(!Z.current&&!se.current){if(!_&&we("localStorage")){se.current=!0;try{const C=window.localStorage.getItem(ve);C&&M({type:"CART_FETCH",payload:{cartId:C}})}catch(C){console.warn("error fetching cartId"),console.warn(C)}}Z.current=!0}},[_,Z,M]),u.useEffect(()=>{!pe||v.current||M({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:{countryCode:f,customerAccessToken:g}}})},[f,g,pe,v,M]);const b=u.useCallback(C=>{if(!Z.current)return console.warn("Cart isn't ready yet");M(C)},[M]);u.useEffect(()=>{var C,N,V;if((N=(C=U==null?void 0:U.context)==null?void 0:C.cart)!=null&&N.id&&we("localStorage"))try{window.localStorage.setItem(ve,(V=U.context.cart)==null?void 0:V.id)}catch(F){console.warn("Failed to save cartId to localStorage",F)}},[(Tt=(St=U==null?void 0:U.context)==null?void 0:St.cart)==null?void 0:Tt.id]),u.useEffect(()=>{if(Ee&&we("localStorage"))try{window.localStorage.removeItem(ve)}catch(C){console.warn("Failed to delete cartId from localStorage",C)}},[Ee]);const Q=u.useCallback(C=>{var N,V;f&&!((N=C.buyerIdentity)!=null&&N.countryCode)&&(C.buyerIdentity==null&&(C.buyerIdentity={}),C.buyerIdentity.countryCode=f),g&&!((V=C.buyerIdentity)!=null&&V.customerAccessToken)&&(C.buyerIdentity==null&&(C.buyerIdentity={}),C.buyerIdentity.customerAccessToken=g),b({type:"CART_CREATE",payload:C})},[f,g,b]),w=vr(U),Ce=u.useMemo(()=>{var C,N,V,F;return{...((C=w==null?void 0:w.context)==null?void 0:C.cart)??{lines:[],attributes:[]},status:Ar(w.value),error:(N=w==null?void 0:w.context)==null?void 0:N.errors,totalQuantity:((F=(V=w==null?void 0:w.context)==null?void 0:V.cart)==null?void 0:F.totalQuantity)??0,cartCreate:Q,linesAdd($){var ue,L;(L=(ue=w==null?void 0:w.context)==null?void 0:ue.cart)!=null&&L.id?b({type:"CARTLINE_ADD",payload:{lines:$}}):Q({lines:$})},linesRemove($){b({type:"CARTLINE_REMOVE",payload:{lines:$}})},linesUpdate($){b({type:"CARTLINE_UPDATE",payload:{lines:$}})},noteUpdate($){b({type:"NOTE_UPDATE",payload:{note:$}})},buyerIdentityUpdate($){b({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:$}})},cartAttributesUpdate($){b({type:"CART_ATTRIBUTES_UPDATE",payload:{attributes:$}})},discountCodesUpdate($){b({type:"DISCOUNT_CODES_UPDATE",payload:{discountCodes:$}})},cartFragment:O}},[Q,(_t=w==null?void 0:w.context)==null?void 0:_t.cart,(At=w==null?void 0:w.context)==null?void 0:At.errors,w.value,O,b]);return u.createElement(We.Provider,{value:Ce},e)}function Ar(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 vr(e){const[t,r]=u.useTransition(),[n,o]=u.useState(e),s=u.useRef(!1);t&&(s.current=!0);const i=u.useRef(!1);return!t&&s.current&&(i.current=!0),u.useEffect(()=>{r(()=>{i.current||o(e)})},[e]),i.current?e:n}function we(e){let t;try{t=window[e];const r="__storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(r){return!!(r instanceof DOMException&&(r.code===22||r.code===1014||r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0)}}function br(e,t){var r,n;return!!(t.payload.buyerIdentity.countryCode&&((n=(r=e.cart)==null?void 0:r.buyerIdentity)==null?void 0:n.countryCode)!==t.payload.buyerIdentity.countryCode)}const ze=u.createContext(null);function wr({children:e,data:t,initialVariantId:r}){const n=u.useMemo(()=>q(t.variants??{}),[t.variants]);if(!Dr(n))throw new Error("<ProductProvider/> requires 'product.variants.nodes' or 'product.variants.edges'");const o=u.useMemo(()=>Ir(n),[n]),[s,i]=u.useState(()=>Xe(r,n)),[a,c]=u.useState(()=>et(s));u.useEffect(()=>{const T=Xe(r,n);i(T),c(et(T))},[r,n]);const y=u.useCallback((T,k)=>{c(_=>{const O={..._,[T]:k};return i(Ke(n,O)),O})},[c,n]),l=u.useCallback((T,k)=>{const _=Ke(n,{...a,[T]:k});return(_==null?void 0:_.availableForSale)??!0},[a,n]),d=u.useMemo(()=>q(t.sellingPlanGroups??{}).map(T=>({...T,sellingPlans:q((T==null?void 0:T.sellingPlans)??{})})),[t.sellingPlanGroups]),[p,m]=u.useState(void 0),h=u.useMemo(()=>{var T,k;if(!(!s||!p)){if(!((T=s.sellingPlanAllocations)!=null&&T.nodes)&&!((k=s.sellingPlanAllocations)!=null&&k.edges))throw new Error("<ProductProvider/>: You must include 'sellingPlanAllocations.nodes' or 'sellingPlanAllocations.edges' in your variants in order to calculate selectedSellingPlanAllocation");return q(s.sellingPlanAllocations).find(_=>{var O;return((O=_==null?void 0:_.sellingPlan)==null?void 0:O.id)===p.id})}},[s,p]),P=u.useMemo(()=>({variants:n,variantsConnection:t.variants,options:o,selectedVariant:s,setSelectedVariant:i,selectedOptions:a,setSelectedOption:y,setSelectedOptions:c,isOptionInStock:l,selectedSellingPlan:p,setSelectedSellingPlan:m,selectedSellingPlanAllocation:h,sellingPlanGroups:d,sellingPlanGroupsConnection:t.sellingPlanGroups}),[l,o,t.sellingPlanGroups,t.variants,a,p,h,s,d,y,n]);return u.createElement(ze.Provider,{value:P},e)}function Je(){const e=u.useContext(ze);if(!e)throw new Error("'useProduct' must be a child of <ProductProvider />");return e}function Ke(e,t){var r,n;if(!(!e.length||((n=(r=e==null?void 0:e[0])==null?void 0:r.selectedOptions)==null?void 0:n.length)!==Object.keys(t).length))return e==null?void 0:e.find(o=>Object.entries(t).every(([s,i])=>{var a;return(a=o==null?void 0:o.selectedOptions)==null?void 0:a.some(c=>(c==null?void 0:c.name)===s&&(c==null?void 0:c.value)===i)}))}function Ir(e){const t=e.reduce((r,n)=>{var o;if(!n.selectedOptions)throw new Error("'getOptions' requires 'variant.selectedOptions'");return(o=n==null?void 0:n.selectedOptions)==null||o.forEach(s=>{r[(s==null?void 0:s.name)??""]=r[(s==null?void 0:s.name)??""]||new Set,r[(s==null?void 0:s.name)??""].add((s==null?void 0:s.value)??"")}),r},{});return Object.keys(t).map(r=>({name:r,values:Array.from(t[r])}))}function Xe(e,t){if(e){const r=t.find(n=>(n==null?void 0:n.id)===e);return r||console.warn("<ProductProvider/> received a 'initialVariantId' prop, but could not actually find a variant with that ID"),r}if(e===null)return null;if(e===void 0)return t.find(r=>r==null?void 0:r.availableForSale)||t[0]}function et(e){return e!=null&&e.selectedOptions?e.selectedOptions.reduce((t,r)=>(t[(r==null?void 0:r.name)??""]=(r==null?void 0:r.value)??"",t),{}):{}}function Dr(e){return!(!e||!Array.isArray(e))}function he(e){const{as:t,onClick:r,defaultOnClick:n,children:o,buttonRef:s,...i}=e,a=u.useCallback(y=>{if(r){const l=r(y);if(typeof l=="boolean"&&l===!1||y!=null&&y.defaultPrevented)return}n==null||n(y)},[n,r]),c=t||"button";return u.createElement(c,{ref:s,onClick:a,...i},o)}function Pr(e){const[t,r]=u.useState(!1),{variantId:n,quantity:o=1,attributes:s,sellingPlanId:i,onClick:a,children:c,accessibleAddingToCartLabel:y,...l}=e,{status:d,linesAdd:p}=K(),{selectedVariant:m}=Je(),h=n??(m==null?void 0:m.id)??"",P=n===null||h===""||m===null||t||l.disabled;u.useEffect(()=>{t&&d==="idle"&&r(!1)},[d,t]);const T=u.useCallback(()=>{r(!0),p([{quantity:o,merchandiseId:h||"",attributes:s,sellingPlanId:i}])},[p,o,h,s,i]);return W.createElement(W.Fragment,null,W.createElement(he,{...l,disabled:P,onClick:a,defaultOnClick:T},c),y?W.createElement("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"},t?y:null):null)}const Ie={PAGE_VIEW:"PAGE_VIEW",ADD_TO_CART:"ADD_TO_CART"},ge={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"},tt={hydrogen:"hydrogen",headless:"headless"},rt={hydrogen:"6167201",headless:"12875497473"};function X(e,t){return{schema_id:e,payload:t,metadata:{event_created_at_ms:Date.now()}}}function Y(e){const t={id:"",resource:null};if(typeof e!="string")return t;const r=e.match(/^gid:\/\/shopify\/(\w+)\/([a-z0-9]+)/);if(!r||r.length===1)return t;const n=r[2]??null,o=r[1]??null;return{id:n,resource:o}}function G(e,t){return typeof e!="object"?{}:(Object.entries(e).forEach(([r,n])=>{n&&(t[r]=n)}),t)}function kr(e){return typeof document>"u"?(console.error(`${e} should only be used within the useEffect callback or event handlers`),!0):!1}const Ur="trekkie_storefront_page_view/1.4",Nr="myshopify.dev";function $r(e){const t=e,{id:r,resource:n}=Y(t.resourceId),o=n?n.toLowerCase():void 0;return[X(Ur,G({pageType:t.pageType,customerId:t.customerId,resourceType:o,resourceId:parseInt(r)},Or(t)))]}function Or(e){return{appClientId:e.shopifySalesChannel?rt[e.shopifySalesChannel]:rt.headless,isMerchantRequest:Vr(e.url),hydrogenSubchannelId:e.storefrontId||"0",isPersistentCookie:e.hasUserConsent,uniqToken:e.uniqueToken,visitToken:e.visitToken,microSessionId:fe(),microSessionCount:1,url:e.url,path:e.path,search:e.search,referrer:e.referrer,title:e.title,shopId:parseInt(Y(e.shopId).id),currency:e.currency,contentLanguage:e.acceptedLanguage||"en"}}function Vr(e){if(typeof e!="string")return!1;const t=new URL(e).hostname;return t.indexOf(Nr)!==-1||t==="localhost"}const ne="custom_storefront_customer_tracking/1.0",Lr="page_rendered",Mr="collection_page_rendered",Rr="product_page_rendered",xr="product_added_to_cart",Fr="search_submitted";function qr(e){const t=e,r={canonical_url:t.canonicalUrl||t.url,customer_id:t.customerId},n=t.pageType,o=[];switch(o.push(X(ne,G({event_name:Lr,...r},oe(t)))),n){case ge.collection:o.push(X(ne,G({event_name:Mr,...r,collection_name:t.collectionHandle},oe(t))));break;case ge.product:o.push(X(ne,G({event_name:Rr,...r,products:nt(t.products),total_value:t.totalValue},oe(t))));break;case ge.search:o.push(X(ne,G({event_name:Fr,...r,search_string:t.searchString},oe(t))));break}return o}function Br(e){const t=e,r=Y(t.cartId),n=r!=null&&r.id?`${r.id}`:null;return[X(ne,G({event_name:xr,customerId:t.customerId,cart_token:n,total_value:t.totalValue,products:nt(t.products)},oe(t)))]}function oe(e){return{source:e.shopifySalesChannel||tt.headless,hydrogenSubchannelId:e.storefrontId||"0",is_persistent_cookie:e.hasUserConsent,ccpa_enforced:!1,gdpr_enforced:!1,unique_token:e.uniqueToken,event_time:Date.now(),event_id:fe(),event_source_url:e.url,referrer:e.referrer,user_agent:e.userAgent,navigation_type:e.navigationType,navigation_api:e.navigationApi,shop_id:parseInt(Y(e.shopId).id),currency:e.currency}}function nt(e){return e?e.map(t=>{const r=G({variant_gid:t.variantGid,category:t.category,sku:t.sku,product_id:parseInt(Y(t.productGid).id),variant_id:parseInt(Y(t.variantGid).id)},{product_gid:t.productGid,name:t.name,variant:t.variantName||"",brand:t.brand,price:t.price,quantity:Number(t.quantity||0)});return JSON.stringify(r)}):[]}function Hr(e,t){const{eventName:r,payload:n}=e;if(!n.hasUserConsent)return Promise.resolve();let o=[];if(r===Ie.PAGE_VIEW){const s=n;o=o.concat($r(s),qr(s))}else r===Ie.ADD_TO_CART&&(o=o.concat(Br(n)));return o.length?Yr(o,t):Promise.resolve()}const ot="sendShopifyAnalytics request is unsuccessful";function Yr(e,t){const r={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(r)}).then(n=>{if(!n.ok)throw new Error("Response failed");return n.text()}).then(n=>{n&&JSON.parse(n).result.forEach(s=>{s.status!==200&&console.error(ot,`
261
+ `,oe="2023-04";function gr(e){const{storeDomain:t,privateStorefrontToken:r,publicStorefrontToken:n,storefrontApiVersion:o,contentType:a}=e;return o!==oe&&hr(`StorefrontClient: The Storefront API version that you're using is different than the version this build of Hydrogen React is targeting. You may run into unexpected errors if these versions don't match. Received verion: "${o}"; expected version "${oe}"`),{getShopifyDomain(s){return(s==null?void 0:s.storeDomain)??t},getStorefrontApiUrl(s){const i=(s==null?void 0:s.storeDomain)??t;return`${i}${i.endsWith("/")?"":"/"}api/${(s==null?void 0:s.storefrontApiVersion)??o}/graphql.json`},getPrivateTokenHeaders(s){if(!r&&!(s!=null&&s.privateStorefrontToken))throw new Error("StorefrontClient: You did not pass in a 'privateStorefrontToken' while using 'getPrivateTokenHeaders()'");return{"content-type":((s==null?void 0:s.contentType)??a)==="graphql"?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":o,"Shopify-Storefront-Private-Token":(s==null?void 0:s.privateStorefrontToken)??r??"",...s!=null&&s.buyerIp?{"Shopify-Storefront-Buyer-IP":s.buyerIp}:{}}},getPublicTokenHeaders(s){if(!n&&!(s!=null&&s.publicStorefrontToken))throw new Error("StorefrontClient: You did not pass in a 'publicStorefrontToken' while using 'getPublicTokenHeaders()'");const i=(s==null?void 0:s.contentType)??a??"json";return Be(i,o,(s==null?void 0:s.publicStorefrontToken)??n??"")}}}function Be(e,t,r){return{"content-type":e==="graphql"?"application/graphql":"application/json","X-SDK-Variant":"hydrogen-react","X-SDK-Variant-Source":"react","X-SDK-Version":t,"X-Shopify-Storefront-Access-Token":r}}const Ye=new Set,hr=e=>{Ye.has(e)||(console.warn(e),Ye.add(e))},je={storeDomain:"test",storefrontToken:"abc123",storefrontApiVersion:oe,countryIsoCode:"US",languageIsoCode:"EN",getStorefrontApiUrl(){return""},getPublicTokenHeaders(){return{}},getShopifyDomain(){return""}},Ge=u.createContext(je);function mr({children:e,...t}){if(!t.countryIsoCode||!t.languageIsoCode||!t.storeDomain||!t.storefrontToken||!t.storefrontApiVersion)throw new Error("Please provide the necessary props to '<ShopifyProvider/>'");t.storefrontApiVersion!==oe&&console.warn(`<ShopifyProvider/>: This version of Hydrogen React is built for Shopify's Storefront API version ${oe}, 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 r=u.useMemo(()=>{function n(o){return(o==null?void 0:o.storeDomain)??t.storeDomain}return{...t,getPublicTokenHeaders(o){return Be(o.contentType,t.storefrontApiVersion,o.storefrontToken??t.storefrontToken)},getShopifyDomain:n,getStorefrontApiUrl(o){const a=n({storeDomain:(o==null?void 0:o.storeDomain)??t.storeDomain});return`${a}${a.endsWith("/")?"":"/"}api/${(o==null?void 0:o.storefrontApiVersion)??t.storefrontApiVersion}/graphql.json`}}},[t]);return u.createElement(Ge.Provider,{value:r},e)}function ge(){const e=u.useContext(Ge);if(!e)throw new Error("'useShop()' must be a descendent of <ShopifyProvider/>");return e}const Ie="shopifyCartId",Ze="Shopify-Storefront-Id",We="Shopify-Storefront-Y",Qe="Shopify-Storefront-S",Y="_shopify_y",j="_shopify_s";var pr=new Set(["domain","path","max-age","expires","samesite","secure","httponly"]);function Er(e){let t={},r,n,o=0,a=e.split(/;\s*/g),s,i;for(;o<a.length;o++)if(n=a[o],r=n.indexOf("="),~r){if(s=n.substring(0,r++).trim(),i=n.substring(r).trim(),i[0]==='"'&&(i=i.substring(1,i.length-1)),~i.indexOf("%"))try{i=decodeURIComponent(i)}catch{}pr.has(n=s.toLowerCase())?n==="expires"?t.expires=new Date(i):n==="max-age"?t.maxage=+i:t[n]=i:t[s]=i}else(s=n.trim().toLowerCase())&&(s==="httponly"||s==="secure")&&(t[s]=!0);return t}function Cr(e,t,r={}){let n=e+"="+encodeURIComponent(t);return r.expires&&(n+="; Expires="+new Date(r.expires).toUTCString()),r.maxage!=null&&r.maxage>=0&&(n+="; Max-Age="+(r.maxage|0)),r.domain&&(n+="; Domain="+r.domain),r.path&&(n+="; Path="+r.path),r.samesite&&(n+="; SameSite="+r.samesite),(r.secure||r.samesite==="None")&&(n+="; Secure"),r.httponly&&(n+="; HttpOnly"),n}const Je="xxxx-4xxx-xxxx-xxxxxxxxxxxx";function he(){let e="";try{const t=window.crypto,r=new Uint16Array(31);t.getRandomValues(r);let n=0;e=Je.replace(/[x]/g,o=>{const a=r[n]%16,s=o==="x"?a:a&3|8;return n++,s.toString(16)}).toUpperCase()}catch{e=Je.replace(/[x]/g,r=>{const n=Math.random()*16|0;return(r==="x"?n:n&3|8).toString(16)}).toUpperCase()}return`${Sr()}-${e}`}function Sr(){let e=0,t=0;e=new Date().getTime()>>>0;try{t=performance.now()>>>0}catch{t=0}const r=Math.abs(e+t).toString(16).toLowerCase();return r.padStart(8-r.length,"0")}function me(e){const t=Er(e);return{[Y]:t[Y]||"",[j]:t[j]||""}}function Tr(){const{storefrontId:e,getPublicTokenHeaders:t,getStorefrontApiUrl:r}=ge();return u.useCallback(({query:n,variables:o})=>{const a=t({contentType:"json"});e&&(a[Ze]=e);const s=me(document.cookie);return a[We]=s[Y],a[Qe]=s[j],fetch(r(),{method:"POST",headers:a,body:JSON.stringify({query:n.toString(),variables:o})}).then(i=>i.json()).catch(i=>({data:void 0,errors:i==null?void 0:i.toString()}))},[t,e,r])}function _r({numCartLines:e,cartFragment:t,countryCode:r="US"}){const n=Tr(),o=u.useCallback(p=>n({query:fr(t),variables:{id:p,numCartLines:e,country:r}}),[n,t,e,r]),a=u.useCallback(p=>n({query:ir(t),variables:{input:p,numCartLines:e,country:r}}),[t,r,n,e]),s=u.useCallback((p,d)=>n({query:or(t),variables:{cartId:p,lines:d,numCartLines:e,country:r}}),[t,r,n,e]),i=u.useCallback((p,d)=>n({query:sr(t),variables:{cartId:p,lines:d,numCartLines:e,country:r}}),[t,r,n,e]),c=u.useCallback((p,d)=>n({query:ar(t),variables:{cartId:p,lines:d,numCartLines:e,country:r}}),[t,r,n,e]),h=u.useCallback((p,d)=>n({query:ur(t),variables:{cartId:p,note:d,numCartLines:e,country:r}}),[n,t,e,r]),l=u.useCallback((p,d)=>n({query:cr(t),variables:{cartId:p,buyerIdentity:d,numCartLines:e,country:r}}),[t,r,n,e]),y=u.useCallback((p,d)=>n({query:lr(t),variables:{cartId:p,attributes:d,numCartLines:e,country:r}}),[t,r,n,e]),m=u.useCallback((p,d)=>n({query:dr(t),variables:{cartId:p,discountCodes:d,numCartLines:e,country:r}}),[t,r,n,e]);return u.useMemo(()=>({cartFetch:o,cartCreate:a,cartLineAdd:s,cartLineUpdate:i,cartLineRemove:c,noteUpdate:h,buyerIdentityUpdate:l,cartAttributesUpdate:y,discountCodesUpdate:m,cartFragment:t}),[o,a,s,i,c,h,l,y,m,t])}function x(e,t){return{entry:[...(t==null?void 0:t.entryActions)||[],K({lastValidCart:r=>r==null?void 0:r.cart}),"onCartActionEntry","onCartActionOptimisticUI",e],on:{RESOLVE:{target:(t==null?void 0:t.resolveTarget)||"idle",actions:[K({prevCart:r=>r==null?void 0:r.lastValidCart,cart:(r,n)=>{var o;return(o=n==null?void 0:n.payload)==null?void 0:o.cart},rawCartResult:(r,n)=>{var o;return(o=n==null?void 0:n.payload)==null?void 0:o.rawCartResult},errors:r=>{}})]},ERROR:{target:(t==null?void 0:t.errorTarget)||"error",actions:[K({prevCart:r=>r==null?void 0:r.lastValidCart,cart:r=>r==null?void 0:r.lastValidCart,errors:(r,n)=>{var o;return(o=n==null?void 0:n.payload)==null?void 0:o.errors}})]},CART_COMPLETED:{target:"cartCompleted",actions:K({prevCart:r=>{},cart:r=>{},lastValidCart:r=>{},rawCartResult:r=>{},errors:r=>{}})}},exit:["onCartActionComplete",...(t==null?void 0:t.exitActions)||[]]}}const ie={CART_FETCH:{target:"cartFetching"},CART_CREATE:{target:"cartCreating"},CART_SET:{target:"idle",actions:[K({rawCartResult:(e,t)=>t.payload.cart,cart:(e,t)=>we(t.payload.cart)})]}},Ke={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 Ar(e){return xe({id:"Cart",initial:e?"idle":"uninitialized",context:{cart:e&&we(e)},states:{uninitialized:{on:ie},cartCompleted:{on:ie},initializationError:{on:ie},idle:{on:{...ie,...Ke}},error:{on:{...ie,...Ke}},cartFetching:x("cartFetchAction",{errorTarget:"initializationError"}),cartCreating:x("cartCreateAction",{errorTarget:"initializationError"}),cartLineRemoving:x("cartLineRemoveAction"),cartLineUpdating:x("cartLineUpdateAction"),cartLineAdding:x("cartLineAddAction"),noteUpdating:x("noteUpdateAction"),buyerIdentityUpdating:x("buyerIdentityUpdateAction"),cartAttributesUpdating:x("cartAttributesUpdateAction"),discountCodesUpdating:x("discountCodesUpdateAction")}})}function vr({numCartLines:e,onCartActionEntry:t,onCartActionOptimisticUI:r,onCartActionComplete:n,data:o,cartFragment:a,countryCode:s}){const{cartFetch:i,cartCreate:c,cartLineAdd:h,cartLineUpdate:l,cartLineRemove:y,noteUpdate:m,buyerIdentityUpdate:p,cartAttributesUpdate:d,discountCodesUpdate:I}=_r({numCartLines:e,cartFragment:a,countryCode:s}),T=u.useMemo(()=>Ar(o),[o]),[w,A,O]=tr(T,{actions:{cartFetchAction:async(g,f)=>{var _;if(f.type!=="CART_FETCH")return;const{data:C,errors:P}=await i((_=f==null?void 0:f.payload)==null?void 0:_.cartId),D=F(f,C==null?void 0:C.cart,P);A(D)},cartCreateAction:async(g,f)=>{var _;if(f.type!=="CART_CREATE")return;const{data:C,errors:P}=await c(f==null?void 0:f.payload),D=F(f,(_=C==null?void 0:C.cartCreate)==null?void 0:_.cart,P);A(D)},cartLineAddAction:async(g,f)=>{var _,v;if(f.type!=="CARTLINE_ADD"||!((_=g==null?void 0:g.cart)!=null&&_.id))return;const{data:C,errors:P}=await h(g.cart.id,f.payload.lines),D=F(f,(v=C==null?void 0:C.cartLinesAdd)==null?void 0:v.cart,P);A(D)},cartLineUpdateAction:async(g,f)=>{var _,v;if(f.type!=="CARTLINE_UPDATE"||!((_=g==null?void 0:g.cart)!=null&&_.id))return;const{data:C,errors:P}=await l(g.cart.id,f.payload.lines),D=F(f,(v=C==null?void 0:C.cartLinesUpdate)==null?void 0:v.cart,P);A(D)},cartLineRemoveAction:async(g,f)=>{var _,v;if(f.type!=="CARTLINE_REMOVE"||!((_=g==null?void 0:g.cart)!=null&&_.id))return;const{data:C,errors:P}=await y(g.cart.id,f.payload.lines),D=F(f,(v=C==null?void 0:C.cartLinesRemove)==null?void 0:v.cart,P);A(D)},noteUpdateAction:async(g,f)=>{var _,v;if(f.type!=="NOTE_UPDATE"||!((_=g==null?void 0:g.cart)!=null&&_.id))return;const{data:C,errors:P}=await m(g.cart.id,f.payload.note),D=F(f,(v=C==null?void 0:C.cartNoteUpdate)==null?void 0:v.cart,P);A(D)},buyerIdentityUpdateAction:async(g,f)=>{var _,v;if(f.type!=="BUYER_IDENTITY_UPDATE"||!((_=g==null?void 0:g.cart)!=null&&_.id))return;const{data:C,errors:P}=await p(g.cart.id,f.payload.buyerIdentity),D=F(f,(v=C==null?void 0:C.cartBuyerIdentityUpdate)==null?void 0:v.cart,P);A(D)},cartAttributesUpdateAction:async(g,f)=>{var _,v;if(f.type!=="CART_ATTRIBUTES_UPDATE"||!((_=g==null?void 0:g.cart)!=null&&_.id))return;const{data:C,errors:P}=await d(g.cart.id,f.payload.attributes),D=F(f,(v=C==null?void 0:C.cartAttributesUpdate)==null?void 0:v.cart,P);A(D)},discountCodesUpdateAction:async(g,f)=>{var _,v;if(f.type!=="DISCOUNT_CODES_UPDATE"||!((_=g==null?void 0:g.cart)!=null&&_.id))return;const{data:C,errors:P}=await I(g.cart.id,f.payload.discountCodes),D=F(f,(v=C==null?void 0:C.cartDiscountCodesUpdate)==null?void 0:v.cart,P);A(D)},...t&&{onCartActionEntry:(g,f)=>{br(f)&&t(g,f)}},...r&&{onCartActionOptimisticUI:K((g,f)=>r(g,f))},...n&&{onCartActionComplete:(g,f)=>{Ir(f)&&n(g,f)}}}});return u.useMemo(()=>[w,A,O],[w,A,O])}function we(e){return{...e,lines:B(e==null?void 0:e.lines),note:e.note??void 0}}function F(e,t,r){return r?{type:"ERROR",payload:{errors:r,cartActionEvent:e}}:t?{type:"RESOLVE",payload:{cart:we(t),rawCartResult:t,cartActionEvent:e}}:{type:"CART_COMPLETED",payload:{cartActionEvent:e}}}function br(e){return e.type==="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"}function Ir(e){return e.type==="RESOLVE"||e.type==="ERROR"||e.type==="CART_COMPLETED"}const Xe=u.createContext(null);function z(){const e=u.useContext(Xe);if(!e)throw new Error("Expected a Cart Context, but no Cart Context was found");return e}function wr({children:e,numCartLines:t,onCreate:r,onLineAdd:n,onLineRemove:o,onLineUpdate:a,onNoteUpdate:s,onBuyerIdentityUpdate:i,onAttributesUpdate:c,onDiscountCodesUpdate:h,onCreateComplete:l,onLineAddComplete:y,onLineRemoveComplete:m,onLineUpdateComplete:p,onNoteUpdateComplete:d,onBuyerIdentityUpdateComplete:I,onAttributesUpdateComplete:T,onDiscountCodesUpdateComplete:w,data:A,cartFragment:O=yr,customerAccessToken:g,countryCode:f="US"}){var _t,At,vt,bt,It,wt,Dt;f&&(f=f.toUpperCase());const[C,P]=u.useState(f),[D,_]=u.useState(g),v=u.useRef(!1);(C!==f||D!==g)&&(P(f),_(g),v.current=!1);const[U,L]=vr({numCartLines:t,data:A,cartFragment:O,countryCode:f,onCartActionEntry(S,$){try{switch($.type){case"CART_CREATE":return r==null?void 0:r();case"CARTLINE_ADD":return n==null?void 0:n();case"CARTLINE_REMOVE":return o==null?void 0:o();case"CARTLINE_UPDATE":return a==null?void 0:a();case"NOTE_UPDATE":return s==null?void 0:s();case"BUYER_IDENTITY_UPDATE":return i==null?void 0:i();case"CART_ATTRIBUTES_UPDATE":return c==null?void 0:c();case"DISCOUNT_CODES_UPDATE":return h==null?void 0:h()}}catch(M){console.error("Cart entry action failed",M)}},onCartActionOptimisticUI(S,$){var M,H,N,de;if(!S.cart)return{...S};switch($.type){case"CARTLINE_REMOVE":return{...S,cart:{...S.cart,lines:(H=(M=S==null?void 0:S.cart)==null?void 0:M.lines)==null?void 0:H.filter(R=>(R==null?void 0:R.id)&&!$.payload.lines.includes(R==null?void 0:R.id))}};case"CARTLINE_UPDATE":return{...S,cart:{...S.cart,lines:(de=(N=S==null?void 0:S.cart)==null?void 0:N.lines)==null?void 0:de.map(R=>{const Oe=$.payload.lines.find(({id:bn})=>bn===(R==null?void 0:R.id));return Oe&&Oe.quantity?{...R,quantity:Oe.quantity}:R})}}}return{...S}},onCartActionComplete(S,$){const M=$.payload.cartActionEvent;try{switch($.type){case"RESOLVE":switch(M.type){case"CART_CREATE":return l==null?void 0:l();case"CARTLINE_ADD":return y==null?void 0:y();case"CARTLINE_REMOVE":return m==null?void 0:m();case"CARTLINE_UPDATE":return p==null?void 0:p();case"NOTE_UPDATE":return d==null?void 0:d();case"BUYER_IDENTITY_UPDATE":return kr(S,M)&&(v.current=!0),I==null?void 0:I();case"CART_ATTRIBUTES_UPDATE":return T==null?void 0:T();case"DISCOUNT_CODES_UPDATE":return w==null?void 0:w()}}}catch(H){console.error("onCartActionComplete failed",H)}}}),q=u.useRef(!1),re=U.matches("cartCompleted"),ne=(U.value==="idle"||U.value==="error"||U.value==="cartCompleted")&&f!==((vt=(At=(_t=U==null?void 0:U.context)==null?void 0:_t.cart)==null?void 0:At.buyerIdentity)==null?void 0:vt.countryCode)&&!U.context.errors,Q=u.useRef(!1);u.useEffect(()=>{if(!q.current&&!Q.current){if(!A&&De("localStorage")){Q.current=!0;try{const S=window.localStorage.getItem(Ie);S&&L({type:"CART_FETCH",payload:{cartId:S}})}catch(S){console.warn("error fetching cartId"),console.warn(S)}}q.current=!0}},[A,q,L]),u.useEffect(()=>{!ne||v.current||L({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:{countryCode:f,customerAccessToken:g}}})},[f,g,ne,v,L]);const b=u.useCallback(S=>{if(!q.current)return console.warn("Cart isn't ready yet");L(S)},[L]);u.useEffect(()=>{var S,$,M;if(($=(S=U==null?void 0:U.context)==null?void 0:S.cart)!=null&&$.id&&De("localStorage"))try{window.localStorage.setItem(Ie,(M=U.context.cart)==null?void 0:M.id)}catch(H){console.warn("Failed to save cartId to localStorage",H)}},[(It=(bt=U==null?void 0:U.context)==null?void 0:bt.cart)==null?void 0:It.id]),u.useEffect(()=>{if(re&&De("localStorage"))try{window.localStorage.removeItem(Ie)}catch(S){console.warn("Failed to delete cartId from localStorage",S)}},[re]);const J=u.useCallback(S=>{var $,M;f&&!(($=S.buyerIdentity)!=null&&$.countryCode)&&(S.buyerIdentity==null&&(S.buyerIdentity={}),S.buyerIdentity.countryCode=f),g&&!((M=S.buyerIdentity)!=null&&M.customerAccessToken)&&(S.buyerIdentity==null&&(S.buyerIdentity={}),S.buyerIdentity.customerAccessToken=g),b({type:"CART_CREATE",payload:S})},[f,g,b]),k=Pr(U),Te=u.useMemo(()=>{var S,$,M,H;return{...((S=k==null?void 0:k.context)==null?void 0:S.cart)??{lines:[],attributes:[]},status:Dr(k.value),error:($=k==null?void 0:k.context)==null?void 0:$.errors,totalQuantity:((H=(M=k==null?void 0:k.context)==null?void 0:M.cart)==null?void 0:H.totalQuantity)??0,cartCreate:J,linesAdd(N){var de,R;(R=(de=k==null?void 0:k.context)==null?void 0:de.cart)!=null&&R.id?b({type:"CARTLINE_ADD",payload:{lines:N}}):J({lines:N})},linesRemove(N){b({type:"CARTLINE_REMOVE",payload:{lines:N}})},linesUpdate(N){b({type:"CARTLINE_UPDATE",payload:{lines:N}})},noteUpdate(N){b({type:"NOTE_UPDATE",payload:{note:N}})},buyerIdentityUpdate(N){b({type:"BUYER_IDENTITY_UPDATE",payload:{buyerIdentity:N}})},cartAttributesUpdate(N){b({type:"CART_ATTRIBUTES_UPDATE",payload:{attributes:N}})},discountCodesUpdate(N){b({type:"DISCOUNT_CODES_UPDATE",payload:{discountCodes:N}})},cartFragment:O}},[J,(wt=k==null?void 0:k.context)==null?void 0:wt.cart,(Dt=k==null?void 0:k.context)==null?void 0:Dt.errors,k.value,O,b]);return u.createElement(Xe.Provider,{value:Te},e)}function Dr(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 Pr(e){const[t,r]=u.useTransition(),[n,o]=u.useState(e),a=u.useRef(!1);t&&(a.current=!0);const s=u.useRef(!1);return!t&&a.current&&(s.current=!0),u.useEffect(()=>{r(()=>{s.current||o(e)})},[e]),s.current?e:n}function De(e){let t;try{t=window[e];const r="__storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(r){return!!(r instanceof DOMException&&(r.code===22||r.code===1014||r.name==="QuotaExceededError"||r.name==="NS_ERROR_DOM_QUOTA_REACHED")&&t&&t.length!==0)}}function kr(e,t){var r,n;return!!(t.payload.buyerIdentity.countryCode&&((n=(r=e.cart)==null?void 0:r.buyerIdentity)==null?void 0:n.countryCode)!==t.payload.buyerIdentity.countryCode)}const ze=u.createContext(null);function Ur({children:e,data:t,initialVariantId:r}){const n=u.useMemo(()=>B(t.variants??{}),[t.variants]);if(!$r(n))throw new Error("<ProductProvider/> requires 'product.variants.nodes' or 'product.variants.edges'");const o=u.useMemo(()=>Or(n),[n]),[a,s]=u.useState(()=>rt(r,n)),[i,c]=u.useState(()=>nt(a));u.useEffect(()=>{const T=rt(r,n);s(T),c(nt(T))},[r,n]);const h=u.useCallback((T,w)=>{c(A=>{const O={...A,[T]:w};return s(tt(n,O)),O})},[c,n]),l=u.useCallback((T,w)=>{const A=tt(n,{...i,[T]:w});return(A==null?void 0:A.availableForSale)??!0},[i,n]),y=u.useMemo(()=>B(t.sellingPlanGroups??{}).map(T=>({...T,sellingPlans:B((T==null?void 0:T.sellingPlans)??{})})),[t.sellingPlanGroups]),[m,p]=u.useState(void 0),d=u.useMemo(()=>{var T,w;if(!(!a||!m)){if(!((T=a.sellingPlanAllocations)!=null&&T.nodes)&&!((w=a.sellingPlanAllocations)!=null&&w.edges))throw new Error("<ProductProvider/>: You must include 'sellingPlanAllocations.nodes' or 'sellingPlanAllocations.edges' in your variants in order to calculate selectedSellingPlanAllocation");return B(a.sellingPlanAllocations).find(A=>{var O;return((O=A==null?void 0:A.sellingPlan)==null?void 0:O.id)===m.id})}},[a,m]),I=u.useMemo(()=>({product:t,variants:n,variantsConnection:t.variants,options:o,selectedVariant:a,setSelectedVariant:s,selectedOptions:i,setSelectedOption:h,setSelectedOptions:c,isOptionInStock:l,selectedSellingPlan:m,setSelectedSellingPlan:p,selectedSellingPlanAllocation:d,sellingPlanGroups:y,sellingPlanGroupsConnection:t.sellingPlanGroups}),[t,l,o,i,m,d,a,y,h,n]);return u.createElement(ze.Provider,{value:I},e)}function et(){const e=u.useContext(ze);if(!e)throw new Error("'useProduct' must be a child of <ProductProvider />");return e}function tt(e,t){var r,n;if(!(!e.length||((n=(r=e==null?void 0:e[0])==null?void 0:r.selectedOptions)==null?void 0:n.length)!==Object.keys(t).length))return e==null?void 0:e.find(o=>Object.entries(t).every(([a,s])=>{var i;return(i=o==null?void 0:o.selectedOptions)==null?void 0:i.some(c=>(c==null?void 0:c.name)===a&&(c==null?void 0:c.value)===s)}))}function Or(e){const t=e.reduce((r,n)=>{var o;if(!n.selectedOptions)throw new Error("'getOptions' requires 'variant.selectedOptions'");return(o=n==null?void 0:n.selectedOptions)==null||o.forEach(a=>{r[(a==null?void 0:a.name)??""]=r[(a==null?void 0:a.name)??""]||new Set,r[(a==null?void 0:a.name)??""].add((a==null?void 0:a.value)??"")}),r},{});return Object.keys(t).map(r=>({name:r,values:Array.from(t[r])}))}function rt(e,t){if(e){const r=t.find(n=>(n==null?void 0:n.id)===e);return r||console.warn("<ProductProvider/> received a 'initialVariantId' prop, but could not actually find a variant with that ID"),r}if(e===null)return null;if(e===void 0)return t.find(r=>r==null?void 0:r.availableForSale)||t[0]}function nt(e){return e!=null&&e.selectedOptions?e.selectedOptions.reduce((t,r)=>(t[(r==null?void 0:r.name)??""]=(r==null?void 0:r.value)??"",t),{}):{}}function $r(e){return!(!e||!Array.isArray(e))}function pe(e){const{as:t,onClick:r,defaultOnClick:n,children:o,buttonRef:a,...s}=e,i=u.useCallback(h=>{if(r){const l=r(h);if(typeof l=="boolean"&&l===!1||h!=null&&h.defaultPrevented)return}n==null||n(h)},[n,r]),c=t||"button";return u.createElement(c,{ref:a,onClick:i,...s},o)}function Nr(e){const[t,r]=u.useState(!1),{variantId:n,quantity:o=1,attributes:a,sellingPlanId:s,onClick:i,children:c,accessibleAddingToCartLabel:h,...l}=e,{status:y,linesAdd:m}=z(),{selectedVariant:p}=et(),d=n??(p==null?void 0:p.id)??"",I=n===null||d===""||p===null||t||l.disabled;u.useEffect(()=>{t&&y==="idle"&&r(!1)},[y,t]);const T=u.useCallback(()=>{r(!0),m([{quantity:o,merchandiseId:d||"",attributes:a,sellingPlanId:s}])},[m,o,d,a,s]);return V.createElement(V.Fragment,null,V.createElement(pe,{...l,disabled:I,onClick:i,defaultOnClick:T},c),h?V.createElement("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"},t?h:null):null)}const Pe={PAGE_VIEW:"PAGE_VIEW",ADD_TO_CART:"ADD_TO_CART"},Ee={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"},ot={hydrogen:"hydrogen",headless:"headless"},it={hydrogen:"6167201",headless:"12875497473"};function ee(e,t){return{schema_id:e,payload:t,metadata:{event_created_at_ms:Date.now()}}}function G(e){const t={id:"",resource:null};if(typeof e!="string")return t;const r=e.match(/^gid:\/\/shopify\/(\w+)\/([^/]+)/);if(!r||r.length===1)return t;const n=r[2]??null,o=r[1]??null;return{id:n,resource:o}}function W(e,t){return typeof e!="object"?{}:(Object.entries(e).forEach(([r,n])=>{n&&(t[r]=n)}),t)}function Mr(e){return typeof document>"u"?(console.error(`${e} should only be used within the useEffect callback or event handlers`),!0):!1}const Vr="trekkie_storefront_page_view/1.4",Rr="myshopify.dev";function Lr(e){const t=e,{id:r,resource:n}=G(t.resourceId),o=n?n.toLowerCase():void 0;return[ee(Vr,W({pageType:t.pageType,customerId:t.customerId,resourceType:o,resourceId:parseInt(r)},xr(t)))]}function xr(e){return{appClientId:e.shopifySalesChannel?it[e.shopifySalesChannel]:it.headless,isMerchantRequest:Fr(e.url),hydrogenSubchannelId:e.storefrontId||"0",isPersistentCookie:e.hasUserConsent,uniqToken:e.uniqueToken,visitToken:e.visitToken,microSessionId:he(),microSessionCount:1,url:e.url,path:e.path,search:e.search,referrer:e.referrer,title:e.title,shopId:parseInt(G(e.shopId).id),currency:e.currency,contentLanguage:e.acceptedLanguage||"en"}}function Fr(e){if(typeof e!="string")return!1;const t=new URL(e).hostname;return t.indexOf(Rr)!==-1||t==="localhost"}const ae="custom_storefront_customer_tracking/1.0",qr="page_rendered",Hr="collection_page_rendered",Br="product_page_rendered",Yr="product_added_to_cart",jr="search_submitted";function Gr(e){const t=e,r={canonical_url:t.canonicalUrl||t.url,customer_id:t.customerId},n=t.pageType,o=[];switch(o.push(ee(ae,W({event_name:qr,...r},se(t)))),n){case Ee.collection:o.push(ee(ae,W({event_name:Hr,...r,collection_name:t.collectionHandle},se(t))));break;case Ee.product:o.push(ee(ae,W({event_name:Br,...r,products:at(t.products),total_value:t.totalValue},se(t))));break;case Ee.search:o.push(ee(ae,W({event_name:jr,...r,search_string:t.searchString},se(t))));break}return o}function Zr(e){const t=e,r=G(t.cartId),n=r!=null&&r.id?`${r.id}`:null;return[ee(ae,W({event_name:Yr,customerId:t.customerId,cart_token:n,total_value:t.totalValue,products:at(t.products)},se(t)))]}function se(e){return{source:e.shopifySalesChannel||ot.headless,hydrogenSubchannelId:e.storefrontId||"0",is_persistent_cookie:e.hasUserConsent,ccpa_enforced:!1,gdpr_enforced:!1,unique_token:e.uniqueToken,event_time:Date.now(),event_id:he(),event_source_url:e.url,referrer:e.referrer,user_agent:e.userAgent,navigation_type:e.navigationType,navigation_api:e.navigationApi,shop_id:parseInt(G(e.shopId).id),currency:e.currency}}function at(e){return e?e.map(t=>{const r=W({variant_gid:t.variantGid,category:t.category,sku:t.sku,product_id:parseInt(G(t.productGid).id),variant_id:parseInt(G(t.variantGid).id)},{product_gid:t.productGid,name:t.name,variant:t.variantName||"",brand:t.brand,price:t.price,quantity:Number(t.quantity||0)});return JSON.stringify(r)}):[]}function Wr(e,t){const{eventName:r,payload:n}=e;if(!n.hasUserConsent)return Promise.resolve();let o=[];if(r===Pe.PAGE_VIEW){const a=n;o=o.concat(Lr(a),Gr(a))}else r===Pe.ADD_TO_CART&&(o=o.concat(Zr(n)));return o.length?Qr(o,t):Promise.resolve()}const st="sendShopifyAnalytics request is unsuccessful";function Qr(e,t){const r={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(r)}).then(n=>{if(!n.ok)throw new Error("Response failed");return n.text()}).then(n=>{n&&JSON.parse(n).result.forEach(a=>{a.status!==200&&console.error(st,`
262
262
 
263
- `,s.message)})}).catch(n=>{console.error(ot,n)})}catch{return Promise.resolve()}}function jr(){if(kr("getClientBrowserParameters"))return{uniqueToken:"",visitToken:"",url:"",path:"",search:"",referrer:"",title:"",userAgent:"",navigationType:"",navigationApi:""};const[e,t]=Qr(),r=ye(document.cookie);return{uniqueToken:r[B],visitToken:r[H],url:location.href,path:location.pathname,search:location.search,referrer:document.referrer,title:document.title,userAgent:navigator.userAgent,navigationType:e,navigationApi:t}}function Gr(){try{const e=(performance==null?void 0:performance.getEntriesByType)&&(performance==null?void 0:performance.getEntriesByType("navigation"));if(e&&e[0]){const t=window.performance.getEntriesByType("navigation")[0].type;return t&&t.toString()}}catch{}}function Zr(){var e,t;try{if(PerformanceNavigation&&((e=performance==null?void 0:performance.navigation)==null?void 0:e.type)!==null&&((t=performance==null?void 0:performance.navigation)==null?void 0:t.type)!==void 0){const r=performance.navigation.type;switch(r){case PerformanceNavigation.TYPE_NAVIGATE:return"navigate";case PerformanceNavigation.TYPE_RELOAD:return"reload";case PerformanceNavigation.TYPE_BACK_FORWARD:return"back_forward";default:return`unknown: ${r}`}}}catch{}}function Qr(){try{let e="PerformanceNavigationTiming",t=Gr();return t||(t=Zr(),e="performance.navigation"),t?[t,e]:["unknown","unknown"]}catch{}return["error","error"]}function Wr(e){const{cartCreate:t,checkoutUrl:r}=K(),[n,o]=u.useState(!1),{quantity:s,variantId:i,onClick:a,attributes:c,children:y,...l}=e;u.useEffect(()=>{r&&(window.location.href=r)},[r]);const d=u.useCallback(()=>{o(!0),t({lines:[{quantity:s??1,merchandiseId:i,attributes:c}]})},[t,s,i,c]);return u.createElement(he,{disabled:n??l.disabled,...l,onClick:a,defaultOnClick:d},y)}function zr(e){const[t,r]=u.useState(!1),{status:n,checkoutUrl:o}=K(),{children:s,...i}=e;return u.useEffect(()=>{t&&o&&n==="idle"&&(window.location.href=o)},[t,n,o]),u.createElement(he,{...i,disabled:t||i.disabled,onClick:()=>r(!0)},s)}function at(e){const{countryIsoCode:t,languageIsoCode:r}=de(),n=`${r}-${t}`;if(!n)throw new Error("useMoney(): Unable to get 'locale' from 'useShop()', which means that 'locale' was not passed to '<ShopifyProvider/>'. 'locale' is required for 'useMoney()' to work");const o=parseFloat(e.amount),s=u.useMemo(()=>({style:"currency",currency:e.currencyCode}),[e.currencyCode]),i=ee(n,s),a=ee(n,{...s,currencyDisplay:"name"}),c=ee(n,{...s,currencyDisplay:"narrowSymbol"}),y=ee(n,{...s,minimumFractionDigits:0,maximumFractionDigits:0}),l=ee(n),d=ee(n,{minimumFractionDigits:0,maximumFractionDigits:0}),p=h=>h.type==="currency",m=u.useMemo(()=>({original:()=>e,currencyCode:()=>e.currencyCode,localizedString:()=>i().format(o),parts:()=>i().formatToParts(o),withoutTrailingZeros:()=>o%1===0?y().format(o):i().format(o),withoutTrailingZerosAndCurrency:()=>o%1===0?d().format(o):l().format(o),currencyName:()=>{var h;return((h=a().formatToParts(o).find(p))==null?void 0:h.value)??e.currencyCode},currencySymbol:()=>{var h;return((h=i().formatToParts(o).find(p))==null?void 0:h.value)??e.currencyCode},currencyNarrowSymbol:()=>{var h;return((h=c().formatToParts(o).find(p))==null?void 0:h.value)??""},amount:()=>i().formatToParts(o).filter(h=>["decimal","fraction","group","integer","literal"].includes(h.type)).map(h=>h.value).join("")}),[e,o,a,i,c,l,y,d]);return u.useMemo(()=>new Proxy(m,{get:(h,P)=>{var T;return(T=Reflect.get(h,P))==null?void 0:T.call(null)}}),[m])}function ee(e,t){return u.useMemo(()=>{let r;return()=>r??(r=new Intl.NumberFormat(e,t))},[e,t])}function ae({data:e,as:t,withoutCurrency:r,withoutTrailingZeros:n,measurement:o,measurementSeparator:s="/",...i}){if(!Jr(e))throw new Error("<Money/> needs a valid 'data' prop that has 'amount' and 'currencyCode'");const a=at(e),c=t??"div";let y=a.localizedString;return(r||n)&&(r&&!n?y=a.amount:!r&&n?y=a.withoutTrailingZeros:y=a.withoutTrailingZerosAndCurrency),u.createElement(c,{...i},y,o&&o.referenceUnit&&u.createElement(u.Fragment,null,s,o.referenceUnit))}function Jr(e){return typeof e.amount=="string"&&!!e.amount&&typeof e.currencyCode=="string"&&!!e.currencyCode}function Kr(e){const{cost:t}=K(),{amountType:r="total",children:n,...o}=e;let s;return r=="total"?s=t==null?void 0:t.totalAmount:r=="subtotal"?s=t==null?void 0:t.subtotalAmount:r=="tax"?s=t==null?void 0:t.totalTaxAmount:r=="duty"&&(s=t==null?void 0:t.totalDutyAmount),s==null?null:u.createElement(ae,{...o,data:s},n)}function Xr(e){var s,i;const{data:t,priceType:r="regular",...n}=e;if(t==null)throw new Error("<CartLinePrice/> requires a cart line as the 'data' prop");const o=r==="regular"?(s=t.cost)==null?void 0:s.totalAmount:(i=t.cost)==null?void 0:i.compareAtAmountPerQuantity;return o==null?null:u.createElement(ae,{...n,data:o})}const it=u.createContext(null);function De(){const e=u.useContext(it);if(e==null)throw new Error("Expected a cart line context but none was found");return e}function en({children:e,line:t}){return u.createElement(it.Provider,{value:t},e)}function tn(e){const t=De(),{as:r,...n}=e,o=r||"span";return u.createElement(o,{...n},t.quantity)}function rn(e){const{status:t,linesRemove:r,linesUpdate:n}=K(),o=De(),{children:s,adjust:i,onClick:a,...c}=e,y=u.useCallback(()=>{if(i==="remove"){r([(o==null?void 0:o.id)??""]);return}const l=i==="decrease"?((o==null?void 0:o.quantity)??0)-1:((o==null?void 0:o.quantity)??0)+1;if(l<=0){r([(o==null?void 0:o.id)??""]);return}const d={id:(o==null?void 0:o.id)??"",quantity:l,attributes:(o==null?void 0:o.attributes)??[]};n([d])},[i,o==null?void 0:o.attributes,o==null?void 0:o.id,o==null?void 0:o.quantity,r,n]);return u.createElement(he,{...c,onClick:a,defaultOnClick:y,disabled:typeof c.disabled<"u"?c.disabled:t!=="idle"},s)}const nn={DateTime:"string",Decimal:"string",HTML:"string",URL:"string",Color:"string",UnsignedInt64:"string"};function st(e){const{data:t,options:r,id:n=t.id,frameBorder:o="0",allow:s="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:i=!0,loading:a="lazy",...c}=e;if(!t.embedUrl)throw new Error("<ExternalVideo/> requires the 'embedUrl' property");let y=t.embedUrl;if(r){const l=new URL(t.embedUrl);for(const d of Object.keys(r))l.searchParams.set(d,r[d]);y=l.toString()}return u.createElement("iframe",{...c,id:n??t.embedUrl,title:t.alt??t.id??"external video",frameBorder:o,allow:s,allowFullScreen:i,src:y,loading:a})}const on=["cdn.shopify.com","cdn.shopifycdn.net","shopify-assets.shopifycdn.com","shopify-assets.shopifycdn.net"],an=["spin.dev"],sn=[...on,...an],ie=[352,832,1200,1920,2560];function ut({src:e,width:t,height:r,crop:n,scale:o}){const s=new URL(e),i=o??1;if(t){let a;typeof t=="string"?a=(ie[0]*i).toString():a=(Number(t)*i).toString(),s.searchParams.append("width",a)}return r&&typeof r=="number"&&s.searchParams.append("height",(r*i).toString()),n&&s.searchParams.append("crop",n),s.toString()}function ct(e){const t=new URL(e.src);return!sn.some(n=>t.hostname.endsWith(n))||!e.width&&!e.height&&!e.crop&&!e.scale?e.src:ut(e)}function un({data:e,loaderOptions:t,elementProps:r}){let n=null;return e!=null&&e.width&&(e!=null&&e.height)&&(n=(e==null?void 0:e.width)/(e==null?void 0:e.height)),t!=null&&t.width||t!=null&&t.height?{width:(t==null?void 0:t.width)??(n&&typeof t.height=="number"?Math.round(n*t.height):null),height:(t==null?void 0:t.height)??(n&&typeof t.width=="number"?Math.round(n*t.width):null)}:r!=null&&r.width||r!=null&&r.height?{width:(r==null?void 0:r.width)??(n&&typeof r.height=="number"?Math.round(n*r.height):null),height:(r==null?void 0:r.height)??(n&&typeof r.width=="number"?Math.round(n*r.width):null)}:e!=null&&e.width||e!=null&&e.height?{width:(e==null?void 0:e.width)??null,height:(e==null?void 0:e.height)??null}:{width:null,height:null}}function lt({data:e,width:t,height:r,loading:n,loader:o=ct,loaderOptions:s,widths:i,decoding:a="async",...c}){if(!e.url){const h=`<Image/>: the 'data' prop requires the 'url' property. Image: ${e.id??"no ID provided"}`;return console.error(h),null}const{width:y,height:l}=un({data:e,loaderOptions:s,elementProps:{width:t,height:r}});let d=e.url;if(o&&(d=o({...s,src:e.url,width:y,height:l}),typeof d!="string"||!d))throw new Error(`<Image/>: 'loader' did not return a valid string. Image: ${e.id??e.url}`);const p=t&&y&&t<y?t:y,m=c.srcSet??cn({...s,widths:i,src:e.url,width:p,height:l,loader:o});return W.createElement("img",{id:e.id??"",alt:e.altText??c.alt??"",loading:n??"lazy",...c,src:d,width:y??void 0,height:l??void 0,srcSet:m,decoding:a})}function cn({src:e,width:t,crop:r,scale:n,widths:o,loader:s,height:i}){const a=o&&Array.isArray(o);if(a&&o.some(d=>isNaN(d)))throw new Error(`<Image/>: the 'widths' must be an array of numbers. Image: ${e}`);let c=1;t&&i&&(c=Number(i)/Number(t));let y=a?o:ie;!a&&t&&t<ie[ie.length-1]&&(y=ie.filter(d=>d<=t));const l=s||ut;return y.map(d=>`${l({src:e,width:d,height:r?Number(d)*c:void 0,crop:r,scale:n})} ${d??""}w`).join(", ")}function dt(e){var y;const{data:t,previewImageOptions:r,id:n=t.id,playsInline:o=!0,controls:s=!0,sourceProps:i={},...a}=e,c=ct({src:((y=t.previewImage)==null?void 0:y.url)??"",...r});if(!t.sources)throw new Error("<Video/> requires a 'data.sources' array");return u.createElement("video",{...a,id:n,playsInline:o,controls:s,poster:c},t.sources.map(l=>{if(!(l!=null&&l.url&&(l!=null&&l.mimeType)))throw new Error("<Video/> needs 'source.url' and 'source.mimeType'");return u.createElement("source",{...i,key:l.url,src:l.url,type:l.mimeType})}))}const ft={};function ln(e,t){const r=ft[e];if(r)return r;const n=new Promise((o,s)=>{const i=document.createElement("script");t!=null&&t.module?i.type="module":i.type="text/javascript",i.src=e,i.onload=()=>{o(!0)},i.onerror=()=>{s(!1)},(t==null?void 0:t.in)==="head"?document.head.appendChild(i):document.body.appendChild(i)});return ft[e]=n,n}function yt(e,t){const[r,n]=u.useState("loading"),o=JSON.stringify(t);return u.useEffect(()=>{async function s(){try{n("loading"),await ln(e,t),n("done")}catch{n("error")}}s().catch(()=>{n("error")})},[e,o,t]),r}function ht(e){var y,l,d;const[t,r]=u.useState(void 0),n=u.useCallback(p=>{r(p)},[]),{data:o,children:s,className:i,...a}=e,c=yt("https://unpkg.com/@google/model-viewer@v1.12.1/dist/model-viewer.min.js",{module:!0});return u.useEffect(()=>{if(t)return a.onError&&t.addEventListener("error",a.onError),a.onLoad&&t.addEventListener("load",a.onLoad),a.onPreload&&t.addEventListener("preload",a.onPreload),a.onModelVisibility&&t.addEventListener("model-visibility",a.onModelVisibility),a.onProgress&&t.addEventListener("progress",a.onProgress),a.onArStatus&&t.addEventListener("ar-status",a.onArStatus),a.onArTracking&&t.addEventListener("ar-tracking",a.onArTracking),a.onQuickLookButtonTapped&&t.addEventListener("quick-look-button-tapped",a.onQuickLookButtonTapped),a.onCameraChange&&t.addEventListener("camera-change",a.onCameraChange),a.onEnvironmentChange&&t.addEventListener("environment-change",a.onEnvironmentChange),a.onPlay&&t.addEventListener("play",a.onPlay),a.onPause&&t.addEventListener("ar-status",a.onPause),a.onSceneGraphReady&&t.addEventListener("scene-graph-ready",a.onSceneGraphReady),()=>{t!=null&&(a.onError&&t.removeEventListener("error",a.onError),a.onLoad&&t.removeEventListener("load",a.onLoad),a.onPreload&&t.removeEventListener("preload",a.onPreload),a.onModelVisibility&&t.removeEventListener("model-visibility",a.onModelVisibility),a.onProgress&&t.removeEventListener("progress",a.onProgress),a.onArStatus&&t.removeEventListener("ar-status",a.onArStatus),a.onArTracking&&t.removeEventListener("ar-tracking",a.onArTracking),a.onQuickLookButtonTapped&&t.removeEventListener("quick-look-button-tapped",a.onQuickLookButtonTapped),a.onCameraChange&&t.removeEventListener("camera-change",a.onCameraChange),a.onEnvironmentChange&&t.removeEventListener("environment-change",a.onEnvironmentChange),a.onPlay&&t.removeEventListener("play",a.onPlay),a.onPause&&t.removeEventListener("ar-status",a.onPause),a.onSceneGraphReady&&t.removeEventListener("scene-graph-ready",a.onSceneGraphReady))}},[t,a.onArStatus,a.onArTracking,a.onCameraChange,a.onEnvironmentChange,a.onError,a.onLoad,a.onModelVisibility,a.onPause,a.onPlay,a.onPreload,a.onProgress,a.onQuickLookButtonTapped,a.onSceneGraphReady]),c!=="done"?null:(l=(y=o.sources)==null?void 0:y[0])!=null&&l.url?u.createElement("model-viewer",{ref:n,...a,className:i,id:a.id??o.id,src:o.sources[0].url,alt:o.alt??null,"camera-controls":a.cameraControls??!0,poster:(a.poster||((d=o.previewImage)==null?void 0:d.url))??null,autoplay:a.autoplay??!0,loading:a.loading,reveal:a.reveal,ar:a.ar,"ar-modes":a.arModes,"ar-scale":a.arScale,"ar-placement":a.arPlacement,"ios-src":a.iosSrc,"touch-action":a.touchAction,"disable-zoom":a.disableZoom,"orbit-sensitivity":a.orbitSensitivity,"auto-rotate":a.autoRotate,"auto-rotate-delay":a.autoRotateDelay,"rotation-per-second":a.rotationPerSecond,"interaction-policy":a.interactionPolicy,"interaction-prompt":a.interactionPrompt,"interaction-prompt-style":a.interactionPromptStyle,"interaction-prompt-threshold":a.interactionPromptThreshold,"camera-orbit":a.cameraOrbit,"camera-target":a.cameraTarget,"field-of-view":a.fieldOfView,"max-camera-orbit":a.maxCameraOrbit,"min-camera-orbit":a.minCameraOrbit,"max-field-of-view":a.maxFieldOfView,"min-field-of-view":a.minFieldOfView,bounds:a.bounds,"interpolation-decay":a.interpolationDecay??100,"skybox-image":a.skyboxImage,"environment-image":a.environmentImage,exposure:a.exposure,"shadow-intensity":a.shadowIntensity??0,"shadow-softness":a.shadowSoftness??0,"animation-name":a.animationName,"animation-crossfade-duration":a.animationCrossfadeDuration,"variant-name":a.variantName,orientation:a.orientation,scale:a.scale},s):(console.error("<ModelViewer/> requires 'data.sources' prop to be an array, with an object that has a property 'url' on it. Rendering 'null'"),null)}function dn({data:e,mediaOptions:t,...r}){switch(e.__typename){case"MediaImage":return e.image?u.createElement(lt,{...r,...t==null?void 0:t.image,data:e.image}):(console.warn("<MediaFile/>: 'data.image' does not exist for __typename of 'MediaImage'; rendering 'null' by default."),null);case"Video":return u.createElement(dt,{...r,...t==null?void 0:t.video,data:e});case"ExternalVideo":return u.createElement(st,{...r,...t==null?void 0:t.externalVideo,data:e});case"Model3d":return u.createElement(ht,{...r,...t==null?void 0:t.modelViewer,data:e});default:return console.error("<MediaFile /> requires the '__typename' property to exist on the 'data' prop in order to render the matching sub-component for this type of media. Rendering 'null' by default"),null}}function fn(e){if(!e.type)return console.error("parseMetafield(): The 'type' field is required in order to parse the Metafield. Returning 'parsedValue' of 'null'"),{...e,parsedValue:null};switch(e.type){case"boolean":return{...e,parsedValue:e.value==="true"};case"collection_reference":case"file_reference":case"page_reference":case"product_reference":case"variant_reference":return{...e,parsedValue:e.reference};case"color":case"multi_line_text_field":case"single_line_text_field":case"url":return{...e,parsedValue:e.value};case"dimension":case"money":case"json":case"rating":case"volume":case"weight":case"list.color":case"list.dimension":case"list.number_integer":case"list.number_decimal":case"list.rating":case"list.single_line_text_field":case"list.url":case"list.volume":case"list.weight":{let t=null;try{t=gt(e.value??"")}catch{console.error("parseMetafield(): attempted to JSON.parse the 'metafield.value' property, but failed. Returning 'null' for 'parsedValue'"),t=null}return{...e,parsedValue:t}}case"date":case"date_time":return{...e,parsedValue:new Date(e.value??"")};case"list.date":case"list.date_time":{const t=gt((e==null?void 0:e.value)??"");return{...e,parsedValue:t.map(r=>new Date(r))}}case"number_decimal":case"number_integer":return{...e,parsedValue:Number(e.value)};case"list.collection_reference":case"list.file_reference":case"list.page_reference":case"list.product_reference":case"list.variant_reference":return{...e,parsedValue:q(e.references??void 0)};default:{const t=`parseMetafield(): the 'metafield.type' you passed in is not supported. Your type: "${e.type}". If you believe this is an error, please open an issue on GitHub.`;return console.error(`${t} Returning 'parsedValue' of 'null'`),{...e,parsedValue:null}}}}function gt(e){return String(e).includes("__proto__")?JSON.parse(e,(t,r)=>{if(t!=="__proto__")return r}):JSON.parse(e)}function yn(e){var y,l,d,p,m,h;const{priceType:t="regular",variantId:r,valueType:n="min",data:o,...s}=e;if(o==null)throw new Error("<ProductPrice/> requires a product as the 'data' prop");let i,a;const c=r?q((o==null?void 0:o.variants)??{}).find(P=>(P==null?void 0:P.id)===r)??null:null;if(t==="compareAt")if(r&&c){if(((y=c.compareAtPriceV2)==null?void 0:y.amount)===((l=c.priceV2)==null?void 0:l.amount))return null;i=c.compareAtPriceV2}else n==="max"?i=(d=o==null?void 0:o.compareAtPriceRange)==null?void 0:d.maxVariantPrice:i=(p=o==null?void 0:o.compareAtPriceRange)==null?void 0:p.minVariantPrice;else r&&c?(i=c.priceV2,n==="unit"&&(i=c.unitPrice,a=c.unitPriceMeasurement)):n==="max"?i=(m=o.priceRange)==null?void 0:m.maxVariantPrice:i=(h=o.priceRange)==null?void 0:h.minVariantPrice;return i?a?u.createElement(ae,{...s,data:i,measurement:a}):u.createElement(ae,{...s,data:i}):null}const hn="https://cdn.shopify.com/shopifycloud/shop-js/v1.0/client.js";function gn({variantIds:e,className:t,variantIdsAndQuantities:r,width:n,storeDomain:o}){const s=de(),i=o||(s==null?void 0:s.storeDomain),a=yt(hn);let c=[];if(!i||i===Be.storeDomain)throw new Error(mn);if(e&&r)throw new Error(pn);if(!e&&!r)throw new Error(mt);if(e)c=e.reduce((l,d)=>{const p=Y(d).id;return p&&l.push(p),l},[]);else if(r)c=r.reduce((l,d)=>{const p=Y(d==null?void 0:d.id).id;return p&&l.push(`${p}:${(d==null?void 0:d.quantity)??1}`),l},[]);else throw new Error(mt);if(c.length===0)throw new Error(En);const y=n?{"--shop-pay-button-width":n}:void 0;return u.createElement("div",{className:t,style:y},a==="done"&&u.createElement("shop-pay-button",{"store-url":i,variants:c.join(",")}))}const mn='You must pass a "storeDomain" prop to the "ShopPayButton" component, or wrap it in a "ShopifyProvider" component.',En='You must pass in "variantIds" in the form of ["gid://shopify/ProductVariant/1"]',mt='You must pass in either "variantIds" or "variantIdsAndQuantities" to ShopPayButton',pn="You must provide either a variantIds or variantIdsAndQuantities prop, but not both in the ShopPayButton component",Cn=60*60*24*360*1,Sn=60*30;function Tn(e){const{hasUserConsent:t=!1,domain:r=""}=e||{};u.useEffect(()=>{const n=ye(document.cookie);t?(me(B,n[B]||fe(),Cn,r),me(H,n[H]||fe(),Sn,r)):(me(B,"",0,r),me(H,"",0,r))})}function me(e,t,r,n){document.cookie=hr(e,t,{maxage:r,domain:n,samesite:"Lax",path:"/"})}E.AddToCartButton=Pr,E.AnalyticsEventName=Ie,E.AnalyticsPageType=ge,E.BuyNowButton=Wr,E.CartCheckoutButton=zr,E.CartCost=Kr,E.CartLinePrice=Xr,E.CartLineProvider=en,E.CartLineQuantity=tn,E.CartLineQuantityAdjustButton=rn,E.CartProvider=_r,E.ExternalVideo=st,E.Image=lt,E.MediaFile=dn,E.ModelViewer=ht,E.Money=ae,E.ProductPrice=yn,E.ProductProvider=wr,E.SHOPIFY_S=H,E.SHOPIFY_STOREFRONT_ID_HEADER=Ye,E.SHOPIFY_STOREFRONT_S_HEADER=Ge,E.SHOPIFY_STOREFRONT_Y_HEADER=je,E.SHOPIFY_Y=B,E.ShopPayButton=gn,E.ShopifyProvider=dr,E.ShopifySalesChannel=tt,E.Video=dt,E.createStorefrontClient=cr,E.flattenConnection=q,E.getClientBrowserParameters=jr,E.getShopifyCookies=ye,E.parseMetafield=fn,E.sendShopifyAnalytics=Hr,E.storefrontApiCustomScalars=nn,E.useCart=K,E.useCartLine=De,E.useMoney=at,E.useProduct=Je,E.useShop=de,E.useShopifyCookies=Tn,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
263
+ `,a.message)})}).catch(n=>{console.error(st,n)})}catch{return Promise.resolve()}}function Jr(){if(Mr("getClientBrowserParameters"))return{uniqueToken:"",visitToken:"",url:"",path:"",search:"",referrer:"",title:"",userAgent:"",navigationType:"",navigationApi:""};const[e,t]=zr(),r=me(document.cookie);return{uniqueToken:r[Y],visitToken:r[j],url:location.href,path:location.pathname,search:location.search,referrer:document.referrer,title:document.title,userAgent:navigator.userAgent,navigationType:e,navigationApi:t}}function Kr(){try{const e=(performance==null?void 0:performance.getEntriesByType)&&(performance==null?void 0:performance.getEntriesByType("navigation"));if(e&&e[0]){const t=window.performance.getEntriesByType("navigation")[0].type;return t&&t.toString()}}catch{}}function Xr(){var e,t;try{if(PerformanceNavigation&&((e=performance==null?void 0:performance.navigation)==null?void 0:e.type)!==null&&((t=performance==null?void 0:performance.navigation)==null?void 0:t.type)!==void 0){const r=performance.navigation.type;switch(r){case PerformanceNavigation.TYPE_NAVIGATE:return"navigate";case PerformanceNavigation.TYPE_RELOAD:return"reload";case PerformanceNavigation.TYPE_BACK_FORWARD:return"back_forward";default:return`unknown: ${r}`}}}catch{}}function zr(){try{let e="PerformanceNavigationTiming",t=Kr();return t||(t=Xr(),e="performance.navigation"),t?[t,e]:["unknown","unknown"]}catch{}return["error","error"]}function en(e){const{cartCreate:t,checkoutUrl:r}=z(),[n,o]=u.useState(!1),{quantity:a,variantId:s,onClick:i,attributes:c,children:h,...l}=e;u.useEffect(()=>{r&&(window.location.href=r)},[r]);const y=u.useCallback(()=>{o(!0),t({lines:[{quantity:a??1,merchandiseId:s,attributes:c}]})},[t,a,s,c]);return u.createElement(pe,{disabled:n??l.disabled,...l,onClick:i,defaultOnClick:y},h)}function tn(e){const[t,r]=u.useState(!1),{status:n,checkoutUrl:o}=z(),{children:a,...s}=e;return u.useEffect(()=>{t&&o&&n==="idle"&&(window.location.href=o)},[t,n,o]),u.createElement(pe,{...s,disabled:t||s.disabled,onClick:()=>r(!0)},a)}function ut(e){const{countryIsoCode:t,languageIsoCode:r}=ge(),n=`${r}-${t}`;if(!n)throw new Error("useMoney(): Unable to get 'locale' from 'useShop()', which means that 'locale' was not passed to '<ShopifyProvider/>'. 'locale' is required for 'useMoney()' to work");const o=parseFloat(e.amount),a=u.useMemo(()=>({style:"currency",currency:e.currencyCode}),[e.currencyCode]),s=te(n,a),i=te(n,{...a,currencyDisplay:"name"}),c=te(n,{...a,currencyDisplay:"narrowSymbol"}),h=te(n,{...a,minimumFractionDigits:0,maximumFractionDigits:0}),l=te(n),y=te(n,{minimumFractionDigits:0,maximumFractionDigits:0}),m=d=>d.type==="currency",p=u.useMemo(()=>({original:()=>e,currencyCode:()=>e.currencyCode,localizedString:()=>s().format(o),parts:()=>s().formatToParts(o),withoutTrailingZeros:()=>o%1===0?h().format(o):s().format(o),withoutTrailingZerosAndCurrency:()=>o%1===0?y().format(o):l().format(o),currencyName:()=>{var d;return((d=i().formatToParts(o).find(m))==null?void 0:d.value)??e.currencyCode},currencySymbol:()=>{var d;return((d=s().formatToParts(o).find(m))==null?void 0:d.value)??e.currencyCode},currencyNarrowSymbol:()=>{var d;return((d=c().formatToParts(o).find(m))==null?void 0:d.value)??""},amount:()=>s().formatToParts(o).filter(d=>["decimal","fraction","group","integer","literal"].includes(d.type)).map(d=>d.value).join("")}),[e,o,i,s,c,l,h,y]);return u.useMemo(()=>new Proxy(p,{get:(d,I)=>{var T;return(T=Reflect.get(d,I))==null?void 0:T.call(null)}}),[p])}function te(e,t){return u.useMemo(()=>{let r;return()=>r??(r=new Intl.NumberFormat(e,t))},[e,t])}function Ce({data:e,as:t,withoutCurrency:r,withoutTrailingZeros:n,measurement:o,measurementSeparator:a="/",...s}){if(!rn(e))throw new Error("<Money/> needs a valid 'data' prop that has 'amount' and 'currencyCode'");const i=ut(e),c=t??"div";let h=i.localizedString;return(r||n)&&(r&&!n?h=i.amount:!r&&n?h=i.withoutTrailingZeros:h=i.withoutTrailingZerosAndCurrency),u.createElement(c,{...s},h,o&&o.referenceUnit&&u.createElement(u.Fragment,null,a,o.referenceUnit))}function rn(e){return typeof e.amount=="string"&&!!e.amount&&typeof e.currencyCode=="string"&&!!e.currencyCode}function nn(e){const{cost:t}=z(),{amountType:r="total",children:n,...o}=e;let a;return r=="total"?a=t==null?void 0:t.totalAmount:r=="subtotal"?a=t==null?void 0:t.subtotalAmount:r=="tax"?a=t==null?void 0:t.totalTaxAmount:r=="duty"&&(a=t==null?void 0:t.totalDutyAmount),a==null?null:u.createElement(Ce,{...o,data:a},n)}const ct=u.createContext(null);function ke(){const e=u.useContext(ct);if(e==null)throw new Error("Expected a cart line context but none was found");return e}function on({children:e,line:t}){return u.createElement(ct.Provider,{value:t},e)}function an(e){const t=ke(),{as:r,...n}=e,o=r||"span";return u.createElement(o,{...n},t.quantity)}function sn(e){const{status:t,linesRemove:r,linesUpdate:n}=z(),o=ke(),{children:a,adjust:s,onClick:i,...c}=e,h=u.useCallback(()=>{if(s==="remove"){r([(o==null?void 0:o.id)??""]);return}const l=s==="decrease"?((o==null?void 0:o.quantity)??0)-1:((o==null?void 0:o.quantity)??0)+1;if(l<=0){r([(o==null?void 0:o.id)??""]);return}const y={id:(o==null?void 0:o.id)??"",quantity:l,attributes:(o==null?void 0:o.attributes)??[]};n([y])},[s,o==null?void 0:o.attributes,o==null?void 0:o.id,o==null?void 0:o.quantity,r,n]);return u.createElement(pe,{...c,onClick:i,defaultOnClick:h,disabled:typeof c.disabled<"u"?c.disabled:t!=="idle"},a)}const un={DateTime:"string",Decimal:"string",HTML:"string",URL:"string",Color:"string",UnsignedInt64:"string"};function lt(e){const{data:t,options:r,id:n=t.id,frameBorder:o="0",allow:a="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:s=!0,loading:i="lazy",...c}=e;if(!t.embedUrl)throw new Error("<ExternalVideo/> requires the 'embedUrl' property");let h=t.embedUrl;if(r){const l=new URL(t.embedUrl);for(const y of Object.keys(r))l.searchParams.set(y,r[y]);h=l.toString()}return u.createElement("iframe",{...c,id:n??t.embedUrl,title:t.alt??t.id??"external video",frameBorder:o,allow:a,allowFullScreen:s,src:h,loading:i})}const cn=`#graphql
264
+ fragment Image on Image {
265
+ altText
266
+ url
267
+ width
268
+ height
269
+ }
270
+ `,dt=V.forwardRef(({alt:e,aspectRatio:t,crop:r="center",data:n,decoding:o="async",height:a="auto",loader:s=ue,loaderOptions:i,loading:c="lazy",sizes:h,src:l,srcSetOptions:y={intervals:15,startingWidth:200,incrementSize:200,placeholderWidth:100},width:m="100%",widths:p,...d},I)=>{const T=V.useMemo(()=>{const D=n!=null&&n.width&&(n!=null&&n.height)?n==null?void 0:n.width:void 0,_=n!=null&&n.width&&(n!=null&&n.height)?n==null?void 0:n.height:void 0;return{width:D,height:_,unitsMatch:Boolean(ft(D,_))}},[n]),w=V.useMemo(()=>{const _=ce((m||"100%").toString()),v=`${_.number}${_.unit}`,U=a==null,L=U?null:ce(a.toString()),q=L?`${L.number}${L.unit}`:"",re=U?"auto":q,ne=l||(n==null?void 0:n.url),Q=n!=null&&n.altText&&!e?n==null?void 0:n.altText:e||"",b=t||(T.unitsMatch?[le(T.width),le(T.height)].join("/"):void 0);return{width:v,height:re,src:ne,alt:Q,aspectRatio:b}},[m,a,l,n,e,t,T,d==null?void 0:d.key]),{intervals:A,startingWidth:O,incrementSize:g,placeholderWidth:f}=y,C=V.useMemo(()=>fn(m,A,O,g),[m,A,O,g]);return yt(w.width)?V.createElement(ln,{aspectRatio:t,crop:r,decoding:o,height:a,imageWidths:C,loader:s,loading:c,normalizedProps:w,passthroughProps:d,ref:I,width:m}):V.createElement(dn,{aspectRatio:t,crop:r,decoding:o,imageWidths:C,loader:s,loading:c,normalizedProps:w,passthroughProps:d,placeholderWidth:f,ref:I,sizes:h})});function ln({aspectRatio:e,crop:t,decoding:r,height:n,imageWidths:o,loader:a=ue,loading:s,normalizedProps:i,passthroughProps:c,ref:h,width:l}){const y=V.useMemo(()=>{const m=le(l),p=le(n),d=e||(ft(i.width,i.height)?[m,p].join("/"):i.aspectRatio?i.aspectRatio:void 0),I=o===void 0?void 0:ht(o,d,t),T=p||(d&&m?m*(Ue(d)??1):void 0),w=gt(i.src,I,a),A=a({src:i.src,width:m,height:T,crop:i.height==="auto"?void 0:t});return{width:m,aspectRatio:d,height:T,srcSet:w,src:A}},[e,t,n,o,a,i,l]);return V.createElement("img",{ref:h,alt:i.alt,decoding:r,height:y.height,loading:s,src:y.src,srcSet:y.srcSet,width:y.width,style:{aspectRatio:y.aspectRatio,...c.style},...c})}function dn({crop:e,decoding:t,imageWidths:r,loader:n=ue,loading:o,normalizedProps:a,passthroughProps:s,placeholderWidth:i,ref:c,sizes:h}){const l=V.useMemo(()=>{const y=r===void 0?void 0:ht(r,a.aspectRatio,e),m=a.aspectRatio&&i?i*(Ue(a.aspectRatio)??1):void 0,p=gt(a.src,y,n),d=n({src:a.src,width:i,height:m,crop:e});return{placeholderHeight:m,srcSet:p,src:d}},[e,r,n,a,i]);return V.createElement("img",{ref:c,alt:a.alt,decoding:t,height:l.placeholderHeight,loading:o,sizes:h,src:l.src,srcSet:l.srcSet,width:i,...s,style:{width:a.width,aspectRatio:a.aspectRatio,...s.style}})}function ue({src:e,width:t,height:r,crop:n}){if(!e)return"";const o=new URL(e);return t&&o.searchParams.append("width",Math.round(t).toString()),r&&o.searchParams.append("height",Math.round(r).toString()),n&&o.searchParams.append("crop",n),o.href}function ft(e="100%",t="auto"){return ce(e.toString()).unit===ce(t.toString()).unit}function ce(e){const t=e.replace(/[0-9.]/g,""),r=parseFloat(e.replace(t,""));return{unit:t===""?r===void 0?"auto":"px":t,number:r}}function le(e){if(e===void 0)return;const{unit:t,number:r}=ce(e.toString());switch(t){case"em":return r*16;case"rem":return r*16;case"px":return r;case"":return r;default:return}}function yt(e){return typeof e=="number"||typeof e=="string"&&/\d(px|em|rem)$/.test(e)}function gt(e,t,r=ue){return e?(t==null?void 0:t.length)===0||!t?e:t.map((n,o)=>`${r({src:e,width:n.width,height:n.height,crop:n.crop})} ${t.length===3?`${o+1}x`:`${n.width??0}w`}`).join(", "):""}function fn(e="100%",t,r,n){const o=Array.from({length:t},(s,i)=>i*n+r),a=Array.from({length:3},(s,i)=>(i+1)*(le(e)??0));return yt(e)?a:o}function Ue(e){if(!e)return;const[t,r]=e.split("/");return 1/(Number(t)/Number(r))}function ht(e,t,r="center"){return e?e.map(o=>({width:o,height:t?o*(Ue(t)??1):void 0,crop:r})):void 0}function mt(e){var h;const{data:t,previewImageOptions:r,id:n=t.id,playsInline:o=!0,controls:a=!0,sourceProps:s={},...i}=e,c=ue({src:((h=t.previewImage)==null?void 0:h.url)??"",...r});if(!t.sources)throw new Error("<Video/> requires a 'data.sources' array");return u.createElement("video",{...i,id:n,playsInline:o,controls:a,poster:c},t.sources.map(l=>{if(!(l!=null&&l.url&&(l!=null&&l.mimeType)))throw new Error("<Video/> needs 'source.url' and 'source.mimeType'");return u.createElement("source",{...s,key:l.url,src:l.url,type:l.mimeType})}))}const pt={};function yn(e,t){const r=pt[e];if(r)return r;const n=new Promise((o,a)=>{const s=document.createElement("script");t!=null&&t.module?s.type="module":s.type="text/javascript",s.src=e,s.onload=()=>{o(!0)},s.onerror=()=>{a(!1)},(t==null?void 0:t.in)==="head"?document.head.appendChild(s):document.body.appendChild(s)});return pt[e]=n,n}function Et(e,t){const[r,n]=u.useState("loading"),o=JSON.stringify(t);return u.useEffect(()=>{async function a(){try{n("loading"),await yn(e,t),n("done")}catch{n("error")}}a().catch(()=>{n("error")})},[e,o,t]),r}function Ct(e){var h,l,y;const[t,r]=u.useState(void 0),n=u.useCallback(m=>{r(m)},[]),{data:o,children:a,className:s,...i}=e,c=Et("https://unpkg.com/@google/model-viewer@v1.12.1/dist/model-viewer.min.js",{module:!0});return u.useEffect(()=>{if(t)return i.onError&&t.addEventListener("error",i.onError),i.onLoad&&t.addEventListener("load",i.onLoad),i.onPreload&&t.addEventListener("preload",i.onPreload),i.onModelVisibility&&t.addEventListener("model-visibility",i.onModelVisibility),i.onProgress&&t.addEventListener("progress",i.onProgress),i.onArStatus&&t.addEventListener("ar-status",i.onArStatus),i.onArTracking&&t.addEventListener("ar-tracking",i.onArTracking),i.onQuickLookButtonTapped&&t.addEventListener("quick-look-button-tapped",i.onQuickLookButtonTapped),i.onCameraChange&&t.addEventListener("camera-change",i.onCameraChange),i.onEnvironmentChange&&t.addEventListener("environment-change",i.onEnvironmentChange),i.onPlay&&t.addEventListener("play",i.onPlay),i.onPause&&t.addEventListener("ar-status",i.onPause),i.onSceneGraphReady&&t.addEventListener("scene-graph-ready",i.onSceneGraphReady),()=>{t!=null&&(i.onError&&t.removeEventListener("error",i.onError),i.onLoad&&t.removeEventListener("load",i.onLoad),i.onPreload&&t.removeEventListener("preload",i.onPreload),i.onModelVisibility&&t.removeEventListener("model-visibility",i.onModelVisibility),i.onProgress&&t.removeEventListener("progress",i.onProgress),i.onArStatus&&t.removeEventListener("ar-status",i.onArStatus),i.onArTracking&&t.removeEventListener("ar-tracking",i.onArTracking),i.onQuickLookButtonTapped&&t.removeEventListener("quick-look-button-tapped",i.onQuickLookButtonTapped),i.onCameraChange&&t.removeEventListener("camera-change",i.onCameraChange),i.onEnvironmentChange&&t.removeEventListener("environment-change",i.onEnvironmentChange),i.onPlay&&t.removeEventListener("play",i.onPlay),i.onPause&&t.removeEventListener("ar-status",i.onPause),i.onSceneGraphReady&&t.removeEventListener("scene-graph-ready",i.onSceneGraphReady))}},[t,i.onArStatus,i.onArTracking,i.onCameraChange,i.onEnvironmentChange,i.onError,i.onLoad,i.onModelVisibility,i.onPause,i.onPlay,i.onPreload,i.onProgress,i.onQuickLookButtonTapped,i.onSceneGraphReady]),c!=="done"?null:(l=(h=o.sources)==null?void 0:h[0])!=null&&l.url?u.createElement("model-viewer",{ref:n,...i,className:s,id:i.id??o.id,src:o.sources[0].url,alt:o.alt??null,"camera-controls":i.cameraControls??!0,poster:(i.poster||((y=o.previewImage)==null?void 0:y.url))??null,autoplay:i.autoplay??!0,loading:i.loading,reveal:i.reveal,ar:i.ar,"ar-modes":i.arModes,"ar-scale":i.arScale,"ar-placement":i.arPlacement,"ios-src":i.iosSrc,"touch-action":i.touchAction,"disable-zoom":i.disableZoom,"orbit-sensitivity":i.orbitSensitivity,"auto-rotate":i.autoRotate,"auto-rotate-delay":i.autoRotateDelay,"rotation-per-second":i.rotationPerSecond,"interaction-policy":i.interactionPolicy,"interaction-prompt":i.interactionPrompt,"interaction-prompt-style":i.interactionPromptStyle,"interaction-prompt-threshold":i.interactionPromptThreshold,"camera-orbit":i.cameraOrbit,"camera-target":i.cameraTarget,"field-of-view":i.fieldOfView,"max-camera-orbit":i.maxCameraOrbit,"min-camera-orbit":i.minCameraOrbit,"max-field-of-view":i.maxFieldOfView,"min-field-of-view":i.minFieldOfView,bounds:i.bounds,"interpolation-decay":i.interpolationDecay??100,"skybox-image":i.skyboxImage,"environment-image":i.environmentImage,exposure:i.exposure,"shadow-intensity":i.shadowIntensity??0,"shadow-softness":i.shadowSoftness??0,"animation-name":i.animationName,"animation-crossfade-duration":i.animationCrossfadeDuration,"variant-name":i.variantName,orientation:i.orientation,scale:i.scale},a):(console.error("<ModelViewer/> requires 'data.sources' prop to be an array, with an object that has a property 'url' on it. Rendering 'null'"),null)}function gn({data:e,mediaOptions:t,...r}){switch(e.__typename){case"MediaImage":return e.image?u.createElement(dt,{...r,...t==null?void 0:t.image,data:e.image}):(console.warn("<MediaFile/>: 'data.image' does not exist for __typename of 'MediaImage'; rendering 'null' by default."),null);case"Video":return u.createElement(mt,{...r,...t==null?void 0:t.video,data:e});case"ExternalVideo":return u.createElement(lt,{...r,...t==null?void 0:t.externalVideo,data:e});case"Model3d":return u.createElement(Ct,{...r,...t==null?void 0:t.modelViewer,data:e});default:return console.error("<MediaFile /> requires the '__typename' property to exist on the 'data' prop in order to render the matching sub-component for this type of media. Rendering 'null' by default"),null}}function hn(e){if(!e.type)return console.error("parseMetafield(): The 'type' field is required in order to parse the Metafield. Returning 'parsedValue' of 'null'"),{...e,parsedValue:null};switch(e.type){case"boolean":return{...e,parsedValue:e.value==="true"};case"collection_reference":case"file_reference":case"page_reference":case"product_reference":case"variant_reference":return{...e,parsedValue:e.reference};case"color":case"multi_line_text_field":case"single_line_text_field":case"url":return{...e,parsedValue:e.value};case"dimension":case"money":case"json":case"rating":case"volume":case"weight":case"list.color":case"list.dimension":case"list.number_integer":case"list.number_decimal":case"list.rating":case"list.single_line_text_field":case"list.url":case"list.volume":case"list.weight":{let t=null;try{t=St(e.value??"")}catch{console.error("parseMetafield(): attempted to JSON.parse the 'metafield.value' property, but failed. Returning 'null' for 'parsedValue'"),t=null}return{...e,parsedValue:t}}case"date":case"date_time":return{...e,parsedValue:new Date(e.value??"")};case"list.date":case"list.date_time":{const t=St((e==null?void 0:e.value)??"");return{...e,parsedValue:t.map(r=>new Date(r))}}case"number_decimal":case"number_integer":return{...e,parsedValue:Number(e.value)};case"list.collection_reference":case"list.file_reference":case"list.page_reference":case"list.product_reference":case"list.variant_reference":return{...e,parsedValue:B(e.references??void 0)};default:{const t=`parseMetafield(): the 'metafield.type' you passed in is not supported. Your type: "${e.type}". If you believe this is an error, please open an issue on GitHub.`;return console.error(`${t} Returning 'parsedValue' of 'null'`),{...e,parsedValue:null}}}}function St(e){return String(e).includes("__proto__")?JSON.parse(e,(t,r)=>{if(t!=="__proto__")return r}):JSON.parse(e)}function mn(e){var h,l,y,m,p,d;const{priceType:t="regular",variantId:r,valueType:n="min",data:o,...a}=e;if(o==null)throw new Error("<ProductPrice/> requires a product as the 'data' prop");let s,i;const c=r?B((o==null?void 0:o.variants)??{}).find(I=>(I==null?void 0:I.id)===r)??null:null;if(t==="compareAt")if(r&&c){if(((h=c.compareAtPriceV2)==null?void 0:h.amount)===((l=c.priceV2)==null?void 0:l.amount))return null;s=c.compareAtPriceV2}else n==="max"?s=(y=o==null?void 0:o.compareAtPriceRange)==null?void 0:y.maxVariantPrice:s=(m=o==null?void 0:o.compareAtPriceRange)==null?void 0:m.minVariantPrice;else r&&c?(s=c.priceV2,n==="unit"&&(s=c.unitPrice,i=c.unitPriceMeasurement)):n==="max"?s=(p=o.priceRange)==null?void 0:p.maxVariantPrice:s=(d=o.priceRange)==null?void 0:d.minVariantPrice;return s?i?u.createElement(Ce,{...a,data:s,measurement:i}):u.createElement(Ce,{...a,data:s}):null}const pn="https://cdn.shopify.com/shopifycloud/shop-js/v1.0/client.js";function En({variantIds:e,className:t,variantIdsAndQuantities:r,width:n,storeDomain:o}){const a=ge(),s=o||(a==null?void 0:a.storeDomain),i=Et(pn);let c=[];if(!s||s===je.storeDomain)throw new Error(Cn);if(e&&r)throw new Error(Tn);if(!e&&!r)throw new Error(Tt);if(e)c=e.reduce((l,y)=>{const m=G(y).id;return m&&l.push(m),l},[]);else if(r)c=r.reduce((l,y)=>{const m=G(y==null?void 0:y.id).id;return m&&l.push(`${m}:${(y==null?void 0:y.quantity)??1}`),l},[]);else throw new Error(Tt);if(c.length===0)throw new Error(Sn);const h=n?{"--shop-pay-button-width":n}:void 0;return u.createElement("div",{className:t,style:h},i==="done"&&u.createElement("shop-pay-button",{"store-url":s,variants:c.join(",")}))}const Cn='You must pass a "storeDomain" prop to the "ShopPayButton" component, or wrap it in a "ShopifyProvider" component.',Sn='You must pass in "variantIds" in the form of ["gid://shopify/ProductVariant/1"]',Tt='You must pass in either "variantIds" or "variantIdsAndQuantities" to ShopPayButton',Tn="You must provide either a variantIds or variantIdsAndQuantities prop, but not both in the ShopPayButton component",_n=60*60*24*360*1,An=60*30;function vn(e){const{hasUserConsent:t=!1,domain:r=""}=e||{};u.useEffect(()=>{const n=me(document.cookie);t?(Se(Y,n[Y]||he(),_n,r),Se(j,n[j]||he(),An,r)):(Se(Y,"",0,r),Se(j,"",0,r))})}function Se(e,t,r,n){document.cookie=Cr(e,t,{maxage:r,domain:n,samesite:"Lax",path:"/"})}E.AddToCartButton=Nr,E.AnalyticsEventName=Pe,E.AnalyticsPageType=Ee,E.BuyNowButton=en,E.CartCheckoutButton=tn,E.CartCost=nn,E.CartLineProvider=on,E.CartLineQuantity=an,E.CartLineQuantityAdjustButton=sn,E.CartProvider=wr,E.ExternalVideo=lt,E.IMAGE_FRAGMENT=cn,E.Image=dt,E.MediaFile=gn,E.ModelViewer=Ct,E.Money=Ce,E.ProductPrice=mn,E.ProductProvider=Ur,E.SHOPIFY_S=j,E.SHOPIFY_STOREFRONT_ID_HEADER=Ze,E.SHOPIFY_STOREFRONT_S_HEADER=Qe,E.SHOPIFY_STOREFRONT_Y_HEADER=We,E.SHOPIFY_Y=Y,E.ShopPayButton=En,E.ShopifyProvider=mr,E.ShopifySalesChannel=ot,E.Video=mt,E.createStorefrontClient=gr,E.flattenConnection=B,E.getClientBrowserParameters=Jr,E.getShopifyCookies=me,E.parseMetafield=hn,E.sendShopifyAnalytics=Wr,E.storefrontApiCustomScalars=un,E.useCart=z,E.useCartLine=ke,E.useMoney=ut,E.useProduct=et,E.useShop=ge,E.useShopifyCookies=vn,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
264
271
  //# sourceMappingURL=hydrogen-react.prod.js.map