{
  "version": 3,
  "sources": ["/cdn/shop/t/465/assets/custom.js?b=1792110104088"],
  "sourcesContent": ["/**\n * Custom JavaScript for MebleFurniture.com\n * Cleaned up: Removed deprecated mutation events, console.logs, and optimized resize handlers\n */\n\njQuery(document).ready(function($) {\n  // Use MutationObserver instead of deprecated DOMNodeInserted/DOMNodeRemoved\n  if (typeof MutationObserver !== 'undefined') {\n    var observer = new MutationObserver(function(mutations) {\n      mutations.forEach(function(mutation) {\n        mutation.addedNodes.forEach(function(node) {\n          if (node.className && node.className.indexOf('mfp-wrap') !== -1) {\n            var heightT = window.innerHeight;\n            setTimeout(function() {\n              $('body').css({\n                'overflow': 'hidden',\n                'overflow-y': 'hidden',\n                'height': heightT + 'px'\n              });\n            }, 500);\n          }\n        });\n        mutation.removedNodes.forEach(function(node) {\n          if (node.className && node.className.indexOf('mfp-bg') !== -1 && \n              node.className.indexOf('mfp-removing') !== -1) {\n            $('body').css('overflow-y', 'auto');\n          }\n        });\n      });\n    });\n    \n    observer.observe(document.body, {\n      childList: true,\n      subtree: false\n    });\n  }\n\n  // Debounced resize handler for height tracking\n  var initial = window.innerHeight;\n  var resizeTimeout;\n  \n  $(window).on('resize.customHeight', function() {\n    clearTimeout(resizeTimeout);\n    resizeTimeout = setTimeout(function() {\n      var currentHeight = window.innerHeight;\n      if (currentHeight > initial) {\n        $('body').addClass('wc-height-increased');\n      } else {\n        $('body').removeClass('wc-height-increased');\n      }\n    }, 100);\n  });\n\n  // Tab functionality\n  $('.first-tab-active').addClass('active');\n  $(document).on('click', '.info-tabs .open-bio', function() {\n    $('.first-tab-active').removeClass('active');\n    $('.open-bio').removeClass('first-tab-active');\n    $(document).find('.bio-more').removeClass('active-description-tab');\n    // v21: panels may have just been hidden by the class removal above; keep every toggle's state truthful\n    $('.info-tabs .open-bio').each(function() {\n      var $panel = $(this).next('.bio-more');\n      $(this).attr('aria-expanded', $panel.is(':visible') ? 'true' : 'false');\n      $(this).toggleClass('active', $panel.is(':visible'));\n    });\n  });\n\n  // v21: Magnific Popup lightboxes (gallery zoom, dimensions diagram) announce as dialogs,\n  // name their close button, and hand focus back to the element that opened them.\n  var mfpOpener = null;\n  $(document).on('mfpBeforeOpen', function() {\n    mfpOpener = document.activeElement;\n  });\n  $(document).on('mfpOpen', function() {\n    var $wrap = $('.mfp-wrap');\n    $wrap.attr({ 'role': 'dialog', 'aria-modal': 'true', 'aria-label': 'Image viewer' });\n    $wrap.find('.mfp-close').attr('aria-label', 'Close image viewer');\n    $wrap.find('.mfp-arrow-left').attr('aria-label', 'Previous image');\n    $wrap.find('.mfp-arrow-right').attr('aria-label', 'Next image');\n  });\n  $(document).on('mfpImageLoadComplete', function() {\n    var mfp = $.magnificPopup.instance;\n    if (!mfp || !mfp.currItem) return;\n    var alt = (mfp.currItem.data && mfp.currItem.data.title) || (mfp.currItem.el && mfp.currItem.el.attr('title')) || (mfp.currItem.el && mfp.currItem.el.attr('aria-label')) || 'Product image';\n    mfp.content.find('img.mfp-img').attr('alt', alt);\n  });\n  $(document).on('mfpClose', function() {\n    if (mfpOpener && typeof mfpOpener.focus === 'function' && document.contains(mfpOpener)) {\n      var el = mfpOpener;\n      setTimeout(function() { el.focus(); }, 0);\n    }\n    mfpOpener = null;\n  });\n\n  // Move search form on mobile\n  if (window.innerWidth <= 1200) {\n    $('#header > form').appendTo('#header > .header_bot');\n  }\n\n  // FIX: Force Stamped rating to stay big after widget loads\n  function fixStampedRatingSize() {\n    // Try multiple possible selectors - including the strong tag inside\n    var selectors = [\n      '.stamped-summary-text-1',\n      '.stamped-summary-text-1 strong',\n      '.stamped-summary-text-1 > strong',\n      '#stamped-main-widget .stamped-summary-text-1',\n      '#stamped-main-widget .stamped-summary-text-1 strong',\n      '.summary-rating-num',\n      '.stamped-summary-text span:first-child',\n      '[data-widget-style] .stamped-summary-text-1',\n      '.stamped-summary .stamped-summary-text > span:first-child'\n    ];\n    \n    selectors.forEach(function(sel) {\n      var els = document.querySelectorAll(sel);\n      els.forEach(function(el) {\n        el.style.setProperty('font-size', '24px', 'important');\n        el.style.setProperty('font-weight', '700', 'important');\n        el.style.setProperty('color', '#111', 'important');\n        el.style.setProperty('line-height', '1.1', 'important');\n      });\n    });\n  }\n  \n  // Run repeatedly to catch Stamped's async rendering\n  var fixIntervals = [500, 1000, 1500, 2000, 2500, 3000, 4000, 5000];\n  fixIntervals.forEach(function(ms) {\n    setTimeout(fixStampedRatingSize, ms);\n  });\n  \n  // Also run on any DOM changes within Stamped widget\n  var stampedObserver = new MutationObserver(function() {\n    fixStampedRatingSize();\n  });\n  \n  function startObservingStamped() {\n    var widget = document.getElementById('stamped-main-widget');\n    if (widget) {\n      stampedObserver.observe(widget, { childList: true, subtree: true, attributes: true });\n      fixStampedRatingSize();\n    } else {\n      setTimeout(startObservingStamped, 500);\n    }\n  }\n  startObservingStamped();\n});\n\n/* ==========================================================================\n   v24: full-site audit fixes\n   ========================================================================== */\n(function () {\n  'use strict';\n\n  // 1. Collection description accordions (jquery_accordion.js) are click-only <div>s.\n  //    Wrap each header's content in a real <button> so Enter / Space work and state is announced.\n  //    The click bubbles to the <div>, so the original plugin keeps doing the open/close.\n  function initAccordions() {\n    var heads = document.querySelectorAll('.accordion-collection .accordion');\n    Array.prototype.forEach.call(heads, function (head, i) {\n      if (head.querySelector('.acc-toggle')) return;\n      var panel = head.nextElementSibling;\n      if (panel && !panel.id) panel.id = (head.id || 'accordion-' + i) + '-panel';\n      var btn = document.createElement('button');\n      btn.type = 'button';\n      btn.className = 'acc-toggle';\n      if (panel) btn.setAttribute('aria-controls', panel.id);\n      while (head.firstChild) btn.appendChild(head.firstChild);\n      head.appendChild(btn);\n      var sync = function () { btn.setAttribute('aria-expanded', head.classList.contains('accordion-open') ? 'true' : 'false'); };\n      sync();\n      if (window.MutationObserver) new MutationObserver(sync).observe(head, { attributes: true, attributeFilter: ['class'] });\n    });\n  }\n\n  // 2. Stamped renders review photo links with no accessible name\n  function labelStampedPhotos() {\n    var links = document.querySelectorAll('a.stamped-review-link-photo:not([aria-label])');\n    Array.prototype.forEach.call(links, function (a, i) {\n      a.setAttribute('aria-label', 'Customer review photo ' + (i + 1) + ' (opens in new tab)');\n      var img = a.querySelector('img');\n      if (img && !img.hasAttribute('alt')) img.setAttribute('alt', '');\n    });\n  }\n\n  // 3. Links that open a new tab say so (hidden text, or appended to an existing aria-label)\n  function labelNewTabLinks() {\n    var links = document.querySelectorAll('a[target=\"_blank\"]:not([data-newtab])');\n    Array.prototype.forEach.call(links, function (a) {\n      a.setAttribute('data-newtab', '');\n      if (a.closest('.klaviyo-form, [class*=\"kl-private\"], [class*=\"kl-teaser\"], a.stamped-review-link-photo')) return;\n      var label = a.getAttribute('aria-label');\n      if (label) {\n        if (!/new (tab|window)/i.test(label)) a.setAttribute('aria-label', label + ' (opens in new tab)');\n        return;\n      }\n      if (/new (tab|window)/i.test(a.textContent)) return;\n      var s = document.createElement('span');\n      s.className = 'visually-hidden';\n      s.textContent = ' (opens in new tab)';\n      a.appendChild(s);\n    });\n  }\n\n  // 4. Header and mobile cart links: label follows the item count the theme updates after add-to-cart\n  function syncCartLabels() {\n    var links = document.querySelectorAll('[data-cart-link]');\n    Array.prototype.forEach.call(links, function (a) {\n      var c = a.querySelector('.count, .mobile-sticky-cart-count');\n      var n = c ? parseInt(c.textContent, 10) : NaN;\n      if (isNaN(n)) return;\n      var label = 'Cart, ' + n + (n === 1 ? ' item' : ' items');\n      if (a.getAttribute('aria-label') !== label) a.setAttribute('aria-label', label);\n    });\n  }\n\n  function runAll() { initAccordions(); labelStampedPhotos(); labelNewTabLinks(); syncCartLabels(); }\n\n  function start() {\n    runAll();\n    if (!window.MutationObserver) return;\n    var timer = null;\n    new MutationObserver(function () {\n      clearTimeout(timer);\n      timer = setTimeout(runAll, 300);\n    }).observe(document.body, { childList: true, subtree: true, characterData: true });\n  }\n\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();\n})();\n"],
  "mappings": "AAKA,OAAO,QAAQ,EAAE,MAAM,SAAS,EA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