"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[6],{4:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LazyImage=function({src:e,initialWidth:t,fullSizeWidth:o,cssClass:n,alt:c="",width:a,height:u,style:l}){const r=i(e,t,o);return a&&u?(0,s.jsx)("img",{src:r,class:n,alt:c,width:a,height:u,style:l}):(0,s.jsx)("img",{src:r,class:n,alt:c,style:l})},t.useBestImage=i;const s=o(0),n=(o(1),o(7)),c=o(3);function i(e,t,o){const s=(0,n.getFastImage)(e,t),i=(0,n.getFastImage)(e,o),[a,u]=(0,c.useState)({});(0,c.useEffect)((()=>{if(document){const e=document.createElement("img");e.src=i,e.onload=()=>u(Object.assign(Object.assign({},a),{[i]:!0}))}}),[i]);const l=(0,c.useMemo)((()=>a[i]?i:s),[e,t,o,a]);return(0,c.useEffect)((()=>{if(document){const e=document.createElement("img");e.src=i,e.onload=()=>u(Object.assign(Object.assign({},a),{[i]:!0}))}}),[i]),l}},38:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getColorOption=i,t.getSelectedColor=function({selectedOptions:e}){var t;return null===(t=i(e))||void 0===t?void 0:t.value},t.hasColor=function({product:e,color:t}){var o;return t&&(null===(o=i(e.options))||void 0===o?void 0:o.values.includes(t))},t.getSwatchStyle=a,t.useSwatchStyle=function({value:e,isColorOption:t,hasSwatch:o,swatchImage:s,getHexForOptionColor:i}){const u=i(e),l=(0,n.useBestImage)(null!=s?s:"",80,250),r=(0,c.useMemo)((()=>a(l)),[l]);return t?u:o?{hexColor:void 0,swatchStyle:r}:{hexColor:void 0,swatchStyle:void 0}};const s=o(7),n=o(4),c=o(3);function i(e){return e.find((({name:e})=>"Color"===e))}function a(e,t){if(e)return{backgroundImage:`url("${t?(0,s.getFastImage)(e,t):e}")`,backgroundPosition:"center",backgroundSize:"cover"}}}}]);