Gazebo_simulation-Frontend/node_modules/.cache/babel-loader/a7103f14963b39c15264d86e9bc...

1 line
4.0 KiB
JSON

{"ast":null,"code":"var __extends = this && this.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (b.hasOwnProperty(p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport { Consumer } from './CookiesContext'; // Only way to make function modules work with both TypeScript and Rollup\n\nvar hoistStatics = require('hoist-non-react-statics');\n\nexport default function withCookies(WrappedComponent) {\n // @ts-ignore\n var name = WrappedComponent.displayName || WrappedComponent.name;\n\n var CookieWrapper =\n /** @class */\n function (_super) {\n __extends(CookieWrapper, _super);\n\n function CookieWrapper() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n\n _this.onChange = function () {\n // Make sure to update children with new values\n _this.forceUpdate();\n };\n\n return _this;\n }\n\n CookieWrapper.prototype.listen = function () {\n this.props.cookies.addChangeListener(this.onChange);\n };\n\n CookieWrapper.prototype.unlisten = function (cookies) {\n (cookies || this.props.cookies).removeChangeListener(this.onChange);\n };\n\n CookieWrapper.prototype.componentDidMount = function () {\n this.listen();\n };\n\n CookieWrapper.prototype.componentDidUpdate = function (prevProps) {\n if (prevProps.cookies !== this.props.cookies) {\n this.unlisten(prevProps.cookies);\n this.listen();\n }\n };\n\n CookieWrapper.prototype.componentWillUnmount = function () {\n this.unlisten();\n };\n\n CookieWrapper.prototype.render = function () {\n var _a = this.props,\n forwardedRef = _a.forwardedRef,\n cookies = _a.cookies,\n restProps = __rest(_a, [\"forwardedRef\", \"cookies\"]);\n\n var allCookies = cookies.getAll();\n return React.createElement(WrappedComponent, __assign({}, restProps, {\n ref: forwardedRef,\n cookies: cookies,\n allCookies: allCookies\n }));\n };\n\n CookieWrapper.displayName = \"withCookies(\" + name + \")\";\n CookieWrapper.WrappedComponent = WrappedComponent;\n return CookieWrapper;\n }(React.Component);\n\n var ForwardedComponent = React.forwardRef(function (props, ref) {\n return React.createElement(Consumer, null, function (cookies) {\n return React.createElement(CookieWrapper, __assign({\n cookies: cookies\n }, props, {\n forwardedRef: ref\n }));\n });\n });\n ForwardedComponent.displayName = CookieWrapper.displayName;\n ForwardedComponent.WrappedComponent = CookieWrapper.WrappedComponent;\n return hoistStatics(ForwardedComponent, WrappedComponent);\n}","map":null,"metadata":{},"sourceType":"module"}