PromoCursed/node_modules/.cache/babel-loader/18e23efb5ddd697871287f30f6635595a69626dba7e8162d352029f139b52d71.json

1 line
27 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"\"use strict\";\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _isNativeReflectConstruct from \"@babel/runtime/helpers/esm/isNativeReflectConstruct\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nfunction _callSuper(t, o, e) {\n return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));\n}\nimport React from \"react\";\nimport { InnerSlider } from \"./inner-slider\";\nimport json2mq from \"json2mq\";\nimport defaultProps from \"./default-props\";\nimport { canUseDOM, filterSettings } from \"./utils/innerSliderUtils\";\nvar Slider = /*#__PURE__*/function (_React$Component) {\n function Slider(props) {\n var _this;\n _classCallCheck(this, Slider);\n _this = _callSuper(this, Slider, [props]);\n _defineProperty(_this, \"innerSliderRefHandler\", function (ref) {\n return _this.innerSlider = ref;\n });\n _defineProperty(_this, \"slickPrev\", function () {\n return _this.innerSlider.slickPrev();\n });\n _defineProperty(_this, \"slickNext\", function () {\n return _this.innerSlider.slickNext();\n });\n _defineProperty(_this, \"slickGoTo\", function (slide) {\n var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n return _this.innerSlider.slickGoTo(slide, dontAnimate);\n });\n _defineProperty(_this, \"slickPause\", function () {\n return _this.innerSlider.pause(\"paused\");\n });\n _defineProperty(_this, \"slickPlay\", function () {\n return _this.innerSlider.autoPlay(\"play\");\n });\n _this.state = {\n breakpoint: null\n };\n _this._responsiveMediaHandlers = [];\n return _this;\n }\n _inherits(Slider, _React$Component);\n return _createClass(Slider, [{\n key: \"media\",\n value: function media(query, handler) {\n // javascript handler for css media query\n var mql = window.matchMedia(query);\n var listener = function listener(_ref) {\n var matches = _ref.matches;\n if (matches) {\n handler();\n }\n };\n mql.addListener(listener);\n listener(mql);\n this._responsiveMediaHandlers.push({\n mql: mql,\n query: query,\n listener: listener\n });\n }\n\n // handles responsive breakpoints\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n // performance monitoring\n //if (process.env.NODE_ENV !== 'production') {\n //const { whyDidYouUpdate } = require('why-did-you-update')\n //whyDidYouUpdate(React)\n //}\n if (this.props.responsive) {\n var breakpoints = this.props.responsive.map(function (breakpt) {\n return breakpt.breakpoint;\n });\n // sort them in increasing order of their numerical value\n breakpoints.sort(function (x, y) {\n return x - y;\n });\n breakpoints.forEach(function (breakpoint, index) {\n // media query for each breakpoint\n var bQuery;\n if (index === 0) {\n bQuery = json2mq({\n minWidth: 0,\n maxWidth: breakpoint\n });\n } else {\n bQuery = json2mq({\n minWidth: breakpoints[index - 1] + 1,\n maxWidth: breakpoint\n });\n }\n // when not using server side rendering\n canUseDOM() && _this2.media(bQuery, function () {\n _this2.se