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,EAAO,GAAG,SAAU,EACtB,CA7CI,CAAuB,EAAS,EAClC,CAAE,MAAO,GAEgB,oBAAZ,SAA2B,QAAQ,OAC5C,QAAQ,MAAM,gCAAiC,EAEnD,CACF,CAxBA,OAAO,iBAAiB,UAjBxB,WACE,aAAa,GACb,EAAgB,YAAW,KACzB,MAAM,EAAe,OAAO,WAGxB,IAAiB,IACnB,EAAY,EAER,OAAO,kBAAoB,OAAO,iBAAiB,cACrD,OAAO,iBAAiB,eAE5B,GACC,IACL,IAqMA,OAAO,iBAAmB,CAExB,aAAc,WACZ,GAAsB,oBAAX,OAAwB,OAEnC,MAAM,EAAiB,SAAS,iBAC9B,0BAEF,EAAe,SAAS,IAClB,EAAQ,gBACV,EAAQ,eAAe,SAAQ,GAAM,EACvC,IAGF,YAAW,KACT,EAAe,SAAQ,CAAC,EAAS,KAC/B,EAAiB,EAAe,GAChC,GACD,GACL,EAGA,YAAa,SAAU,GACrB,MAAM,EAAiB,SAAS,iBAC9B,0BAEF,OAAI,EAAe,IAAU,EAAe,GAAO,eAC1C,EAAe,GAAO,eAExB,IACT,EAEH,CApRD","file":"/gh/nocodesupplyco/mast@master/slider.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /gh/nocodesupplyco/mast@master/slider.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function () {\n  \"use strict\";\n\n  // Early exit if Swiper is not available\n  if (typeof Swiper === \"undefined\") {\n    return;\n  }\n\n  function initializeSwipers() {\n    const swiperElements = document.querySelectorAll('[data-slider=\"slider\"]');\n\n    // Gracefully exit if no sliders found\n    if (swiperElements.length === 0) {\n      return;\n    }\n\n    // Initialize each swiper instance\n    swiperElements.forEach((element, index) => {\n      initializeSwiper(element, index);\n    });\n  }\n\n  // Initialize when DOM is ready\n  if (document.readyState === \"loading\") {\n    document.addEventListener(\"DOMContentLoaded\", initializeSwipers);\n  } else {\n    initializeSwipers();\n  }\n\n  // Handle viewport resize with debouncing - only for width changes\n  let resizeTimeout;\n  let lastWidth = window.innerWidth;\n\n  function handleResize() {\n    clearTimeout(resizeTimeout);\n    resizeTimeout = setTimeout(() => {\n      const currentWidth = window.innerWidth;\n\n      // Only reinitialize if width changed (ignore iOS Safari chrome height changes)\n      if (currentWidth !== lastWidth) {\n        lastWidth = currentWidth;\n\n        if (window.AttributesSwiper && window.AttributesSwiper.reinitialize) {\n          window.AttributesSwiper.reinitialize();\n        }\n      }\n    }, 250); // 250ms debounce delay\n  }\n\n  // Add resize listener\n  window.addEventListener(\"resize\", handleResize);\n\n  function initializeSwiper(element, index) {\n    try {\n      // Process Webflow CMS collection lists before initialization\n      processWebflowCMSLists(element);\n\n      // Get configuration from data attributes\n      const config = getSwiperConfig(element);\n\n      // Initialize Swiper\n      const swiper = new Swiper(element, config);\n\n      // Store reference for potential future access\n      element.swiperInstance = swiper;\n\n      // Add height calculation and update mechanism\n      setupHeightCalculation(element, swiper);\n    } catch (error) {\n      // Silently handle errors in production\n      if (typeof console !== \"undefined\" && console.error) {\n        console.error(\"Swiper initialization failed:\", error);\n      }\n    }\n  }\n\n  function setupHeightCalculation(element, swiper) {\n    // Function to calculate and set the proper height\n    function updateSliderHeight() {\n      const slides = element.querySelectorAll('.swiper-slide');\n      if (slides.length === 0) return;\n\n      let maxHeight = 0;\n      \n      // Calculate the maximum height among visible slides\n      slides.forEach(slide => {\n        // Reset any inline height styles to get natural height\n        slide.style.height = 'auto';\n        const slideHeight = slide.offsetHeight;\n        if (slideHeight > maxHeight) {\n          maxHeight = slideHeight;\n        }\n      });\n\n      // Set the calculated height to the swiper container\n      if (maxHeight > 0) {\n        element.style.height = maxHeight + 'px';\n      }\n    }\n\n    // Initial height calculation\n    updateSliderHeight();\n\n    // Update height on slide change (both drag and navigation)\n    swiper.on('slideChange', updateSliderHeight);\n    swiper.on('slideChangeTransitionEnd', updateSliderHeight);\n    \n    // Update height on touch end (when dragging stops)\n    swiper.on('touchEnd', updateSliderHeight);\n    \n    // Update height on resize\n    swiper.on('resize', updateSliderHeight);\n  }\n\n  function processWebflowCMSLists(element) {\n    // Find and process Webflow CMS collection list elements\n    const webflowSelectors = [\".w-dyn-list\", \".w-dyn-items\", \".w-dyn-item\"];\n\n    webflowSelectors.forEach((selector) => {\n      const webflowElements = element.querySelectorAll(selector);\n\n      webflowElements.forEach((webflowElement) => {\n        // Get all child nodes (including text nodes and elements)\n        const children = Array.from(webflowElement.childNodes);\n\n        // Insert children before the webflow element\n        children.forEach((child) => {\n          webflowElement.parentNode.insertBefore(child, webflowElement);\n        });\n\n        // Remove the now-empty webflow wrapper element\n        webflowElement.remove();\n      });\n    });\n  }\n\n  function getSwiperConfig(element) {\n    // Get computed styles to read CSS variables for proper slide calculation\n    const computedStyle = getComputedStyle(element);\n    const xs = parseFloat(computedStyle.getPropertyValue(\"--xs\").trim()) || 1;\n    const sm = parseFloat(computedStyle.getPropertyValue(\"--sm\").trim()) || 1;\n    const md = parseFloat(computedStyle.getPropertyValue(\"--md\").trim()) || 2;\n    const lg = parseFloat(computedStyle.getPropertyValue(\"--lg\").trim()) || 3;\n    const spaceBetween =\n      parseInt(computedStyle.getPropertyValue(\"--gap\").trim()) || 24;\n\n    // Base configuration - sync with CSS-controlled layout\n    const config = {\n      // Use breakpoints that match our CSS exactly\n      breakpoints: {\n        0: { slidesPerView: xs, spaceBetween: spaceBetween },\n        480: { slidesPerView: sm, spaceBetween: spaceBetween },\n        768: { slidesPerView: md, spaceBetween: spaceBetween },\n        992: { slidesPerView: lg, spaceBetween: spaceBetween },\n      },\n      watchSlidesProgress: true,\n      simulateTouch: true,\n      allowTouchMove: true,\n      keyboard: { enabled: true, onlyInViewport: true },\n      a11y: { enabled: true },\n      // Better handling for decimal slidesPerView values\n      watchOverflow: true,\n      normalizeSlideIndex: false,\n      roundLengths: false,\n    };\n\n    // Configure grab cursor (default: true, can be disabled for clickable content)\n    const grabCursor = element.dataset.grabCursor;\n    if (grabCursor === \"false\") {\n      config.grabCursor = false;\n    } else {\n      config.grabCursor = true;\n    }\n\n    // Find the parent component wrapper\n    const componentWrapper = element.closest('[data-slider=\"component\"]');\n\n    // Configure navigation if elements exist\n    const nextEl = componentWrapper.querySelector('[data-slider=\"next\"]');\n    const prevEl = componentWrapper.querySelector('[data-slider=\"previous\"]');\n\n    if (nextEl && prevEl) {\n      config.navigation = { nextEl, prevEl };\n    }\n\n    // Configure pagination if element exists\n    const paginationEl = componentWrapper.querySelector(\n      '[data-slider=\"pagination\"]'\n    );\n\n    if (paginationEl) {\n      config.pagination = {\n        el: paginationEl,\n        clickable: true,\n        bulletElement: \"button\",\n        bulletClass: \"slider-pagination_button\",\n        bulletActiveClass: \"cc-active\",\n      };\n    }\n\n    // Configure loop if requested\n    if (element.dataset.loop === \"true\") {\n      config.loop = true;\n      config.loopFillGroupWithBlank = true;\n\n      // Configure loopAdditionalSlides if specified\n      const loopAdditionalSlides = element.dataset.loopAdditionalSlides;\n      if (loopAdditionalSlides && !isNaN(loopAdditionalSlides)) {\n        config.loopAdditionalSlides = parseInt(loopAdditionalSlides);\n      }\n    }\n\n    // Configure autoplay if requested\n    const autoplayDelay = element.dataset.autoplay;\n    if (autoplayDelay && autoplayDelay !== \"false\" && !isNaN(autoplayDelay)) {\n      config.autoplay = {\n        delay: parseInt(autoplayDelay),\n        disableOnInteraction: false,\n        pauseOnMouseEnter: true,\n      };\n    }\n\n    // Configure centered slides if requested\n    if (element.dataset.centered === \"true\") {\n      config.centeredSlides = true;\n      config.centeredSlidesBounds = true;\n    }\n\n    // Configure fade effect if specified\n    if (element.dataset.effect === \"fade\") {\n      config.effect = \"fade\";\n      config.fadeEffect = { crossFade: true };\n    }\n\n    // Configure speed if specified\n    const speed = element.dataset.speed;\n    if (speed && !isNaN(speed)) {\n      config.speed = parseInt(speed);\n    }\n\n    return config;\n  }\n\n  // Utility functions for external use\n  window.AttributesSwiper = {\n    // Reinitialize all swipers (useful for dynamic content)\n    reinitialize: function () {\n      if (typeof Swiper === \"undefined\") return;\n\n      const swiperElements = document.querySelectorAll(\n        '[data-slider=\"slider\"]'\n      );\n      swiperElements.forEach((element) => {\n        if (element.swiperInstance) {\n          element.swiperInstance.destroy(true, true);\n        }\n      });\n\n      setTimeout(() => {\n        swiperElements.forEach((element, index) => {\n          initializeSwiper(element, index);\n        });\n      }, 50);\n    },\n\n    // Get a specific swiper instance\n    getInstance: function (index) {\n      const swiperElements = document.querySelectorAll(\n        '[data-slider=\"slider\"]'\n      );\n      if (swiperElements[index] && swiperElements[index].swiperInstance) {\n        return swiperElements[index].swiperInstance;\n      }\n      return null;\n    },\n  };\n})();\n"]}