Second frontend, written in Next.JS + Typescript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
12 KiB

{"ast":null,"code":"\"use strict\";\n\nvar _regeneratorRuntime = require(\"@babel/runtime/regenerator\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar url_1 = require(\"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\nexports.execOnce = execOnce;\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\nexports.getLocationOrigin = getLocationOrigin;\n\nfunction getURL() {\n var href = window.location.href;\n var origin = getLocationOrigin();\n return href.substring(origin.length);\n}\n\nexports.getURL = getURL;\n\nfunction getDisplayName(Component) {\n return typeof Component === 'string' ? Component : Component.displayName || Component.name || 'Unknown';\n}\n\nexports.getDisplayName = getDisplayName;\n\nfunction isResSent(res) {\n return res.finished || res.headersSent;\n}\n\nexports.isResSent = isResSent;\n\nfunction loadGetInitialProps(App, ctx) {\n var _a, message, res, props, _message;\n\n return _regeneratorRuntime.async(function loadGetInitialProps$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!true) {\n _context.next = 4;\n break;\n }\n\n if (!((_a = App.prototype) === null || _a === void 0 ? void 0 : _a.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/zeit/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 _regeneratorRuntime.awrap(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 _regeneratorRuntime.awrap(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 (true) {\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/zeit/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 }, null, null, null, Promise);\n}\n\nexports.loadGetInitialProps = loadGetInitialProps;\nexports.urlObjectKeys = ['auth', 'hash', 'host', 'hostname', 'href', 'path', 'pathname', 'port', 'protocol', 'query', 'search', 'slashes'];\n\nfunction formatWithValidation(url, options) {\n if (true) {\n if (url !== null && typeof url === 'object') {\n Object.keys(url).forEach(function (key) {\n if (exports.urlObjectKeys.indexOf(key) === -1) {\n console.warn(\"Unknown key passed via urlObject into url.format: \".concat(key));\n }\n });\n }\n }\n\n return url_1.format(url, options);\n}\n\nexports.formatWithValidation = formatWithValidation;\nexports.SP = typeof performance !== 'undefined';\nexports.ST = exports.SP && typeof performance.mark === 'function' && typeof performance.measure === 'function';","map":{"version":3,"sources":["/data/projects/react/rpdata-frontend2/node_modules/next/dist/next-server/lib/utils.js"],"names":["Object","defineProperty","exports","value","url_1","require","execOnce","fn","used","result","getLocationOrigin","window","location","protocol","hostname","port","getURL","href","origin","substring","length","getDisplayName","Component","displayName","name","isResSent","res","finished","headersSent","loadGetInitialProps","App","ctx","_a","prototype","getInitialProps","message","Error","pageProps","props","keys","console","warn","urlObjectKeys","formatWithValidation","url","options","forEach","key","indexOf","format","SP","performance","ST","mark","measure"],"mappings":"AAAA;;;;AACAA,MAAM,CAACC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C;AAAEC,EAAAA,KAAK,EAAE;AAAT,CAA7C;;AACA,IAAMC,KAAK,GAAGC,OAAO,CAAC,KAAD,CAArB;AACA;;;;;AAGA,SAASC,QAAT,CAAkBC,EAAlB,EAAsB;AAClB,MAAIC,IAAI,GAAG,KAAX;AACA,MAAIC,MAAJ;AACA,SAAQ,YAAa;AACjB,QAAI,CAACD,IAAL,EAAW;AACPA,MAAAA,IAAI,GAAG,IAAP;AACAC,MAAAA,MAAM,GAAGF,EAAE,MAAF,mBAAT;AACH;;AACD,WAAOE,MAAP;AACH,GAND;AAOH;;AACDP,OAAO,CAACI,QAAR,GAAmBA,QAAnB;;AACA,SAASI,iBAAT,GAA6B;AAAA,yBACYC,MAAM,CAACC,QADnB;AAAA,MACjBC,QADiB,oBACjBA,QADiB;AAAA,MACPC,QADO,oBACPA,QADO;AAAA,MACGC,IADH,oBACGA,IADH;AAEzB,mBAAUF,QAAV,eAAuBC,QAAvB,SAAkCC,IAAI,GAAG,MAAMA,IAAT,GAAgB,EAAtD;AACH;;AACDb,OAAO,CAACQ,iBAAR,GAA4BA,iBAA5B;;AACA,SAASM,MAAT,GAAkB;AAAA,MACNC,IADM,GACGN,MAAM,CAACC,QADV,CACNK,IADM;AAEd,MAAMC,MAAM,GAAGR,iBAAiB,EAAhC;AACA,SAAOO,IAAI,CAACE,SAAL,CAAeD,MAAM,CAACE,MAAtB,CAAP;AACH;;AACDlB,OAAO,CAACc,MAAR,GAAiBA,MAAjB;;AACA,SAASK,cAAT,C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;;AACD,SAAO3C,KAAK,CAAC6C,MAAN,CAAaL,GAAb,EAAkBC,OAAlB,CAAP;AACH;;AACD3C,OAAO,CAACyC,oBAAR,GAA+BA,oBAA/B;AACAzC,OAAO,CAACgD,EAAR,GAAa,OAAOC,WAAP,KAAuB,WAApC;AACAjD,OAAO,CAACkD,EAAR,GAAalD,OAAO,CAACgD,EAAR,IACT,OAAOC,WAAW,CAACE,IAAnB,KAA4B,UADnB,IAET,OAAOF,WAAW,CAACG,OAAnB,KAA+B,UAFnC","sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst url_1 = require(\"url\");\n/**\n * Utils\n */\nfunction execOnce(fn) {\n let used = false;\n let result;\n return ((...args) => {\n if (!used) {\n used = true;\n result = fn(...args);\n }\n return result;\n });\n}\nexports.execOnce = execOnce;\nfunction getLocationOrigin() {\n const { protocol, hostname, port } = window.location;\n return `${protocol}//${hostname}${port ? ':' + port : ''}`;\n}\nexports.getLocationOrigin = getLocationOrigin;\nfunction getURL() {\n const { href } = window.location;\n const origin = getLocationOrigin();\n return href.substring(origin.length);\n}\nexports.getURL = getURL;\nfunction getDisplayName(Component) {\n return typeof Component === 'string'\n ? Component\n : Component.displayName || Component.name || 'Unknown';\n}\nexports.getDisplayName = getDisplayName;\nfunction isResSent(res) {\n return res.finished || res.headersSent;\n}\nexports.isResSent = isResSent;\nasync function loadGetInitialProps(App, ctx) {\n var _a;\n if (process.env.NODE_ENV !== 'production') {\n if ((_a = App.prototype) === null || _a === void 0 ? void 0 : _a.getInitialProps) {\n const message = `\"${getDisplayName(App)}.getInitialProps()\" is defined as an instance method - visit https://err.sh/zeit/next.js/get-initial-props-as-an-instance-method for more information.`;\n throw new Error(message);\n }\n }\n // when called from _app `ctx` is nested in `ctx`\n const res = ctx.res || (ctx.ctx && ctx.ctx.res);\n if (!App.getInitialProps) {\n if (ctx.ctx && ctx.Component) {\n // @ts-ignore pageProps default\n return {\n pageProps: await loadGetInitialProps(ctx.Component, ctx.ctx),\n };\n }\n return {};\n }\n const props = await App.getInitialProps(ctx);\n if (res && isResSent(res)) {\n return props;\n }\n if (!props) {\n const message = `\"${getDisplayName(App)}.getInitialProps()\" should resolve to an object. But found \"${props}\" instead.`;\n throw new Error(message);\n }\n if (process.env.NODE_ENV !== 'production') {\n if (Object.keys(props).length === 0 && !ctx.ctx) {\n console.warn(`${getDisplayName(App)} returned an empty object from \\`getInitialProps\\`. This de-optimizes and prevents automatic static optimization. https://err.sh/zeit/next.js/empty-object-getInitialProps`);\n }\n }\n return props;\n}\nexports.loadGetInitialProps = loadGetInitialProps;\nexports.urlObjectKeys = [\n 'auth',\n 'hash',\n 'host',\n 'hostname',\n 'href',\n 'path',\n 'pathname',\n 'port',\n 'protocol',\n 'query',\n 'search',\n 'slashes',\n];\nfunction formatWithValidation(url, options) {\n if (process.env.NODE_ENV === 'development') {\n if (url !== null && typeof url === 'object') {\n Object.keys(url).forEach(key => {\n if (exports.urlObjectKeys.indexOf(key) === -1) {\n console.warn(`Unknown key passed via urlObject into url.format: ${key}`);\n }\n });\n }\n }\n return url_1.format(url, options);\n}\nexports.formatWithValidation = formatWithValidation;\nexports.SP = typeof performance !== 'undefined';\nexports.ST = exports.SP &&\n typeof performance.mark === 'function' &&\n typeof performance.measure === 'function';\n"]},"metadata":{},"sourceType":"script"}