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EAAM,MAAM,cAAgB,WAAW,OAClD,EACA,EAAM,SAAW,EAAE,SAAS,EAAM,SAAU,KAC5C,EAAM,MAAQ,CACV,YAAa,EAAM,QAAQ,OAAO,aAE/B,CACX,CA6BA,OAtDA,UAAU,EAAS,GA0BnB,EAAQ,UAAU,kBAAoB,WAC9B,EAAQ,sBACR,OAAO,iBAAiB,SAAU,KAAK,SAE/C,EACA,EAAQ,UAAU,qBAAuB,WACrC,KAAK,SAAS,SACd,OAAO,oBAAoB,SAAU,KAAK,SAC9C,EACA,EAAQ,UAAU,QAAU,SAAU,GAClC,OAAI,GAAQ,EAAQ,YACT,WAAW,OAEb,GAAQ,EAAQ,YACd,WAAW,QAGX,WAAW,MAE1B,EACA,EAAQ,UAAU,OAAS,WACvB,IAAI,EAAgB,CAChB,SAAU,KAAK,SACf,SAAU,KAAK,SACf,UAAW,KAAK,WAEpB,OAAO,MAAM,cAAc,EAAa,SAAS,CAAC,EAAG,EAAe,KAAK,OAC7E,EACO,CACX,CAxDO,CAwDL,MAAM,UACZ,CAtEA,QAAQ,eAAiB,CACrB,YAAa,IACb,YAAa,IACb,sBAAsB,GAG1B,SAAW,GACP,EAAW,EAAmB,OAAI,GAAK,SACvC,EAAW,EAAmB,OAAI,GAAK,SACvC,EAAW,EAAoB,QAAI,GAAK,SAC3C,CAJD,CAIG,WAAa,QAAQ,aAAe,QAAQ,WAAa,CAAC,IA6D7D,QAAQ,cAAgB","file":"/npm/react-getscreen@1.1.3/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-getscreen@1.1.3/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\r\nvar __extends = (this && this.__extends) || (function () {\r\n    var extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n    return function (d, b) {\r\n        extendStatics(d, b);\r\n        function __() { this.constructor = d; }\r\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n    };\r\n})();\r\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\r\n    for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n        s = arguments[i];\r\n        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n            t[p] = s[p];\r\n    }\r\n    return t;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar React = require(\"react\");\r\nvar _ = require(\"lodash\");\r\nexports.defaultOptions = {\r\n    mobileLimit: 468,\r\n    tabletLimit: 768,\r\n    shouldListenOnResize: true\r\n};\r\nvar ScreenType;\r\n(function (ScreenType) {\r\n    ScreenType[ScreenType[\"MOBILE\"] = 0] = \"MOBILE\";\r\n    ScreenType[ScreenType[\"TABLET\"] = 1] = \"TABLET\";\r\n    ScreenType[ScreenType[\"DESKTOP\"] = 2] = \"DESKTOP\";\r\n})(ScreenType = exports.ScreenType || (exports.ScreenType = {}));\r\nfunction withGetScreen(WrappedComp, options) {\r\n    if (options === void 0) { options = exports.defaultOptions; }\r\n    return (function (_super) {\r\n        __extends(class_1, _super);\r\n        function class_1() {\r\n            var _this = _super.call(this) || this;\r\n            _this.onResize = function () {\r\n                var newSize = _this.getSize(window.innerWidth);\r\n                if (newSize !== _this.state.currentSize) {\r\n                    _this.setState({\r\n                        currentSize: newSize\r\n                    });\r\n                }\r\n            };\r\n            _this.isMobile = function () {\r\n                return _this.state.currentSize === ScreenType.MOBILE;\r\n            };\r\n            _this.isTablet = function () {\r\n                return _this.state.currentSize === ScreenType.TABLET;\r\n            };\r\n            _this.isDesktop = function () {\r\n                return _this.state.currentSize === ScreenType.DESKTOP;\r\n            };\r\n            _this.onResize = _.throttle(_this.onResize, 100);\r\n            _this.state = {\r\n                currentSize: _this.getSize(window.innerWidth)\r\n            };\r\n            return _this;\r\n        }\r\n        class_1.prototype.componentDidMount = function () {\r\n            if (options.shouldListenOnResize) {\r\n                window.addEventListener('resize', this.onResize);\r\n            }\r\n        };\r\n        class_1.prototype.componentWillUnmount = function () {\r\n            this.onResize.cancel();\r\n            window.removeEventListener('resize', this.onResize);\r\n        };\r\n        class_1.prototype.getSize = function (size) {\r\n            if (size <= options.mobileLimit) {\r\n                return ScreenType.MOBILE;\r\n            }\r\n            else if (size >= options.tabletLimit) {\r\n                return ScreenType.DESKTOP;\r\n            }\r\n            else {\r\n                return ScreenType.TABLET;\r\n            }\r\n        };\r\n        class_1.prototype.render = function () {\r\n            var detectMethods = {\r\n                isMobile: this.isMobile,\r\n                isTablet: this.isTablet,\r\n                isDesktop: this.isDesktop\r\n            };\r\n            return React.createElement(WrappedComp, __assign({}, detectMethods, this.props));\r\n        };\r\n        return class_1;\r\n    }(React.Component));\r\n}\r\nexports.withGetScreen = withGetScreen;\r\n"]}