{"ast":null,"code":"\"use strict\";\n\nvar _Object$keys = require(\"@babel/runtime-corejs2/core-js/object/keys\");\n\nvar _Object$defineProperty = require(\"@babel/runtime-corejs2/core-js/object/define-property\");\n\n_Object$defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nconst url_1 = require(\"url\");\n/**\n * Utils\n */\n\n\nfunction execOnce(fn) {\n  let used = false;\n  let result = null;\n  return (...args) => {\n    if (!used) {\n      used = true;\n      result = fn.apply(this, args);\n    }\n\n    return result;\n  };\n}\n\nexports.execOnce = execOnce;\n\nfunction getLocationOrigin() {\n  const {\n    protocol,\n    hostname,\n    port\n  } = window.location;\n  return `${protocol}//${hostname}${port ? ':' + port : ''}`;\n}\n\nexports.getLocationOrigin = getLocationOrigin;\n\nfunction getURL() {\n  const {\n    href\n  } = window.location;\n  const 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\nasync function loadGetInitialProps(App, ctx) {\n  var _a;\n\n  if (true) {\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  } // when called from _app `ctx` is nested in `ctx`\n\n\n  const res = ctx.res || ctx.ctx && ctx.ctx.res;\n\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\n    return {};\n  }\n\n  const props = await App.getInitialProps(ctx);\n\n  if (res && isResSent(res)) {\n    return props;\n  }\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\n  if (true) {\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\n  return props;\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(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\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":["/Users/sbourgal/Documents/Projets/DAN/dan-framework/template/node_modules/next/dist/next-server/lib/utils.js"],"names":["exports","value","url_1","require","execOnce","fn","used","result","args","apply","getLocationOrigin","protocol","hostname","port","window","location","getURL","href","origin","substring","length","getDisplayName","Component","displayName","name","isResSent","res","finished","headersSent","loadGetInitialProps","App","ctx","_a","prototype","getInitialProps","message","Error","pageProps","props","console","warn","urlObjectKeys","formatWithValidation","url","options","forEach","key","indexOf","format","SP","performance","ST","mark","measure"],"mappings":"AAAA;;;;;;AACA,uBAAsBA,OAAtB,EAA+B,YAA/B,EAA6C;AAAEC,EAAAA,KAAK,EAAE;AAAT,CAA7C;;AACA,MAAMC,KAAK,GAAGC,OAAO,CAAC,KAAD,CAArB;AACA;;;;;AAGA,SAASC,QAAT,CAAkBC,EAAlB,EAAsB;AAClB,MAAIC,IAAI,GAAG,KAAX;AACA,MAAIC,MAAM,GAAG,IAA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A7B,OAAO,CAACyC,aAAR,GAAwB,CACpB,MADoB,EAEpB,MAFoB,EAGpB,MAHoB,EAIpB,UAJoB,EAKpB,MALoB,EAMpB,MANoB,EAOpB,UAPoB,EAQpB,MARoB,EASpB,UAToB,EAUpB,OAVoB,EAWpB,QAXoB,EAYpB,SAZoB,CAAxB;;AAcA,SAASC,oBAAT,CAA8BC,GAA9B,EAAmCC,OAAnC,EAA4C;AACxC,YAA4C;AACxC,QAAID,GAAG,KAAK,IAAR,IAAgB,OAAOA,GAAP,KAAe,QAAnC,EAA6C;AACzC,mBAAYA,GAAZ,EAAiBE,OAAjB,CAAyBC,GAAG,IAAI;AAC5B,YAAI9C,OAAO,CAACyC,aAAR,CAAsBM,OAAtB,CAA8BD,GAA9B,MAAuC,CAAC,CAA5C,EAA+C;AAC3CP,UAAAA,OAAO,CAACC,IAAR,CAAc,qDAAoDM,GAAI,EAAtE;AACH;AACJ,OAJD;AAKH;AACJ;;AACD,SAAO5C,KAAK,CAAC8C,MAAN,CAAaL,GAAb,EAAkBC,OAAlB,CAAP;AACH;;AACD5C,OAAO,CAAC0C,oBAAR,GAA+BA,oBAA/B;AACA1C,OAAO,CAACiD,EAAR,GAAa,OAAOC,WAAP,KAAuB,WAApC;AACAlD,OAAO,CAACmD,EAAR,GAAanD,OAAO,CAACiD,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 = null;\n    return (...args) => {\n        if (!used) {\n            used = true;\n            result = fn.apply(this, 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"}