diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..bb31533ed --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI +on: [push] +jobs: + lhci: + name: Lighthouse + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Use Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + - name: npm install, build + run: | + cd nextjs-tailwind + npm install + npm run build + - name: run Lighthouse CI + run: | + npm install -g @lhci/cli@0.11.x + lhci autorun diff --git a/.github/workflows/seo.yml b/.github/workflows/seo.yml new file mode 100644 index 000000000..9a899fb8b --- /dev/null +++ b/.github/workflows/seo.yml @@ -0,0 +1,35 @@ +name: SEO Tests + +on: + push: + branches: [tailwindcss] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "18.x" + + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y libgbm-dev + cd nextjs-tailwind + npm ci + npx playwright install chromium + npm install -g lighthouse chrome-launcher axe-core chromium wait-on + + - name: Build the application + run: cd nextjs-tailwind && npm run build + + # - name: Start server + # run: cd nextjs-tailwind && npm run start + + # - name: Run Tests + # run: cd nextjs-tailwind && npx playwright test tests/seo diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3cf4e8684..5d04e3e7b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,10 +13,10 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: '18.x' + node-version: "18.x" - name: Install dependencies run: npm ci - name: Install playwright browsers run: npx playwright install --with-deps - name: Run tests - run: npx playwright test \ No newline at end of file + run: npx playwright test diff --git a/.gitignore b/.gitignore index 71142d117..9569ba7a2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ venv /app/__pycache__/ .github/workflows/*.bak .vscode -docs \ No newline at end of file +docs +.next diff --git a/agile_documentation.md b/agile_documentation.md new file mode 100644 index 000000000..9145179ec --- /dev/null +++ b/agile_documentation.md @@ -0,0 +1,24 @@ +# Agile Documentation +* Epic: CSS Framework Selection: + * Initiative: CSS Performance Testing Framework: Develop a framework to test the performance of different CSS frameworks, and evaluate the results to select the best one for our web application. + * User Story: As developers, we want to test the performance of different CSS frameworks, so we can select the best one for our web application. + +* Epic: Legal Compliance: + * Initiative: Legal Compliance Audit: Conduct a legal compliance audit of our web application, identify potential legal requirements, and implement necessary changes to ensure compliance. + * User Story: As developers, we want to ensure that our web application adheres to all potential legal requirements, so we do not get sued and can operate with confidence. + +* Epic: Search Engine Optimization + * Initiative: SEO Optimization Strategy: Develop an SEO optimization strategy for our web application, based on keyword research, on-page optimization, link building, and analytics tracking, to improve visibility and ranking on search engines. + * User Story: : As developers, we want to perform SEO on our web application, so that we will have higher visibility and ranking on search engines, which can attract more users. + +* Epic: Web Accessibility: + * Initiative: Accessibility Standards Implementation: Implement accessibility standards for our web application, such as WCAG 2.1, and conduct accessibility testing to ensure that our application is accessible to all users. + * User Story: As developers, we want to ensure that our web application is accessible, so that all users, including those with disabilities or impairments, can use our application. + +* Epic: Internationalization: + * Initiative: Internationalization Implementation: Implement internationalization features for our web application, such as language and time zone selection, translation options, and cultural adaptation, to make our application accessible to users from different countries and cultures. + * User Story: As developers, we want to make our web application internationalized, so that it can be used by users from different countries, with different languages, time zones, and cultural backgrounds. + +* Epic: DevOps & SRE: + * Initiative: DevOps Automation Implementation: Implement DevOps practices, such as continuous integration, automated testing, and deployment automation, to streamline our development process and improve the efficiency and quality of our web application. + * User Story: As developers, we want to implement DevOps operations, so that we can automate testing for our web application, as well as trial different package managers to produce the most efficient app. diff --git a/lighthouserc.js b/lighthouserc.js new file mode 100644 index 000000000..da50f84a7 --- /dev/null +++ b/lighthouserc.js @@ -0,0 +1,10 @@ +module.exports = { + ci: { + collect: { + staticDistDir: "./nextjs-tailwind/out", // Update this with the directory where your static site files are located + }, + upload: { + target: "temporary-public-storage", + }, + }, +}; diff --git a/nextjs-tailwind/.gitignore b/nextjs-tailwind/.gitignore new file mode 100644 index 000000000..aa8d231b3 --- /dev/null +++ b/nextjs-tailwind/.gitignore @@ -0,0 +1,3 @@ +.next +node_modules +nextjs \ No newline at end of file diff --git a/nextjs-tailwind/.next/build-manifest.json b/nextjs-tailwind/.next/build-manifest.json new file mode 100644 index 000000000..3219a350c --- /dev/null +++ b/nextjs-tailwind/.next/build-manifest.json @@ -0,0 +1,48 @@ +{ + "polyfillFiles": [ + "static/chunks/polyfills-c67a75d1b6f99dc8.js" + ], + "devFiles": [], + "ampDevFiles": [], + "lowPriorityFiles": [ + "static/qoOcYhOJr35_hxGsTufz0/_buildManifest.js", + "static/qoOcYhOJr35_hxGsTufz0/_ssgManifest.js" + ], + "rootMainFiles": [], + "pages": { + "/": [ +<<<<<<< HEAD + "static/chunks/webpack.js", + "static/chunks/main.js", + "static/chunks/pages/index.js" +======= + "static/chunks/webpack-8fa1640cc84ba8fe.js", + "static/chunks/framework-cda2f1305c3d9424.js", + "static/chunks/main-7477d36a73a3487c.js", + "static/chunks/664-8af8765c6fed5950.js", + "static/chunks/pages/index-f186d9255c9723c4.js" +>>>>>>> 6f66b5540804f9c1185fee28809018f4b1176a4e + ], + "/_app": [ + "static/chunks/webpack-8fa1640cc84ba8fe.js", + "static/chunks/framework-cda2f1305c3d9424.js", + "static/chunks/main-7477d36a73a3487c.js", + "static/css/19de0c04e16bfeb8.css", + "static/chunks/pages/_app-13a04ff25ee58f5a.js" + ], + "/_error": [ + "static/chunks/webpack-8fa1640cc84ba8fe.js", + "static/chunks/framework-cda2f1305c3d9424.js", + "static/chunks/main-7477d36a73a3487c.js", + "static/chunks/pages/_error-54de1933a164a1ff.js" + ], + "/content": [ + "static/chunks/webpack-8fa1640cc84ba8fe.js", + "static/chunks/framework-cda2f1305c3d9424.js", + "static/chunks/main-7477d36a73a3487c.js", + "static/chunks/664-8af8765c6fed5950.js", + "static/chunks/pages/content-0397b03146a21a97.js" + ] + }, + "ampFirstPages": [] +} \ No newline at end of file diff --git a/nextjs-tailwind/.next/cache/webpack/client-development-fallback/0.pack b/nextjs-tailwind/.next/cache/webpack/client-development-fallback/0.pack new file mode 100644 index 000000000..d7316a063 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development-fallback/0.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development-fallback/1.pack b/nextjs-tailwind/.next/cache/webpack/client-development-fallback/1.pack new file mode 100644 index 000000000..a22f5fb75 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development-fallback/1.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development-fallback/index.pack b/nextjs-tailwind/.next/cache/webpack/client-development-fallback/index.pack new file mode 100644 index 000000000..23ea7a501 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development-fallback/index.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development-fallback/index.pack.old b/nextjs-tailwind/.next/cache/webpack/client-development-fallback/index.pack.old new file mode 100644 index 000000000..5ffeca048 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development-fallback/index.pack.old differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/0.pack b/nextjs-tailwind/.next/cache/webpack/client-development/0.pack new file mode 100644 index 000000000..28c5d81c5 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/0.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/1.pack b/nextjs-tailwind/.next/cache/webpack/client-development/1.pack new file mode 100644 index 000000000..224b5ca1d Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/1.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/2.pack b/nextjs-tailwind/.next/cache/webpack/client-development/2.pack new file mode 100644 index 000000000..f2aad9385 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/2.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/3.pack b/nextjs-tailwind/.next/cache/webpack/client-development/3.pack new file mode 100644 index 000000000..44f2c0b46 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/3.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/4.pack b/nextjs-tailwind/.next/cache/webpack/client-development/4.pack new file mode 100644 index 000000000..7e7b2e04d Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/4.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/5.pack b/nextjs-tailwind/.next/cache/webpack/client-development/5.pack new file mode 100644 index 000000000..bb447f49f Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/5.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/6.pack b/nextjs-tailwind/.next/cache/webpack/client-development/6.pack new file mode 100644 index 000000000..c71970d5e Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/6.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/7.pack b/nextjs-tailwind/.next/cache/webpack/client-development/7.pack new file mode 100644 index 000000000..505e98f93 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/7.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/8.pack b/nextjs-tailwind/.next/cache/webpack/client-development/8.pack new file mode 100644 index 000000000..37b820fd8 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/8.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/9.pack b/nextjs-tailwind/.next/cache/webpack/client-development/9.pack new file mode 100644 index 000000000..9aad1cf74 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/9.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/index.pack b/nextjs-tailwind/.next/cache/webpack/client-development/index.pack new file mode 100644 index 000000000..25679d466 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/index.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/client-development/index.pack.old b/nextjs-tailwind/.next/cache/webpack/client-development/index.pack.old new file mode 100644 index 000000000..9a46d879a Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/client-development/index.pack.old differ diff --git a/nextjs-tailwind/.next/cache/webpack/server-development/0.pack b/nextjs-tailwind/.next/cache/webpack/server-development/0.pack new file mode 100644 index 000000000..4b92694b7 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/server-development/0.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/server-development/1.pack b/nextjs-tailwind/.next/cache/webpack/server-development/1.pack new file mode 100644 index 000000000..440c163ec Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/server-development/1.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/server-development/2.pack b/nextjs-tailwind/.next/cache/webpack/server-development/2.pack new file mode 100644 index 000000000..796a59d00 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/server-development/2.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/server-development/3.pack b/nextjs-tailwind/.next/cache/webpack/server-development/3.pack new file mode 100644 index 000000000..5473d55e0 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/server-development/3.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/server-development/4.pack b/nextjs-tailwind/.next/cache/webpack/server-development/4.pack new file mode 100644 index 000000000..4155c0af2 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/server-development/4.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/server-development/5.pack b/nextjs-tailwind/.next/cache/webpack/server-development/5.pack new file mode 100644 index 000000000..cf50f88ca Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/server-development/5.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/server-development/6.pack b/nextjs-tailwind/.next/cache/webpack/server-development/6.pack new file mode 100644 index 000000000..0972fe3cb Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/server-development/6.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/server-development/7.pack b/nextjs-tailwind/.next/cache/webpack/server-development/7.pack new file mode 100644 index 000000000..e6ffb63ef Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/server-development/7.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/server-development/index.pack b/nextjs-tailwind/.next/cache/webpack/server-development/index.pack new file mode 100644 index 000000000..46f31845d Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/server-development/index.pack differ diff --git a/nextjs-tailwind/.next/cache/webpack/server-development/index.pack.old b/nextjs-tailwind/.next/cache/webpack/server-development/index.pack.old new file mode 100644 index 000000000..37289f655 Binary files /dev/null and b/nextjs-tailwind/.next/cache/webpack/server-development/index.pack.old differ diff --git a/nextjs-tailwind/.next/package.json b/nextjs-tailwind/.next/package.json new file mode 100644 index 000000000..7156107e3 --- /dev/null +++ b/nextjs-tailwind/.next/package.json @@ -0,0 +1 @@ +{"type": "commonjs"} \ No newline at end of file diff --git a/nextjs-tailwind/.next/react-loadable-manifest.json b/nextjs-tailwind/.next/react-loadable-manifest.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/nextjs-tailwind/.next/react-loadable-manifest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/nextjs-tailwind/.next/server/middleware-build-manifest.js b/nextjs-tailwind/.next/server/middleware-build-manifest.js new file mode 100644 index 000000000..8e1fadd0e --- /dev/null +++ b/nextjs-tailwind/.next/server/middleware-build-manifest.js @@ -0,0 +1,5 @@ +<<<<<<< HEAD +self.__BUILD_MANIFEST={"polyfillFiles":["static/chunks/polyfills.js"],"devFiles":["static/chunks/react-refresh.js"],"ampDevFiles":["static/chunks/webpack.js","static/chunks/amp.js"],"lowPriorityFiles":["static/development/_buildManifest.js","static/development/_ssgManifest.js"],"rootMainFiles":[],"pages":{"/":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/index.js"],"/_app":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/_app.js"],"/_error":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/_error.js"],"/content":["static/chunks/webpack.js","static/chunks/main.js","static/chunks/pages/content.js"]},"ampFirstPages":[]} +======= +self.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-c67a75d1b6f99dc8.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:["static/qoOcYhOJr35_hxGsTufz0/_buildManifest.js","static/qoOcYhOJr35_hxGsTufz0/_ssgManifest.js"],rootMainFiles:[],pages:{"/":["static/chunks/webpack-8fa1640cc84ba8fe.js","static/chunks/framework-cda2f1305c3d9424.js","static/chunks/main-7477d36a73a3487c.js","static/chunks/664-8af8765c6fed5950.js","static/chunks/pages/index-f186d9255c9723c4.js"],"/_app":["static/chunks/webpack-8fa1640cc84ba8fe.js","static/chunks/framework-cda2f1305c3d9424.js","static/chunks/main-7477d36a73a3487c.js","static/css/19de0c04e16bfeb8.css","static/chunks/pages/_app-13a04ff25ee58f5a.js"],"/_error":["static/chunks/webpack-8fa1640cc84ba8fe.js","static/chunks/framework-cda2f1305c3d9424.js","static/chunks/main-7477d36a73a3487c.js","static/chunks/pages/_error-54de1933a164a1ff.js"],"/content":["static/chunks/webpack-8fa1640cc84ba8fe.js","static/chunks/framework-cda2f1305c3d9424.js","static/chunks/main-7477d36a73a3487c.js","static/chunks/664-8af8765c6fed5950.js","static/chunks/pages/content-0397b03146a21a97.js"]},ampFirstPages:[]}; +>>>>>>> 6f66b5540804f9c1185fee28809018f4b1176a4e diff --git a/nextjs-tailwind/.next/server/middleware-manifest.json b/nextjs-tailwind/.next/server/middleware-manifest.json new file mode 100644 index 000000000..57712aad3 --- /dev/null +++ b/nextjs-tailwind/.next/server/middleware-manifest.json @@ -0,0 +1,6 @@ +{ + "sortedMiddleware": [], + "middleware": {}, + "functions": {}, + "version": 2 +} \ No newline at end of file diff --git a/nextjs-tailwind/.next/server/middleware-react-loadable-manifest.js b/nextjs-tailwind/.next/server/middleware-react-loadable-manifest.js new file mode 100644 index 000000000..bebba06e2 --- /dev/null +++ b/nextjs-tailwind/.next/server/middleware-react-loadable-manifest.js @@ -0,0 +1 @@ +self.__REACT_LOADABLE_MANIFEST={}; \ No newline at end of file diff --git a/nextjs-tailwind/.next/server/next-font-manifest.js b/nextjs-tailwind/.next/server/next-font-manifest.js new file mode 100644 index 000000000..fc972205d --- /dev/null +++ b/nextjs-tailwind/.next/server/next-font-manifest.js @@ -0,0 +1 @@ +self.__NEXT_FONT_MANIFEST={pages:{},app:{},appUsingSizeAdjust:!1,pagesUsingSizeAdjust:!1}; \ No newline at end of file diff --git a/nextjs-tailwind/.next/server/next-font-manifest.json b/nextjs-tailwind/.next/server/next-font-manifest.json new file mode 100644 index 000000000..e0cc40075 --- /dev/null +++ b/nextjs-tailwind/.next/server/next-font-manifest.json @@ -0,0 +1,6 @@ +{ + "pages": {}, + "app": {}, + "appUsingSizeAdjust": false, + "pagesUsingSizeAdjust": false +} \ No newline at end of file diff --git a/nextjs-tailwind/.next/server/pages-manifest.json b/nextjs-tailwind/.next/server/pages-manifest.json new file mode 100644 index 000000000..abfc3b73a --- /dev/null +++ b/nextjs-tailwind/.next/server/pages-manifest.json @@ -0,0 +1,13 @@ +{ + "/content": "pages/content.html", + "/": "pages/index.html", + "/_app": "pages/_app.js", + "/_error": "pages/_error.js", + "/_document": "pages/_document.js", +<<<<<<< HEAD + "/content": "pages/content.js", + "/": "pages/index.js" +======= + "/404": "pages/404.html" +>>>>>>> 6f66b5540804f9c1185fee28809018f4b1176a4e +} \ No newline at end of file diff --git a/nextjs-tailwind/.next/server/pages/_app.js b/nextjs-tailwind/.next/server/pages/_app.js new file mode 100644 index 000000000..ef4bde433 --- /dev/null +++ b/nextjs-tailwind/.next/server/pages/_app.js @@ -0,0 +1,56 @@ +(() => { +var exports = {}; +exports.id = 888; +exports.ids = [888]; +exports.modules = { + +/***/ 879: +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997); +/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _styles_globals_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(764); +/* harmony import */ var _styles_globals_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_styles_globals_css__WEBPACK_IMPORTED_MODULE_1__); + + +function MyApp({ Component , pageProps }) { + return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(Component, { + ...pageProps + }); +} +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MyApp); + + +/***/ }), + +/***/ 764: +/***/ (() => { + + + +/***/ }), + +/***/ 997: +/***/ ((module) => { + +"use strict"; +module.exports = require("react/jsx-runtime"); + +/***/ }) + +}; +; + +// load runtime +var __webpack_require__ = require("../webpack-runtime.js"); +__webpack_require__.C(exports); +var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) +var __webpack_exports__ = (__webpack_exec__(879)); +module.exports = __webpack_exports__; + +})(); \ No newline at end of file diff --git a/nextjs-tailwind/.next/server/pages/_document.js b/nextjs-tailwind/.next/server/pages/_document.js new file mode 100644 index 000000000..482157196 --- /dev/null +++ b/nextjs-tailwind/.next/server/pages/_document.js @@ -0,0 +1,867 @@ +"use strict"; +(() => { +var exports = {}; +exports.id = 660; +exports.ids = [660]; +exports.modules = { + +/***/ 940: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + + +Object.defineProperty(exports, "__esModule", ({ + value: true +})); +exports.Html = Html; +exports.Main = Main; +exports["default"] = void 0; +var _react = _interopRequireWildcard(__webpack_require__(689)); +var _constants = __webpack_require__(724); +var _getPageFiles = __webpack_require__(140); +var _htmlescape = __webpack_require__(716); +var _isError = _interopRequireDefault(__webpack_require__(676)); +var _htmlContext = __webpack_require__(743); +class Document extends _react.default.Component { + /** + * `getInitialProps` hook returns the context object with the addition of `renderPage`. + * `renderPage` callback executes `React` rendering logic synchronously to support server-rendering wrappers + */ static getInitialProps(ctx) { + return ctx.defaultGetInitialProps(ctx); + } + render() { + return /*#__PURE__*/ _react.default.createElement(Html, null, /*#__PURE__*/ _react.default.createElement(Head, null), /*#__PURE__*/ _react.default.createElement("body", null, /*#__PURE__*/ _react.default.createElement(Main, null), /*#__PURE__*/ _react.default.createElement(NextScript, null))); + } +} +exports["default"] = Document; +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + var cache = new WeakMap(); + _getRequireWildcardCache = function() { + return cache; + }; + return cache; +} +function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + var cache = _getRequireWildcardCache(); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** Set of pages that have triggered a large data warning on production mode. */ const largePageDataWarnings = new Set(); +function getDocumentFiles(buildManifest, pathname, inAmpMode) { + const sharedFiles = (0, _getPageFiles).getPageFiles(buildManifest, "/_app"); + const pageFiles = true && inAmpMode ? [] : (0, _getPageFiles).getPageFiles(buildManifest, pathname); + return { + sharedFiles, + pageFiles, + allFiles: [ + ...new Set([ + ...sharedFiles, + ...pageFiles + ]) + ] + }; +} +function getPolyfillScripts(context, props) { + // polyfills.js has to be rendered as nomodule without async + // It also has to be the first script to load + const { assetPrefix , buildManifest , devOnlyCacheBusterQueryString , disableOptimizedLoading , crossOrigin } = context; + return buildManifest.polyfillFiles.filter((polyfill)=>polyfill.endsWith(".js") && !polyfill.endsWith(".module.js")).map((polyfill)=>/*#__PURE__*/ _react.default.createElement("script", { + key: polyfill, + defer: !disableOptimizedLoading, + nonce: props.nonce, + crossOrigin: props.crossOrigin || crossOrigin, + noModule: true, + src: `${assetPrefix}/_next/${polyfill}${devOnlyCacheBusterQueryString}` + })); +} +function hasComponentProps(child) { + return !!child && !!child.props; +} +function AmpStyles({ styles }) { + if (!styles) return null; + // try to parse styles from fragment for backwards compat + const curStyles = Array.isArray(styles) ? styles : []; + if (styles.props && // @ts-ignore Property 'props' does not exist on type ReactElement + Array.isArray(styles.props.children)) { + const hasStyles = (el)=>{ + var ref, ref1; + return el == null ? void 0 : (ref = el.props) == null ? void 0 : (ref1 = ref.dangerouslySetInnerHTML) == null ? void 0 : ref1.__html; + }; + // @ts-ignore Property 'props' does not exist on type ReactElement + styles.props.children.forEach((child)=>{ + if (Array.isArray(child)) { + child.forEach((el)=>hasStyles(el) && curStyles.push(el)); + } else if (hasStyles(child)) { + curStyles.push(child); + } + }); + } + /* Add custom styles before AMP styles to prevent accidental overrides */ return /*#__PURE__*/ _react.default.createElement("style", { + "amp-custom": "", + dangerouslySetInnerHTML: { + __html: curStyles.map((style)=>style.props.dangerouslySetInnerHTML.__html).join("").replace(/\/\*# sourceMappingURL=.*\*\//g, "").replace(/\/\*@ sourceURL=.*?\*\//g, "") + } + }); +} +function getDynamicChunks(context, props, files) { + const { dynamicImports , assetPrefix , isDevelopment , devOnlyCacheBusterQueryString , disableOptimizedLoading , crossOrigin } = context; + return dynamicImports.map((file)=>{ + if (!file.endsWith(".js") || files.allFiles.includes(file)) return null; + return /*#__PURE__*/ _react.default.createElement("script", { + async: !isDevelopment && disableOptimizedLoading, + defer: !disableOptimizedLoading, + key: file, + src: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`, + nonce: props.nonce, + crossOrigin: props.crossOrigin || crossOrigin + }); + }); +} +function getScripts(context, props, files) { + var ref; + const { assetPrefix , buildManifest , isDevelopment , devOnlyCacheBusterQueryString , disableOptimizedLoading , crossOrigin } = context; + const normalScripts = files.allFiles.filter((file)=>file.endsWith(".js")); + const lowPriorityScripts = (ref = buildManifest.lowPriorityFiles) == null ? void 0 : ref.filter((file)=>file.endsWith(".js")); + return [ + ...normalScripts, + ...lowPriorityScripts + ].map((file)=>{ + return /*#__PURE__*/ _react.default.createElement("script", { + key: file, + src: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`, + nonce: props.nonce, + async: !isDevelopment && disableOptimizedLoading, + defer: !disableOptimizedLoading, + crossOrigin: props.crossOrigin || crossOrigin + }); + }); +} +function getPreNextWorkerScripts(context, props) { + const { assetPrefix , scriptLoader , crossOrigin , nextScriptWorkers } = context; + // disable `nextScriptWorkers` in edge runtime + if (!nextScriptWorkers || "nodejs" === "edge") return null; + try { + let { partytownSnippet } = require("@builder.io/partytown/integration"); + const children = Array.isArray(props.children) ? props.children : [ + props.children + ]; + // Check to see if the user has defined their own Partytown configuration + const userDefinedConfig = children.find((child)=>{ + var ref, ref2; + return hasComponentProps(child) && (child == null ? void 0 : (ref = child.props) == null ? void 0 : (ref2 = ref.dangerouslySetInnerHTML) == null ? void 0 : ref2.__html.length) && "data-partytown-config" in child.props; + }); + return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, !userDefinedConfig && /*#__PURE__*/ _react.default.createElement("script", { + "data-partytown-config": "", + dangerouslySetInnerHTML: { + __html: ` + partytown = { + lib: "${assetPrefix}/_next/static/~partytown/" + }; + ` + } + }), /*#__PURE__*/ _react.default.createElement("script", { + "data-partytown": "", + dangerouslySetInnerHTML: { + __html: partytownSnippet() + } + }), (scriptLoader.worker || []).map((file, index)=>{ + const { strategy , src , children: scriptChildren , dangerouslySetInnerHTML , ...scriptProps } = file; + let srcProps = {}; + if (src) { + // Use external src if provided + srcProps.src = src; + } else if (dangerouslySetInnerHTML && dangerouslySetInnerHTML.__html) { + // Embed inline script if provided with dangerouslySetInnerHTML + srcProps.dangerouslySetInnerHTML = { + __html: dangerouslySetInnerHTML.__html + }; + } else if (scriptChildren) { + // Embed inline script if provided with children + srcProps.dangerouslySetInnerHTML = { + __html: typeof scriptChildren === "string" ? scriptChildren : Array.isArray(scriptChildren) ? scriptChildren.join("") : "" + }; + } else { + throw new Error("Invalid usage of next/script. Did you forget to include a src attribute or an inline script? https://nextjs.org/docs/messages/invalid-script"); + } + return /*#__PURE__*/ _react.default.createElement("script", Object.assign({}, srcProps, scriptProps, { + type: "text/partytown", + key: src || index, + nonce: props.nonce, + "data-nscript": "worker", + crossOrigin: props.crossOrigin || crossOrigin + })); + })); + } catch (err) { + if ((0, _isError).default(err) && err.code !== "MODULE_NOT_FOUND") { + console.warn(`Warning: ${err.message}`); + } + return null; + } +} +function getPreNextScripts(context, props) { + const { scriptLoader , disableOptimizedLoading , crossOrigin } = context; + const webWorkerScripts = getPreNextWorkerScripts(context, props); + const beforeInteractiveScripts = (scriptLoader.beforeInteractive || []).filter((script)=>script.src).map((file, index)=>{ + const { strategy , ...scriptProps } = file; + return /*#__PURE__*/ _react.default.createElement("script", Object.assign({}, scriptProps, { + key: scriptProps.src || index, + defer: scriptProps.defer ?? !disableOptimizedLoading, + nonce: props.nonce, + "data-nscript": "beforeInteractive", + crossOrigin: props.crossOrigin || crossOrigin + })); + }); + return /*#__PURE__*/ _react.default.createElement(_react.default.Fragment, null, webWorkerScripts, beforeInteractiveScripts); +} +function getHeadHTMLProps(props) { + const { crossOrigin , nonce , ...restProps } = props; + // This assignment is necessary for additional type checking to avoid unsupported attributes in
+ const headProps = restProps; + return headProps; +} +function getAmpPath(ampPath, asPath) { + return ampPath || `${asPath}${asPath.includes("?") ? "&" : "?"}amp=1`; +} +function getNextFontLinkTags(nextFontManifest, dangerousAsPath, assetPrefix = "") { + if (!nextFontManifest) { + return { + preconnect: null, + preload: null + }; + } + const appFontsEntry = nextFontManifest.pages["/_app"]; + const pageFontsEntry = nextFontManifest.pages[dangerousAsPath]; + const preloadedFontFiles = [ + ...appFontsEntry ?? [], + ...pageFontsEntry ?? [] + ]; + // If no font files should preload but there's an entry for the path, add a preconnect tag. + const preconnectToSelf = !!(preloadedFontFiles.length === 0 && (appFontsEntry || pageFontsEntry)); + return { + preconnect: preconnectToSelf ? /*#__PURE__*/ _react.default.createElement("link", { + "data-next-font": nextFontManifest.pagesUsingSizeAdjust ? "size-adjust" : "", + rel: "preconnect", + href: "/", + crossOrigin: "anonymous" + }) : null, + preload: preloadedFontFiles ? preloadedFontFiles.map((fontFile)=>{ + const ext = /\.(woff|woff2|eot|ttf|otf)$/.exec(fontFile)[1]; + return /*#__PURE__*/ _react.default.createElement("link", { + key: fontFile, + rel: "preload", + href: `${assetPrefix}/_next/${encodeURI(fontFile)}`, + as: "font", + type: `font/${ext}`, + crossOrigin: "anonymous", + "data-next-font": fontFile.includes("-s") ? "size-adjust" : "" + }); + }) : null + }; +} +class Head extends _react.default.Component { + static contextType = _htmlContext.HtmlContext; + getCssLinks(files) { + const { assetPrefix , devOnlyCacheBusterQueryString , dynamicImports , crossOrigin , optimizeCss , optimizeFonts } = this.context; + const cssFiles = files.allFiles.filter((f)=>f.endsWith(".css")); + const sharedFiles = new Set(files.sharedFiles); + // Unmanaged files are CSS files that will be handled directly by the + // webpack runtime (`mini-css-extract-plugin`). + let unmangedFiles = new Set([]); + let dynamicCssFiles = Array.from(new Set(dynamicImports.filter((file)=>file.endsWith(".css")))); + if (dynamicCssFiles.length) { + const existing = new Set(cssFiles); + dynamicCssFiles = dynamicCssFiles.filter((f)=>!(existing.has(f) || sharedFiles.has(f))); + unmangedFiles = new Set(dynamicCssFiles); + cssFiles.push(...dynamicCssFiles); + } + let cssLinkElements = []; + cssFiles.forEach((file)=>{ + const isSharedFile = sharedFiles.has(file); + if (!optimizeCss) { + cssLinkElements.push(/*#__PURE__*/ _react.default.createElement("link", { + key: `${file}-preload`, + nonce: this.props.nonce, + rel: "preload", + href: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`, + as: "style", + crossOrigin: this.props.crossOrigin || crossOrigin + })); + } + const isUnmanagedFile = unmangedFiles.has(file); + cssLinkElements.push(/*#__PURE__*/ _react.default.createElement("link", { + key: file, + nonce: this.props.nonce, + rel: "stylesheet", + href: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`, + crossOrigin: this.props.crossOrigin || crossOrigin, + "data-n-g": isUnmanagedFile ? undefined : isSharedFile ? "" : undefined, + "data-n-p": isUnmanagedFile ? undefined : isSharedFile ? undefined : "" + })); + }); + if ( true && optimizeFonts) { + cssLinkElements = this.makeStylesheetInert(cssLinkElements); + } + return cssLinkElements.length === 0 ? null : cssLinkElements; + } + getPreloadDynamicChunks() { + const { dynamicImports , assetPrefix , devOnlyCacheBusterQueryString , crossOrigin } = this.context; + return dynamicImports.map((file)=>{ + if (!file.endsWith(".js")) { + return null; + } + return /*#__PURE__*/ _react.default.createElement("link", { + rel: "preload", + key: file, + href: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`, + as: "script", + nonce: this.props.nonce, + crossOrigin: this.props.crossOrigin || crossOrigin + }); + }) // Filter out nulled scripts + .filter(Boolean); + } + getPreloadMainLinks(files) { + const { assetPrefix , devOnlyCacheBusterQueryString , scriptLoader , crossOrigin } = this.context; + const preloadFiles = files.allFiles.filter((file)=>{ + return file.endsWith(".js"); + }); + return [ + ...(scriptLoader.beforeInteractive || []).map((file)=>/*#__PURE__*/ _react.default.createElement("link", { + key: file.src, + nonce: this.props.nonce, + rel: "preload", + href: file.src, + as: "script", + crossOrigin: this.props.crossOrigin || crossOrigin + })), + ...preloadFiles.map((file)=>/*#__PURE__*/ _react.default.createElement("link", { + key: file, + nonce: this.props.nonce, + rel: "preload", + href: `${assetPrefix}/_next/${encodeURI(file)}${devOnlyCacheBusterQueryString}`, + as: "script", + crossOrigin: this.props.crossOrigin || crossOrigin + })) + ]; + } + getBeforeInteractiveInlineScripts() { + const { scriptLoader } = this.context; + const { nonce , crossOrigin } = this.props; + return (scriptLoader.beforeInteractive || []).filter((script)=>!script.src && (script.dangerouslySetInnerHTML || script.children)).map((file, index)=>{ + const { strategy , children , dangerouslySetInnerHTML , src , ...scriptProps } = file; + let html = ""; + if (dangerouslySetInnerHTML && dangerouslySetInnerHTML.__html) { + html = dangerouslySetInnerHTML.__html; + } else if (children) { + html = typeof children === "string" ? children : Array.isArray(children) ? children.join("") : ""; + } + return /*#__PURE__*/ _react.default.createElement("script", Object.assign({}, scriptProps, { + dangerouslySetInnerHTML: { + __html: html + }, + key: scriptProps.id || index, + nonce: nonce, + "data-nscript": "beforeInteractive", + crossOrigin: crossOrigin || undefined + })); + }); + } + getDynamicChunks(files) { + return getDynamicChunks(this.context, this.props, files); + } + getPreNextScripts() { + return getPreNextScripts(this.context, this.props); + } + getScripts(files) { + return getScripts(this.context, this.props, files); + } + getPolyfillScripts() { + return getPolyfillScripts(this.context, this.props); + } + makeStylesheetInert(node) { + return _react.default.Children.map(node, (c)=>{ + var ref5, ref3; + if ((c == null ? void 0 : c.type) === "link" && (c == null ? void 0 : (ref5 = c.props) == null ? void 0 : ref5.href) && _constants.OPTIMIZED_FONT_PROVIDERS.some(({ url })=>{ + var ref, ref4; + return c == null ? void 0 : (ref = c.props) == null ? void 0 : (ref4 = ref.href) == null ? void 0 : ref4.startsWith(url); + })) { + const newProps = { + ...c.props || {}, + "data-href": c.props.href, + href: undefined + }; + return /*#__PURE__*/ _react.default.cloneElement(c, newProps); + } else if (c == null ? void 0 : (ref3 = c.props) == null ? void 0 : ref3.children) { + const newProps = { + ...c.props || {}, + children: this.makeStylesheetInert(c.props.children) + }; + return /*#__PURE__*/ _react.default.cloneElement(c, newProps); + } + return c; + }).filter(Boolean); + } + render() { + const { styles , ampPath , inAmpMode , hybridAmp , canonicalBase , __NEXT_DATA__ , dangerousAsPath , headTags , unstable_runtimeJS , unstable_JsPreload , disableOptimizedLoading , optimizeCss , optimizeFonts , assetPrefix , nextFontManifest } = this.context; + const disableRuntimeJS = unstable_runtimeJS === false; + const disableJsPreload = unstable_JsPreload === false || !disableOptimizedLoading; + this.context.docComponentsRendered.Head = true; + let { head } = this.context; + let cssPreloads = []; + let otherHeadElements = []; + if (head) { + head.forEach((c)=>{ + if (c && c.type === "link" && c.props["rel"] === "preload" && c.props["as"] === "style") { + cssPreloads.push(c); + } else { + c && otherHeadElements.push(c); + } + }); + head = cssPreloads.concat(otherHeadElements); + } + let children = _react.default.Children.toArray(this.props.children).filter(Boolean); + // show a warning if Head contains