/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = "./src/js/view/pricing-slider.js");
/******/ })
/************************************************************************/
/******/ ({

/***/ "./src/js/view/pricing-slider.js":
/*!***************************************!*\
  !*** ./src/js/view/pricing-slider.js ***!
  \***************************************/
/*! no static exports found */
/***/ (function(module, exports) {

eval("function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar PricingSliderHandler = function PricingSliderHandler($scope, $) {\n  function normalizeFilterToken(value) {\n    return String(value !== null && value !== void 0 ? value : \"\").trim().toLowerCase();\n  }\n  function parseFilterTokens(filterData) {\n    return String(filterData !== null && filterData !== void 0 ? filterData : \"\").split(\",\").map(function (token) {\n      return normalizeFilterToken(token);\n    }).filter(Boolean);\n  }\n  var PricingSlider = /*#__PURE__*/function () {\n    function PricingSlider($scope) {\n      _classCallCheck(this, PricingSlider);\n      this.$scope = $scope;\n      this.instanceId = $scope.data(\"id\") || $scope.find(\".eael-pricing-slider\").attr(\"data-widget-id\") || \"\";\n      this.instanceSuffix = this.instanceId ? \"-\".concat(this.instanceId) : \"\";\n      this.eventName = \"pricingSliderChange\";\n      this.markersContainer = $scope.find(\"#eael-pricing-slider-controls\".concat(this.instanceSuffix))[0] || $scope.find(\".eael-pricing-slider-controls\")[0];\n      this.handle = $scope.find(\"#eael-pricing-slider-handle\".concat(this.instanceSuffix))[0] || $scope.find(\".eael-pricing-slider-handle\")[0];\n      this.fill = $scope.find(\"#eael-pricing-slider-fill\".concat(this.instanceSuffix))[0] || $scope.find(\".eael-pricing-slider-fill\")[0];\n      this.tooltip = $scope.find(\"#eael-pricing-slider-tooltip\".concat(this.instanceSuffix))[0] || $scope.find(\".eael-pricing-slider-tooltip\")[0];\n      this.sliderBar = $scope.find(\"#eael-pricing-slider-bar\".concat(this.instanceSuffix))[0] || $scope.find(\".eael-pricing-slider-bar\")[0];\n      this.plansContainer = $scope.find(\"#plans-container\".concat(this.instanceSuffix))[0] || $scope.find(\".eael-pricing-plans-container\")[0];\n\n      // Style Two curve elements\n      this.isStyleTwo = $scope.find(\".eael-pricing-slider-style-2\").length > 0;\n      this.curvePath = $scope.find(\".eael-pricing-slider-curve-path\")[0] || null;\n      this.curveSvg = $scope.find(\".eael-pricing-slider-curve\")[0] || null;\n      this.currentPricePoint = 0;\n      this.currentPercent = 0;\n      this.isDragging = false;\n      this.pricePoints = [];\n      this.priceLabels = [];\n      this.priceTooltipActives = [];\n      this.priceTooltipTexts = [];\n      this.priceMarkers = [];\n      this.activeDefaultIndex = -1;\n      this.initialize();\n    }\n    return _createClass(PricingSlider, [{\n      key: \"initialize\",\n      value: function initialize() {\n        var _this = this;\n        this.readPricePointsFromHTML();\n        this.bindEvents();\n        var initialValue = this.activeDefaultIndex !== -1 ? this.pricePoints[this.activeDefaultIndex] : this.pricePoints.length ? this.pricePoints[0] : 0;\n        this.selectPricePoint(initialValue);\n        requestAnimationFrame(function () {\n          _this.selectPricePoint(_this.currentPricePoint, {\n            dispatchEvent: false\n          });\n        });\n      }\n    }, {\n      key: \"readPricePointsFromHTML\",\n      value: function readPricePointsFromHTML() {\n        var _this2 = this;\n        var markerElements = this.markersContainer.querySelectorAll(\".slider-control\");\n        markerElements.forEach(function (marker) {\n          var _marker$getAttribute;\n          var value = _this2.parseMarkerValue(marker.getAttribute(\"data-value\"));\n          var label = marker.querySelector(\".slider-label\").textContent;\n          var tooltipActive = marker.getAttribute(\"data-tooltip-active\") === \"yes\";\n          var tooltipText = (_marker$getAttribute = marker.getAttribute(\"data-tooltip-text\")) !== null && _marker$getAttribute !== void 0 ? _marker$getAttribute : \"\";\n          if (marker.getAttribute(\"data-active\") === \"yes\") {\n            _this2.activeDefaultIndex = _this2.pricePoints.length;\n          }\n          _this2.pricePoints.push(value);\n          _this2.priceLabels.push(label);\n          _this2.priceTooltipActives.push(tooltipActive);\n          _this2.priceTooltipTexts.push(tooltipText);\n          _this2.priceMarkers.push(marker);\n        });\n      }\n    }, {\n      key: \"bindEvents\",\n      value: function bindEvents() {\n        var _this3 = this;\n        this.handle.addEventListener(\"mousedown\", function (e) {\n          _this3.isDragging = true;\n          _this3.handle.style.cursor = \"grabbing\";\n          _this3.handle.style.transition = \"none\";\n          if (_this3.fill) _this3.fill.style.transition = \"none\";\n          e.preventDefault();\n        });\n        document.addEventListener(\"mousemove\", function (e) {\n          if (!_this3.isDragging) return;\n          var rect = _this3.sliderBar.getBoundingClientRect();\n          var x = e.clientX - rect.left;\n          var percent = Math.max(0, Math.min(1, x / rect.width));\n          _this3.updatePositionByPercent(percent);\n          _this3.previewNearestSnap(percent);\n        });\n        document.addEventListener(\"mouseup\", function () {\n          if (!_this3.isDragging) return;\n          _this3.isDragging = false;\n          _this3.handle.style.cursor = \"grab\";\n          _this3.handle.style.transition = \"\";\n          if (_this3.fill) _this3.fill.style.transition = \"\";\n          _this3.snapToNearestPriceMarker();\n        });\n        this.priceMarkers.forEach(function (marker, index) {\n          marker.addEventListener(\"click\", function () {\n            _this3.selectPricePoint(_this3.pricePoints[index]);\n          });\n        });\n        this.sliderBar.addEventListener(\"click\", function (e) {\n          if (e.target === _this3.handle || e.target.classList.contains(\"slider-control\") || e.target.classList.contains(\"slider-dot\") || e.target.classList.contains(\"slider-label\") || e.target.classList.contains(\"marker-tooltip\")) {\n            return;\n          }\n          var rect = _this3.sliderBar.getBoundingClientRect();\n          var x = e.clientX - rect.left;\n          var percent = Math.max(0, Math.min(1, x / rect.width));\n          _this3.snapToNearestPriceMarkerByPercent(percent);\n        });\n        window.addEventListener(\"resize\", function () {\n          _this3.selectPricePoint(_this3.currentPricePoint, {\n            dispatchEvent: false\n          });\n        });\n      }\n    }, {\n      key: \"selectPricePoint\",\n      value: function selectPricePoint(value) {\n        var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n        var _options$dispatchEven = options.dispatchEvent,\n          dispatchEvent = _options$dispatchEven === void 0 ? true : _options$dispatchEven;\n        this.currentPricePoint = value;\n        var index = this.pricePoints.indexOf(value);\n        if (index !== -1) {\n          var percent = this.getMarkerPercent(index);\n          this.currentPercent = percent;\n          this.handle.style.left = \"\".concat(percent * 100, \"%\");\n          this.fill.style.width = \"\".concat(percent * 100, \"%\");\n          this.updateActivePriceMarker(index);\n          this.tooltip.textContent = this.getTooltipText(value, index);\n          this.updateTooltipVisibility(index);\n          this.updateCurve(percent);\n          if (dispatchEvent) {\n            var event = new CustomEvent(this.eventName, {\n              detail: {\n                value: value,\n                instanceId: this.instanceId\n              }\n            });\n            document.dispatchEvent(event);\n          }\n        }\n      }\n    }, {\n      key: \"updatePositionByPercent\",\n      value: function updatePositionByPercent(percent) {\n        this.currentPercent = percent;\n        this.handle.style.left = \"\".concat(percent * 100, \"%\");\n        this.fill.style.width = \"\".concat(percent * 100, \"%\");\n        var currentIndex = this.getMarkerIndexFromPercent(percent);\n        var currentValue = this.pricePoints[currentIndex];\n        this.tooltip.textContent = this.getTooltipText(currentValue, currentIndex);\n        this.updateTooltipVisibility(currentIndex);\n        this.updateCurve(percent);\n      }\n    }, {\n      key: \"getPricePointFromPercent\",\n      value: function getPricePointFromPercent(percent) {\n        var _this$pricePoints$mar;\n        if (!this.pricePoints.length) {\n          return null;\n        }\n        var markerIndex = this.getMarkerIndexFromPercent(percent);\n        return (_this$pricePoints$mar = this.pricePoints[markerIndex]) !== null && _this$pricePoints$mar !== void 0 ? _this$pricePoints$mar : null;\n      }\n    }, {\n      key: \"getMarkerIndexFromPercent\",\n      value: function getMarkerIndexFromPercent(percent) {\n        var _this4 = this;\n        if (!this.pricePoints.length) {\n          return -1;\n        }\n        var closestIndex = 0;\n        var minDistance = Infinity;\n        this.pricePoints.forEach(function (_, index) {\n          var markerPercent = _this4.getMarkerPercent(index);\n          var distance = Math.abs(percent - markerPercent);\n          if (distance < minDistance) {\n            minDistance = distance;\n            closestIndex = index;\n          }\n        });\n        return closestIndex;\n      }\n    }, {\n      key: \"previewNearestSnap\",\n      value: function previewNearestSnap(percent) {\n        var closestIndex = this.getMarkerIndexFromPercent(percent);\n        this.priceMarkers.forEach(function (marker, index) {\n          marker.classList.toggle(\"preview-active\", index === closestIndex);\n        });\n      }\n    }, {\n      key: \"snapToNearestPriceMarker\",\n      value: function snapToNearestPriceMarker() {\n        var closestIndex = this.getMarkerIndexFromPercent(this.currentPercent);\n        this.selectPricePoint(this.pricePoints[closestIndex]);\n        this.priceMarkers.forEach(function (marker) {\n          marker.classList.remove(\"preview-active\");\n        });\n      }\n    }, {\n      key: \"snapToNearestPriceMarkerByPercent\",\n      value: function snapToNearestPriceMarkerByPercent(percent) {\n        var closestIndex = this.getMarkerIndexFromPercent(percent);\n        this.selectPricePoint(this.pricePoints[closestIndex]);\n      }\n    }, {\n      key: \"getMarkerPercent\",\n      value: function getMarkerPercent(index) {\n        var marker = this.priceMarkers[index];\n        if (!marker || !this.sliderBar) {\n          var totalSteps = Math.max(this.pricePoints.length - 1, 1);\n          return index / totalSteps;\n        }\n        var barRect = this.sliderBar.getBoundingClientRect();\n        var dot = marker.querySelector(\".slider-dot\") || marker;\n        var dotRect = dot.getBoundingClientRect();\n        if (!barRect.width) {\n          return 0;\n        }\n        var centerX = dotRect.left + dotRect.width / 2;\n        var rawPercent = (centerX - barRect.left) / barRect.width;\n        return Math.max(0, Math.min(1, rawPercent));\n      }\n    }, {\n      key: \"updateActivePriceMarker\",\n      value: function updateActivePriceMarker(activeIndex) {\n        this.priceMarkers.forEach(function (marker, index) {\n          marker.classList.toggle(\"active\", index === activeIndex);\n        });\n      }\n    }, {\n      key: \"parseMarkerValue\",\n      value: function parseMarkerValue(rawValue) {\n        var normalizedValue = normalizeFilterToken(rawValue);\n        if (/^-?\\d+(\\.\\d+)?$/.test(normalizedValue)) {\n          return Number(normalizedValue);\n        }\n        return normalizedValue;\n      }\n    }, {\n      key: \"isAllValue\",\n      value: function isAllValue(value, index) {\n        var _this$priceLabels$ind;\n        var normalizedValue = normalizeFilterToken(value);\n        var label = (_this$priceLabels$ind = this.priceLabels[index]) !== null && _this$priceLabels$ind !== void 0 ? _this$priceLabels$ind : \"\";\n        var normalizedLabel = normalizeFilterToken(label);\n        return normalizedValue === \"0\" || normalizedValue === \"all\" || normalizedValue === \"*\" || normalizedLabel === \"all\";\n      }\n    }, {\n      key: \"getTooltipText\",\n      value: function getTooltipText(value, index) {\n        var _this$priceTooltipTex, _this$priceLabels$ind2;\n        if (this.priceTooltipActives[index] !== true) {\n          return \"\";\n        }\n        var customTooltipText = String((_this$priceTooltipTex = this.priceTooltipTexts[index]) !== null && _this$priceTooltipTex !== void 0 ? _this$priceTooltipTex : \"\").trim();\n        if (customTooltipText) {\n          return customTooltipText;\n        }\n        if (this.isAllValue(value, index)) {\n          return \"All\";\n        }\n        return (_this$priceLabels$ind2 = this.priceLabels[index]) !== null && _this$priceLabels$ind2 !== void 0 ? _this$priceLabels$ind2 : String(value);\n      }\n    }, {\n      key: \"updateTooltipVisibility\",\n      value: function updateTooltipVisibility(index) {\n        if (!this.tooltip) {\n          return;\n        }\n        if (this.isStyleTwo) {\n          this.tooltip.style.opacity = \"1\";\n          return;\n        }\n        this.tooltip.style.opacity = this.priceTooltipActives[index] === true ? \"1\" : \"0\";\n      }\n    }, {\n      key: \"updateCurve\",\n      value: function updateCurve(percent) {\n        if (!this.isStyleTwo || !this.curvePath || !this.curveSvg) {\n          return;\n        }\n        var barRect = this.sliderBar.getBoundingClientRect();\n        var w = barRect.width;\n        var h = 55;\n        var cy = 5;\n        var dipDepth = 40;\n        var dipRadius = 100;\n        this.curveSvg.setAttribute(\"viewBox\", \"0 0 \".concat(w, \" \").concat(h));\n        this.curveSvg.style.width = w + \"px\";\n        this.curveSvg.style.height = h + \"px\";\n        var handleX = percent * w;\n        var leftEdge = Math.max(0, handleX - dipRadius);\n        var rightEdge = Math.min(w, handleX + dipRadius);\n        var dipBottom = cy + dipDepth;\n\n        // Smooth U-shaped cosine-wave Bézier approximation\n        var d = [\"M 0 \".concat(cy), \"L \".concat(leftEdge, \" \").concat(cy), \"C \".concat(leftEdge + (handleX - leftEdge) * 0.4, \" \").concat(cy, \", \").concat(handleX - (handleX - leftEdge) * 0.25, \" \").concat(dipBottom, \", \").concat(handleX, \" \").concat(dipBottom), \"C \".concat(handleX + (rightEdge - handleX) * 0.25, \" \").concat(dipBottom, \", \").concat(rightEdge - (rightEdge - handleX) * 0.4, \" \").concat(cy, \", \").concat(rightEdge, \" \").concat(cy), \"L \".concat(w, \" \").concat(cy)].join(\" \");\n        this.curvePath.setAttribute(\"d\", d);\n        this.handle.style.top = \"0%\";\n      }\n    }, {\n      key: \"getCurrentPricePoint\",\n      value: function getCurrentPricePoint() {\n        return this.currentPricePoint;\n      }\n    }]);\n  }();\n  /**\n   * This function will show/hide pricing plan accodring to \"data-filter\".\n   */\n  function filterPricingPlan(filterValue) {\n    var plansRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;\n    var plans = plansRoot.querySelectorAll(\".eael-pricing-plan\");\n    var visibleCount = 0;\n    var selectedFilter = normalizeFilterToken(filterValue);\n    var isAllSelected = selectedFilter === \"\" || selectedFilter === \"0\" || selectedFilter === \"all\" || selectedFilter === \"*\";\n    plans.forEach(function (plan) {\n      var filterData = plan.getAttribute(\"data-filter\");\n      var arrayFilterData = parseFilterTokens(filterData);\n      if (isAllSelected || arrayFilterData.includes(selectedFilter)) {\n        plan.classList.remove(\"hidden\");\n        visibleCount++;\n      } else {\n        plan.classList.add(\"hidden\");\n      }\n    });\n  }\n  function init() {\n    var pricingSlider = new PricingSlider($scope);\n\n    // Handle slider changes\n    document.addEventListener(\"pricingSliderChange\", function (e) {\n      if (!e.detail || e.detail.instanceId !== pricingSlider.instanceId) {\n        return;\n      }\n      var filterValue = e.detail.value;\n      filterPricingPlan(filterValue, pricingSlider.plansContainer || $scope[0]);\n    });\n\n    // Initial filter\n    filterPricingPlan(pricingSlider.getCurrentPricePoint(), pricingSlider.plansContainer || $scope[0]);\n  }\n  init();\n};\njQuery(window).on(\"elementor/frontend/init\", function () {\n  if (eael.elementStatusCheck(\"PricingSliderHandler\")) {\n    return false;\n  }\n  elementorFrontend.hooks.addAction(\"frontend/element_ready/eael-pricing-slider.default\", PricingSliderHandler);\n});\n\n//# sourceURL=webpack:///./src/js/view/pricing-slider.js?");

/***/ })

/******/ });