import { __exports as r } from "../../../../../../../_virtual/innerSliderUtils.js";
import he from "react";
import { __require as Se } from "../default-props.js";
var V;
function ye() {
  if (V) return r;
  V = 1, Object.defineProperty(r, "__esModule", {
    value: !0
  }), r.checkSpecKeys = r.checkNavigable = r.changeSlide = r.canUseDOM = r.canGoNext = void 0, r.clamp = Y, r.extractObject = void 0, r.filterSettings = se, r.validSettings = r.swipeStart = r.swipeMove = r.swipeEnd = r.slidesOnRight = r.slidesOnLeft = r.slideHandler = r.siblingDirection = r.safePreventDefault = r.lazyStartIndex = r.lazySlidesOnRight = r.lazySlidesOnLeft = r.lazyEndIndex = r.keyHandler = r.initializedState = r.getWidth = r.getTrackLeft = r.getTrackCSS = r.getTrackAnimateCSS = r.getTotalSlides = r.getSwipeDirection = r.getSlideCount = r.getRequiredLazySlides = r.getPreClones = r.getPostClones = r.getOnDemandLazySlides = r.getNavigableIndexes = r.getHeight = void 0;
  var Z = j(he), $ = j(Se());
  function j(n) {
    return n && n.__esModule ? n : { default: n };
  }
  function P(n) {
    "@babel/helpers - typeof";
    return P = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
      return typeof e;
    } : function(e) {
      return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
    }, P(n);
  }
  function X(n, e) {
    var t = Object.keys(n);
    if (Object.getOwnPropertySymbols) {
      var i = Object.getOwnPropertySymbols(n);
      e && (i = i.filter(function(d) {
        return Object.getOwnPropertyDescriptor(n, d).enumerable;
      })), t.push.apply(t, i);
    }
    return t;
  }
  function h(n) {
    for (var e = 1; e < arguments.length; e++) {
      var t = arguments[e] != null ? arguments[e] : {};
      e % 2 ? X(Object(t), !0).forEach(function(i) {
        p(n, i, t[i]);
      }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : X(Object(t)).forEach(function(i) {
        Object.defineProperty(n, i, Object.getOwnPropertyDescriptor(t, i));
      });
    }
    return n;
  }
  function p(n, e, t) {
    return e = ee(e), e in n ? Object.defineProperty(n, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : n[e] = t, n;
  }
  function ee(n) {
    var e = te(n, "string");
    return P(e) == "symbol" ? e : String(e);
  }
  function te(n, e) {
    if (P(n) != "object" || !n) return n;
    var t = n[Symbol.toPrimitive];
    if (t !== void 0) {
      var i = t.call(n, e);
      if (P(i) != "object") return i;
      throw new TypeError("@@toPrimitive must return a primitive value.");
    }
    return (e === "string" ? String : Number)(n);
  }
  function Y(n, e, t) {
    return Math.max(e, Math.min(n, t));
  }
  var k = r.safePreventDefault = function(e) {
    var t = ["onTouchStart", "onTouchMove", "onWheel"];
    t.includes(e._reactName) || e.preventDefault();
  }, q = r.getOnDemandLazySlides = function(e) {
    for (var t = [], i = _(e), d = A(e), a = i; a < d; a++)
      e.lazyLoadedList.indexOf(a) < 0 && t.push(a);
    return t;
  };
  r.getRequiredLazySlides = function(e) {
    for (var t = [], i = _(e), d = A(e), a = i; a < d; a++)
      t.push(a);
    return t;
  };
  var _ = r.lazyStartIndex = function(e) {
    return e.currentSlide - ie(e);
  }, A = r.lazyEndIndex = function(e) {
    return e.currentSlide + re(e);
  }, ie = r.lazySlidesOnLeft = function(e) {
    return e.centerMode ? Math.floor(e.slidesToShow / 2) + (parseInt(e.centerPadding) > 0 ? 1 : 0) : 0;
  }, re = r.lazySlidesOnRight = function(e) {
    return e.centerMode ? Math.floor((e.slidesToShow - 1) / 2) + 1 + (parseInt(e.centerPadding) > 0 ? 1 : 0) : e.slidesToShow;
  }, R = r.getWidth = function(e) {
    return e && e.offsetWidth || 0;
  }, K = r.getHeight = function(e) {
    return e && e.offsetHeight || 0;
  }, U = r.getSwipeDirection = function(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, i, d, a, o;
    return i = e.startX - e.curX, d = e.startY - e.curY, a = Math.atan2(d, i), o = Math.round(a * 180 / Math.PI), o < 0 && (o = 360 - Math.abs(o)), o <= 45 && o >= 0 || o <= 360 && o >= 315 ? "left" : o >= 135 && o <= 225 ? "right" : t === !0 ? o >= 35 && o <= 135 ? "up" : "down" : "vertical";
  }, G = r.canGoNext = function(e) {
    var t = !0;
    return e.infinite || (e.centerMode && e.currentSlide >= e.slideCount - 1 || e.slideCount <= e.slidesToShow || e.currentSlide >= e.slideCount - e.slidesToShow) && (t = !1), t;
  };
  r.extractObject = function(e, t) {
    var i = {};
    return t.forEach(function(d) {
      return i[d] = e[d];
    }), i;
  }, r.initializedState = function(e) {
    var t = Z.default.Children.count(e.children), i = e.listRef, d = Math.ceil(R(i)), a = e.trackRef && e.trackRef.node, o = Math.ceil(R(a)), l;
    if (e.vertical)
      l = d;
    else {
      var u = e.centerMode && parseInt(e.centerPadding) * 2;
      typeof e.centerPadding == "string" && e.centerPadding.slice(-1) === "%" && (u *= d / 100), l = Math.ceil((d - u) / e.slidesToShow);
    }
    var L = i && K(i.querySelector('[data-index="0"]')), T = L * e.slidesToShow, w = e.currentSlide === void 0 ? e.initialSlide : e.currentSlide;
    e.rtl && e.currentSlide === void 0 && (w = t - 1 - e.initialSlide);
    var v = e.lazyLoadedList || [], x = q(h(h({}, e), {}, {
      currentSlide: w,
      lazyLoadedList: v
    }));
    v = v.concat(x);
    var S = {
      slideCount: t,
      slideWidth: l,
      listWidth: d,
      trackWidth: o,
      currentSlide: w,
      slideHeight: L,
      listHeight: T,
      lazyLoadedList: v
    };
    return e.autoplaying === null && e.autoplay && (S.autoplaying = "playing"), S;
  }, r.slideHandler = function(e) {
    var t = e.waitForAnimate, i = e.animating, d = e.fade, a = e.infinite, o = e.index, l = e.slideCount, u = e.lazyLoad, L = e.currentSlide, T = e.centerMode, w = e.slidesToScroll, v = e.slidesToShow, x = e.useCSS, S = e.lazyLoadedList;
    if (t && i) return {};
    var s = o, g, b, f, c = {}, y = {}, m = a ? o : Y(o, 0, l - 1);
    if (d) {
      if (!a && (o < 0 || o >= l)) return {};
      o < 0 ? s = o + l : o >= l && (s = o - l), u && S.indexOf(s) < 0 && (S = S.concat(s)), c = {
        animating: !0,
        currentSlide: s,
        lazyLoadedList: S,
        targetSlide: s
      }, y = {
        animating: !1,
        targetSlide: s
      };
    } else
      g = s, s < 0 ? (g = s + l, a ? l % w !== 0 && (g = l - l % w) : g = 0) : !G(e) && s > L ? s = g = L : T && s >= l ? (s = a ? l : l - 1, g = a ? 0 : l - 1) : s >= l && (g = s - l, a ? l % w !== 0 && (g = 0) : g = l - v), !a && s + v >= l && (g = l - v), b = I(h(h({}, e), {}, {
        slideIndex: s
      })), f = I(h(h({}, e), {}, {
        slideIndex: g
      })), a || (b === f && (s = g), b = f), u && (S = S.concat(q(h(h({}, e), {}, {
        currentSlide: s
      })))), x ? (c = {
        animating: !0,
        currentSlide: g,
        trackStyle: J(h(h({}, e), {}, {
          left: b
        })),
        lazyLoadedList: S,
        targetSlide: m
      }, y = {
        animating: !1,
        currentSlide: g,
        trackStyle: D(h(h({}, e), {}, {
          left: f
        })),
        swipeLeft: null,
        targetSlide: m
      }) : c = {
        currentSlide: g,
        trackStyle: D(h(h({}, e), {}, {
          left: f
        })),
        lazyLoadedList: S,
        targetSlide: m
      };
    return {
      state: c,
      nextState: y
    };
  }, r.changeSlide = function(e, t) {
    var i, d, a, o, l, u = e.slidesToScroll, L = e.slidesToShow, T = e.slideCount, w = e.currentSlide, v = e.targetSlide, x = e.lazyLoad, S = e.infinite;
    if (o = T % u !== 0, i = o ? 0 : (T - w) % u, t.message === "previous")
      a = i === 0 ? u : L - i, l = w - a, x && !S && (d = w - a, l = d === -1 ? T - 1 : d), S || (l = v - u);
    else if (t.message === "next")
      a = i === 0 ? u : i, l = w + a, x && !S && (l = (w + u) % T + i), S || (l = v + u);
    else if (t.message === "dots")
      l = t.index * t.slidesToScroll;
    else if (t.message === "children") {
      if (l = t.index, S) {
        var s = oe(h(h({}, e), {}, {
          targetSlide: l
        }));
        l > t.currentSlide && s === "left" ? l = l - T : l < t.currentSlide && s === "right" && (l = l + T);
      }
    } else t.message === "index" && (l = Number(t.index));
    return l;
  }, r.keyHandler = function(e, t, i) {
    return e.target.tagName.match("TEXTAREA|INPUT|SELECT") || !t ? "" : e.keyCode === 37 ? i ? "next" : "previous" : e.keyCode === 39 ? i ? "previous" : "next" : "";
  }, r.swipeStart = function(e, t, i) {
    return e.target.tagName === "IMG" && k(e), !t || !i && e.type.indexOf("mouse") !== -1 ? "" : {
      dragging: !0,
      touchObject: {
        startX: e.touches ? e.touches[0].pageX : e.clientX,
        startY: e.touches ? e.touches[0].pageY : e.clientY,
        curX: e.touches ? e.touches[0].pageX : e.clientX,
        curY: e.touches ? e.touches[0].pageY : e.clientY
      }
    };
  }, r.swipeMove = function(e, t) {
    var i = t.scrolling, d = t.animating, a = t.vertical, o = t.swipeToSlide, l = t.verticalSwiping, u = t.rtl, L = t.currentSlide, T = t.edgeFriction, w = t.edgeDragged, v = t.onEdge, x = t.swiped, S = t.swiping, s = t.slideCount, g = t.slidesToScroll, b = t.infinite, f = t.touchObject, c = t.swipeEvent, y = t.listHeight, m = t.listWidth;
    if (!i) {
      if (d) return k(e);
      a && o && l && k(e);
      var O, M = {}, E = I(t);
      f.curX = e.touches ? e.touches[0].pageX : e.clientX, f.curY = e.touches ? e.touches[0].pageY : e.clientY, f.swipeLength = Math.round(Math.sqrt(Math.pow(f.curX - f.startX, 2)));
      var Q = Math.round(Math.sqrt(Math.pow(f.curY - f.startY, 2)));
      if (!l && !S && Q > 10)
        return {
          scrolling: !0
        };
      l && (f.swipeLength = Q);
      var z = (u ? -1 : 1) * (f.curX > f.startX ? 1 : -1);
      l && (z = f.curY > f.startY ? 1 : -1);
      var ge = Math.ceil(s / g), C = U(t.touchObject, l), W = f.swipeLength;
      return b || (L === 0 && (C === "right" || C === "down") || L + 1 >= ge && (C === "left" || C === "up") || !G(t) && (C === "left" || C === "up")) && (W = f.swipeLength * T, w === !1 && v && (v(C), M.edgeDragged = !0)), !x && c && (c(C), M.swiped = !0), a ? O = E + W * (y / m) * z : u ? O = E - W * z : O = E + W * z, l && (O = E + W * z), M = h(h({}, M), {}, {
        touchObject: f,
        swipeLeft: O,
        trackStyle: D(h(h({}, t), {}, {
          left: O
        }))
      }), Math.abs(f.curX - f.startX) < Math.abs(f.curY - f.startY) * 0.8 || f.swipeLength > 10 && (M.swiping = !0, k(e)), M;
    }
  }, r.swipeEnd = function(e, t) {
    var i = t.dragging, d = t.swipe, a = t.touchObject, o = t.listWidth, l = t.touchThreshold, u = t.verticalSwiping, L = t.listHeight, T = t.swipeToSlide, w = t.scrolling, v = t.onSwipe, x = t.targetSlide, S = t.currentSlide, s = t.infinite;
    if (!i)
      return d && k(e), {};
    var g = u ? L / l : o / l, b = U(a, u), f = {
      dragging: !1,
      edgeDragged: !1,
      scrolling: !1,
      swiping: !1,
      swiped: !1,
      swipeLeft: null,
      touchObject: {}
    };
    if (w || !a.swipeLength)
      return f;
    if (a.swipeLength > g) {
      k(e), v && v(b);
      var c, y, m = s ? S : x;
      switch (b) {
        case "left":
        case "up":
          y = m + B(t), c = T ? F(t, y) : y, f.currentDirection = 0;
          break;
        case "right":
        case "down":
          y = m - B(t), c = T ? F(t, y) : y, f.currentDirection = 1;
          break;
        default:
          c = m;
      }
      f.triggerSlideHandler = c;
    } else {
      var O = I(t);
      f.trackStyle = J(h(h({}, t), {}, {
        left: O
      }));
    }
    return f;
  };
  var ne = r.getNavigableIndexes = function(e) {
    for (var t = e.infinite ? e.slideCount * 2 : e.slideCount, i = e.infinite ? e.slidesToShow * -1 : 0, d = e.infinite ? e.slidesToShow * -1 : 0, a = []; i < t; )
      a.push(i), i = d + e.slidesToScroll, d += Math.min(e.slidesToScroll, e.slidesToShow);
    return a;
  }, F = r.checkNavigable = function(e, t) {
    var i = ne(e), d = 0;
    if (t > i[i.length - 1])
      t = i[i.length - 1];
    else
      for (var a in i) {
        if (t < i[a]) {
          t = d;
          break;
        }
        d = i[a];
      }
    return t;
  }, B = r.getSlideCount = function(e) {
    var t = e.centerMode ? e.slideWidth * Math.floor(e.slidesToShow / 2) : 0;
    if (e.swipeToSlide) {
      var i, d = e.listRef, a = d.querySelectorAll && d.querySelectorAll(".slick-slide") || [];
      if (Array.from(a).every(function(u) {
        if (e.vertical) {
          if (u.offsetTop + K(u) / 2 > e.swipeLeft * -1)
            return i = u, !1;
        } else if (u.offsetLeft - t + R(u) / 2 > e.swipeLeft * -1)
          return i = u, !1;
        return !0;
      }), !i)
        return 0;
      var o = e.rtl === !0 ? e.slideCount - e.currentSlide : e.currentSlide, l = Math.abs(i.dataset.index - o) || 1;
      return l;
    } else
      return e.slidesToScroll;
  }, N = r.checkSpecKeys = function(e, t) {
    return t.reduce(function(i, d) {
      return i && e.hasOwnProperty(d);
    }, !0) ? null : console.error("Keys Missing:", e);
  }, D = r.getTrackCSS = function(e) {
    N(e, ["left", "variableWidth", "slideCount", "slidesToShow", "slideWidth"]);
    var t, i, d = e.slideCount + 2 * e.slidesToShow;
    e.vertical ? i = d * e.slideHeight : t = le(e) * e.slideWidth;
    var a = {
      opacity: 1,
      transition: "",
      WebkitTransition: ""
    };
    if (e.useTransform) {
      var o = e.vertical ? "translate3d(0px, " + e.left + "px, 0px)" : "translate3d(" + e.left + "px, 0px, 0px)", l = e.vertical ? "translate3d(0px, " + e.left + "px, 0px)" : "translate3d(" + e.left + "px, 0px, 0px)", u = e.vertical ? "translateY(" + e.left + "px)" : "translateX(" + e.left + "px)";
      a = h(h({}, a), {}, {
        WebkitTransform: o,
        transform: l,
        msTransform: u
      });
    } else
      e.vertical ? a.top = e.left : a.left = e.left;
    return e.fade && (a = {
      opacity: 1
    }), t && (a.width = t), i && (a.height = i), window && !window.addEventListener && window.attachEvent && (e.vertical ? a.marginTop = e.left + "px" : a.marginLeft = e.left + "px"), a;
  }, J = r.getTrackAnimateCSS = function(e) {
    N(e, ["left", "variableWidth", "slideCount", "slidesToShow", "slideWidth", "speed", "cssEase"]);
    var t = D(e);
    return e.useTransform ? (t.WebkitTransition = "-webkit-transform " + e.speed + "ms " + e.cssEase, t.transition = "transform " + e.speed + "ms " + e.cssEase) : e.vertical ? t.transition = "top " + e.speed + "ms " + e.cssEase : t.transition = "left " + e.speed + "ms " + e.cssEase, t;
  }, I = r.getTrackLeft = function(e) {
    if (e.unslick)
      return 0;
    N(e, ["slideIndex", "trackRef", "infinite", "centerMode", "slideCount", "slidesToShow", "slidesToScroll", "slideWidth", "listWidth", "variableWidth", "slideHeight"]);
    var t = e.slideIndex, i = e.trackRef, d = e.infinite, a = e.centerMode, o = e.slideCount, l = e.slidesToShow, u = e.slidesToScroll, L = e.slideWidth, T = e.listWidth, w = e.variableWidth, v = e.slideHeight, x = e.fade, S = e.vertical, s = 0, g, b, f = 0;
    if (x || e.slideCount === 1)
      return 0;
    var c = 0;
    if (d ? (c = -H(e), o % u !== 0 && t + u > o && (c = -(t > o ? l - (t - o) : o % u)), a && (c += parseInt(l / 2))) : (o % u !== 0 && t + u > o && (c = l - o % u), a && (c = parseInt(l / 2))), s = c * L, f = c * v, S ? g = t * v * -1 + f : g = t * L * -1 + s, w === !0) {
      var y, m = i && i.node;
      if (y = t + H(e), b = m && m.childNodes[y], g = b ? b.offsetLeft * -1 : 0, a === !0) {
        y = d ? t + H(e) : t, b = m && m.children[y], g = 0;
        for (var O = 0; O < y; O++)
          g -= m && m.children[O] && m.children[O].offsetWidth;
        g -= parseInt(e.centerPadding), g += b && (T - b.offsetWidth) / 2;
      }
    }
    return g;
  }, H = r.getPreClones = function(e) {
    return e.unslick || !e.infinite ? 0 : e.variableWidth ? e.slideCount : e.slidesToShow + (e.centerMode ? 1 : 0);
  }, ae = r.getPostClones = function(e) {
    return e.unslick || !e.infinite ? 0 : e.slideCount;
  }, le = r.getTotalSlides = function(e) {
    return e.slideCount === 1 ? 1 : H(e) + e.slideCount + ae(e);
  }, oe = r.siblingDirection = function(e) {
    return e.targetSlide > e.currentSlide ? e.targetSlide > e.currentSlide + de(e) ? "left" : "right" : e.targetSlide < e.currentSlide - fe(e) ? "right" : "left";
  }, de = r.slidesOnRight = function(e) {
    var t = e.slidesToShow, i = e.centerMode, d = e.rtl, a = e.centerPadding;
    if (i) {
      var o = (t - 1) / 2 + 1;
      return parseInt(a) > 0 && (o += 1), d && t % 2 === 0 && (o += 1), o;
    }
    return d ? 0 : t - 1;
  }, fe = r.slidesOnLeft = function(e) {
    var t = e.slidesToShow, i = e.centerMode, d = e.rtl, a = e.centerPadding;
    if (i) {
      var o = (t - 1) / 2 + 1;
      return parseInt(a) > 0 && (o += 1), !d && t % 2 === 0 && (o += 1), o;
    }
    return d ? t - 1 : 0;
  };
  r.canUseDOM = function() {
    return !!(typeof window < "u" && window.document && window.document.createElement);
  };
  var ue = r.validSettings = Object.keys($.default);
  function se(n) {
    return ue.reduce(function(e, t) {
      return n.hasOwnProperty(t) && (e[t] = n[t]), e;
    }, {});
  }
  return r;
}
export {
  ye as __require
};
//# sourceMappingURL=innerSliderUtils.js.map
