{
  "version": 3,
  "sources": ["/cdn/shop/t/1/assets/zoalin-pc-card-image-ratio-restore-20260727.js?zoalin_pc_card_ratio_restore_js=20260727_1305_original"],
  "sourcesContent": ["/* ZOALIN_PC_CARD_IMAGE_RATIO_RESTORE_JS_ORIGINAL_20260727_1305 */\n(function () {\n  var marker = 'ZOALIN_PC_CARD_IMAGE_RATIO_RESTORE_JS_ORIGINAL_20260727_1305';\n  var styleId = 'zoalin-pc-card-image-ratio-restore-js-20260727';\n\n  function isPcNonProduct() {\n    return (\n      document.body &&\n      !document.body.classList.contains('template-product') &&\n      window.matchMedia &&\n      window.matchMedia('(min-width: 990px) and (hover: hover) and (pointer: fine)').matches\n    );\n  }\n\n  function setImportant(node, property, value) {\n    if (node && node.style && value) node.style.setProperty(property, value, 'important');\n  }\n\n  function normalizeRatio(value) {\n    if (!value) return '';\n    value = String(value).trim();\n    return value || '';\n  }\n\n  function ratioFromImage(gallery) {\n    var img = gallery && gallery.querySelector && gallery.querySelector('img');\n    if (!img) return '';\n\n    var width = img.naturalWidth || parseFloat(img.getAttribute('width')) || 0;\n    var height = img.naturalHeight || parseFloat(img.getAttribute('height')) || 0;\n    if (!width || !height) return '';\n\n    return width + ' / ' + height;\n  }\n\n  function ensureFallbackStyle() {\n    if (document.getElementById(styleId)) return;\n\n    var css = [\n      '@media screen and (min-width:990px) and (hover:hover) and (pointer:fine){',\n      'html body:not(.template-product) #MainContent :is(product-card,.product-card){min-width:0!important;max-width:100%!important;box-sizing:border-box!important}',\n      'html body:not(.template-product) #MainContent :is(product-card,.product-card) .card-gallery{width:100%!important;max-width:100%!important;min-width:0!important;min-height:0!important;overflow:hidden!important;background:#f7f5f2!important}',\n      'html body.template-index #MainContent :is(.zoalin-featured-card__media,.zoalin-product-card__media){aspect-ratio:4/5!important;height:auto!important;overflow:hidden!important;background:#f7f5f1!important}',\n      'html body.template-index #MainContent :is(.zoalin-featured-card__media,.zoalin-product-card__media) img{width:100%!important;height:100%!important;object-fit:contain!important;object-position:center center!important}',\n      '}'\n    ].join('');\n\n    var style = document.createElement('style');\n    style.id = styleId;\n    style.textContent = css;\n    (document.head || document.documentElement).appendChild(style);\n  }\n\n  function restoreThemeCards(root) {\n    var scope = root && root.querySelectorAll ? root : document;\n    Array.prototype.forEach.call(scope.querySelectorAll('#MainContent :is(product-card,.product-card) .card-gallery'), function (gallery) {\n      var media = gallery.querySelector('.product-media-container');\n      var ratio = normalizeRatio(\n        (media && media.style && media.style.getPropertyValue('--media-preview-ratio')) ||\n        (gallery.style && gallery.style.getPropertyValue('--gallery-aspect-ratio'))\n      ) || ratioFromImage(gallery);\n\n      setImportant(gallery, 'width', '100%');\n      setImportant(gallery, 'max-width', '100%');\n      setImportant(gallery, 'min-width', '0');\n      setImportant(gallery, 'min-height', '0');\n      setImportant(gallery, 'max-height', 'none');\n\n      if (!ratio) return;\n\n      setImportant(gallery, '--gallery-aspect-ratio', ratio);\n      setImportant(gallery, 'aspect-ratio', ratio);\n      setImportant(gallery, 'height', 'auto');\n      setImportant(gallery, 'min-height', '0');\n      setImportant(gallery, 'max-height', 'none');\n\n      Array.prototype.forEach.call(gallery.querySelectorAll('slideshow-component,slideshow-container,slideshow-slides,slideshow-slide,.product-media-container,.product-media-constraint-wrapper,.product-media'), function (node) {\n        setImportant(node, '--gallery-aspect-ratio', ratio);\n        setImportant(node, '--media-preview-ratio', ratio);\n        setImportant(node, 'aspect-ratio', ratio);\n        setImportant(node, 'height', '100%');\n        setImportant(node, 'min-height', '0');\n        setImportant(node, 'max-height', 'none');\n      });\n\n      Array.prototype.forEach.call(gallery.querySelectorAll('img,video,iframe,.deferred-media__poster-image,.product-media__image'), function (node) {\n        setImportant(node, 'width', '100%');\n        setImportant(node, 'height', '100%');\n        setImportant(node, 'object-fit', 'contain');\n        setImportant(node, 'object-position', 'center center');\n        if (node.tagName === 'IMG' && !node.dataset.zoalinRatioRestoreLoadBound) {\n          node.dataset.zoalinRatioRestoreLoadBound = 'true';\n          node.addEventListener('load', function () {\n            schedule(gallery);\n          }, { once: true });\n        }\n      });\n    });\n  }\n\n  function restoreHomeCards() {\n    Array.prototype.forEach.call(document.querySelectorAll('#MainContent :is(.zoalin-featured-card__media,.zoalin-product-card__media)'), function (media) {\n      setImportant(media, 'aspect-ratio', '4 / 5');\n      setImportant(media, 'height', 'auto');\n      setImportant(media, 'min-height', '0');\n      setImportant(media, 'max-height', 'none');\n\n      Array.prototype.forEach.call(media.querySelectorAll('img'), function (img) {\n        setImportant(img, 'width', '100%');\n        setImportant(img, 'height', '100%');\n        setImportant(img, 'object-fit', 'contain');\n        setImportant(img, 'object-position', 'center center');\n      });\n    });\n  }\n\n  function apply(root) {\n    if (!isPcNonProduct()) return;\n    ensureFallbackStyle();\n    document.documentElement.setAttribute('data-zoalin-pc-card-image-ratio-restore', marker);\n    restoreThemeCards(root);\n    restoreHomeCards();\n  }\n\n  function schedule(root) {\n    [0, 80, 240, 700, 1400, 2800].forEach(function (delay) {\n      window.setTimeout(function () {\n        apply(root);\n      }, delay);\n    });\n  }\n\n  apply(document);\n  schedule(document);\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', function () { schedule(document); });\n  window.addEventListener('load', function () { schedule(document); });\n  window.addEventListener('resize', function () { schedule(document); });\n\n  new MutationObserver(function (mutations) {\n    mutations.forEach(function (mutation) {\n      Array.prototype.forEach.call(mutation.addedNodes, function (node) {\n        if (node && node.nodeType === 1) schedule(node);\n      });\n    });\n  }).observe(document.documentElement, { childList: true, subtree: true });\n})();\n"],
  "mappings": "CACC,UAAY,CACX,IAAI,OAAS,+DACT,QAAU,iDAEd,SAAS,gBAAiB,CACxB,OACE,SAAS,MACT,CAAC,SAAS,KAAK,UAAU,SAAS,kBAAkB,GACpD,OAAO,YACP,OAAO,WAAW,2DAA2D,EAAE,OAEnF,CAEA,SAAS,aAAa,KAAM,SAAU,MAAO,CACvC,MAAQ,KAAK,OAAS,OAAO,KAAK,MAAM,YAAY,SAAU,MAAO,WAAW,CACtF,CAEA,SAAS,eA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