{"ast":null,"code":"\"use strict\";\n\nvar _regeneratorRuntime = require(\"/home/jjglover/goallinestats/node_modules/@babel/runtime/regenerator\");\n\nvar _asyncToGenerator = require(\"/home/jjglover/goallinestats/node_modules/@babel/runtime/helpers/asyncToGenerator\");\n\nexports.__esModule = true;\nexports.execOnce = execOnce;\nexports.getLocationOrigin = getLocationOrigin;\nexports.getURL = getURL;\nexports.getDisplayName = getDisplayName;\nexports.isResSent = isResSent;\nexports.loadGetInitialProps = loadGetInitialProps;\nexports.formatWithValidation = formatWithValidation;\nexports.ST = exports.SP = exports.urlObjectKeys = void 0;\n\nvar _formatUrl = require(\"./router/utils/format-url\");\n/**\n* Utils\n*/\n\n\nfunction execOnce(fn) {\n  var used = false;\n  var result;\n  return function () {\n    if (!used) {\n      used = true;\n      result = fn.apply(void 0, arguments);\n    }\n\n    return result;\n  };\n}\n\nfunction getLocationOrigin() {\n  var _window$location = window.location,\n      protocol = _window$location.protocol,\n      hostname = _window$location.hostname,\n      port = _window$location.port;\n  return \"\".concat(protocol, \"//\").concat(hostname).concat(port ? ':' + port : '');\n}\n\nfunction getURL() {\n  var href = window.location.href;\n  var origin = getLocationOrigin();\n  return href.substring(origin.length);\n}\n\nfunction getDisplayName(Component) {\n  return typeof Component === 'string' ? Component : Component.displayName || Component.name || 'Unknown';\n}\n\nfunction isResSent(res) {\n  return res.finished || res.headersSent;\n}\n\nfunction loadGetInitialProps(_x, _x2) {\n  return _loadGetInitialProps.apply(this, arguments);\n}\n\nfunction _loadGetInitialProps() {\n  _loadGetInitialProps = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(App, ctx) {\n    var _App$prototype, message, res, props, _message;\n\n    return _regeneratorRuntime.wrap(function _callee$(_context) {\n      while (1) {\n        switch (_context.prev = _context.next) {\n          case 0:\n            if (!false) {\n              _context.next = 4;\n              break;\n            }\n\n            if (!((_App$prototype = App.prototype) == null ? void 0 : _App$prototype.getInitialProps)) {\n              _context.next = 4;\n              break;\n            }\n\n            message = \"\\\"\".concat(getDisplayName(App), \".getInitialProps()\\\" is defined as an instance method - visit https://err.sh/vercel/next.js/get-initial-props-as-an-instance-method for more information.\");\n            throw new Error(message);\n\n          case 4:\n            // when called from _app `ctx` is nested in `ctx`\n            res = ctx.res || ctx.ctx && ctx.ctx.res;\n\n            if (App.getInitialProps) {\n              _context.next = 12;\n              break;\n            }\n\n            if (!(ctx.ctx && ctx.Component)) {\n              _context.next = 11;\n              break;\n            }\n\n            _context.next = 9;\n            return loadGetInitialProps(ctx.Component, ctx.ctx);\n\n          case 9:\n            _context.t0 = _context.sent;\n            return _context.abrupt(\"return\", {\n              pageProps: _context.t0\n            });\n\n          case 11:\n            return _context.abrupt(\"return\", {});\n\n          case 12:\n            _context.next = 14;\n            return App.getInitialProps(ctx);\n\n          case 14:\n            props = _context.sent;\n\n            if (!(res && isResSent(res))) {\n              _context.next = 17;\n              break;\n            }\n\n            return _context.abrupt(\"return\", props);\n\n          case 17:\n            if (props) {\n              _context.next = 20;\n              break;\n            }\n\n            _message = \"\\\"\".concat(getDisplayName(App), \".getInitialProps()\\\" should resolve to an object. But found \\\"\").concat(props, \"\\\" instead.\");\n            throw new Error(_message);\n\n          case 20:\n            if (false) {\n              if (Object.keys(props).length === 0 && !ctx.ctx) {\n                console.warn(\"\".concat(getDisplayName(App), \" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://err.sh/vercel/next.js/empty-object-getInitialProps\"));\n              }\n            }\n\n            return _context.abrupt(\"return\", props);\n\n          case 22:\n          case \"end\":\n            return _context.stop();\n        }\n      }\n    }, _callee);\n  }));\n  return _loadGetInitialProps.apply(this, arguments);\n}\n\nvar urlObjectKeys = ['auth', 'hash', 'host', 'hostname', 'href', 'path', 'pathname', 'port', 'protocol', 'query', 'search', 'slashes'];\nexports.urlObjectKeys = urlObjectKeys;\n\nfunction formatWithValidation(url) {\n  if (false) {\n    if (url !== null && typeof url === 'object') {\n      Object.keys(url).forEach(function (key) {\n        if (urlObjectKeys.indexOf(key) === -1) {\n          console.warn(\"Unknown key passed via urlObject into url.format: \".concat(key));\n        }\n      });\n    }\n  }\n\n  return (0, _formatUrl.formatUrl)(url);\n}\n\nvar SP = typeof performance !== 'undefined';\nexports.SP = SP;\nvar ST = SP && typeof performance.mark === 'function' && typeof performance.measure === 'function';\nexports.ST = ST;","map":null,"metadata":{},"sourceType":"script"}