From aebf4fd17ede4b8558acd122ac42ad7c87d2165e Mon Sep 17 00:00:00 2001 From: Ricky Mormor Date: Tue, 20 Sep 2022 22:10:19 +0000 Subject: [PATCH 01/16] =?UTF-8?q?=F0=9F=9B=A0=20=20WORKING=20ON:=20project?= =?UTF-8?q?s=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/projects/Projects.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/components/projects/Projects.js diff --git a/src/components/projects/Projects.js b/src/components/projects/Projects.js new file mode 100644 index 0000000..9abd0eb --- /dev/null +++ b/src/components/projects/Projects.js @@ -0,0 +1,9 @@ +import React from 'react' + +const Projects = () => { + return ( +
Projects
+ ) +} + +export default Projects \ No newline at end of file From 943dcb46d0e9ce895402a86b7d3a5b727e6af198 Mon Sep 17 00:00:00 2001 From: Ricky Mormor Date: Fri, 23 Sep 2022 19:43:41 +0000 Subject: [PATCH 02/16] =?UTF-8?q?=F0=9F=9B=A0=20=20WORKING=20ON:=20hiding?= =?UTF-8?q?=20keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 + package-lock.json | 235 ++++++++++++++++++++++++++++ package.json | 1 + src/components/projects/Projects.js | 22 ++- 4 files changed, 258 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 4d29575..9067a86 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,7 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +# Api keys +.env +/src/apiKeys.js \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4690d72..733f636 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@formspree/react": "^2.2.5", "@mui/icons-material": "^5.8.3", "@mui/material": "^5.8.3", + "@octokit/core": "^4.0.5", "@pmndrs/branding": "0.0.8", "@react-three/drei": "8.8.3", "@react-three/fiber": "7.0.25", @@ -3402,6 +3403,118 @@ "node": ">= 8" } }, + "node_modules/@octokit/auth-token": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", + "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", + "dependencies": { + "@octokit/types": "^7.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/core": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.5.tgz", + "integrity": "sha512-4R3HeHTYVHCfzSAi0C6pbGXV8UDI5Rk+k3G7kLVNckswN9mvpOzW9oENfjfH3nEmzg8y3AmKmzs8Sg6pLCeOCA==", + "dependencies": { + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^7.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/endpoint": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.2.tgz", + "integrity": "sha512-8/AUACfE9vpRpehE6ZLfEtzkibe5nfsSwFZVMsG8qabqRt1M81qZYUFRZa1B8w8lP6cdfDJfRq9HWS+MbmR7tw==", + "dependencies": { + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/endpoint/node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@octokit/graphql": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.1.tgz", + "integrity": "sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA==", + "dependencies": { + "@octokit/request": "^6.0.0", + "@octokit/types": "^7.0.0", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/openapi-types": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.12.0.tgz", + "integrity": "sha512-1QYzZrwnn3rTQE7ZoSxXrO8lhu0aIbac1c+qIPOPEaVXBWSaUyLV1x9yt4uDQOwmu6u5ywVS8OJgs+ErDLf6vQ==" + }, + "node_modules/@octokit/request": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", + "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", + "dependencies": { + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/request-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", + "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", + "dependencies": { + "@octokit/types": "^7.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/@octokit/request/node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@octokit/types": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.0.tgz", + "integrity": "sha512-aHm+olfIZjQpzoODpl+RCZzchKOrdSLJs+yfI7pMMcmB19Li6vidgx0DwUDO/Ic4Q3fq/lOjJORVCcLZefcrJw==", + "dependencies": { + "@octokit/openapi-types": "^13.11.0" + } + }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.7.tgz", @@ -6099,6 +6212,11 @@ "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==" }, + "node_modules/before-after-hook": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" + }, "node_modules/bfj": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/bfj/-/bfj-7.0.2.tgz", @@ -7914,6 +8032,11 @@ "node": ">= 0.8" } }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, "node_modules/des.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", @@ -22500,6 +22623,11 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" + }, "node_modules/universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", @@ -26282,6 +26410,98 @@ "fastq": "^1.6.0" } }, + "@octokit/auth-token": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.1.tgz", + "integrity": "sha512-/USkK4cioY209wXRpund6HZzHo9GmjakpV9ycOkpMcMxMk7QVcVFVyCMtzvXYiHsB2crgDgrtNYSELYFBXhhaA==", + "requires": { + "@octokit/types": "^7.0.0" + } + }, + "@octokit/core": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-4.0.5.tgz", + "integrity": "sha512-4R3HeHTYVHCfzSAi0C6pbGXV8UDI5Rk+k3G7kLVNckswN9mvpOzW9oENfjfH3nEmzg8y3AmKmzs8Sg6pLCeOCA==", + "requires": { + "@octokit/auth-token": "^3.0.0", + "@octokit/graphql": "^5.0.0", + "@octokit/request": "^6.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^7.0.0", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/endpoint": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-7.0.2.tgz", + "integrity": "sha512-8/AUACfE9vpRpehE6ZLfEtzkibe5nfsSwFZVMsG8qabqRt1M81qZYUFRZa1B8w8lP6cdfDJfRq9HWS+MbmR7tw==", + "requires": { + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + } + } + }, + "@octokit/graphql": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-5.0.1.tgz", + "integrity": "sha512-sxmnewSwAixkP1TrLdE6yRG53eEhHhDTYUykUwdV9x8f91WcbhunIHk9x1PZLALdBZKRPUO2HRcm4kezZ79HoA==", + "requires": { + "@octokit/request": "^6.0.0", + "@octokit/types": "^7.0.0", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/openapi-types": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-13.12.0.tgz", + "integrity": "sha512-1QYzZrwnn3rTQE7ZoSxXrO8lhu0aIbac1c+qIPOPEaVXBWSaUyLV1x9yt4uDQOwmu6u5ywVS8OJgs+ErDLf6vQ==" + }, + "@octokit/request": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-6.2.1.tgz", + "integrity": "sha512-gYKRCia3cpajRzDSU+3pt1q2OcuC6PK8PmFIyxZDWCzRXRSIBH8jXjFJ8ZceoygBIm0KsEUg4x1+XcYBz7dHPQ==", + "requires": { + "@octokit/endpoint": "^7.0.0", + "@octokit/request-error": "^3.0.0", + "@octokit/types": "^7.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" + }, + "dependencies": { + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + } + } + }, + "@octokit/request-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-3.0.1.tgz", + "integrity": "sha512-ym4Bp0HTP7F3VFssV88WD1ZyCIRoE8H35pXSKwLeMizcdZAYc/t6N9X9Yr9n6t3aG9IH75XDnZ6UeZph0vHMWQ==", + "requires": { + "@octokit/types": "^7.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "@octokit/types": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-7.5.0.tgz", + "integrity": "sha512-aHm+olfIZjQpzoODpl+RCZzchKOrdSLJs+yfI7pMMcmB19Li6vidgx0DwUDO/Ic4Q3fq/lOjJORVCcLZefcrJw==", + "requires": { + "@octokit/openapi-types": "^13.11.0" + } + }, "@pmmmwh/react-refresh-webpack-plugin": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.7.tgz", @@ -28310,6 +28530,11 @@ "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", "integrity": "sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==" }, + "before-after-hook": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" + }, "bfj": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/bfj/-/bfj-7.0.2.tgz", @@ -29709,6 +29934,11 @@ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, "des.js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", @@ -40514,6 +40744,11 @@ "@types/unist": "^2.0.2" } }, + "universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" + }, "universalify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", diff --git a/package.json b/package.json index 141908d..c1b3a73 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "@formspree/react": "^2.2.5", "@mui/icons-material": "^5.8.3", "@mui/material": "^5.8.3", + "@octokit/core": "^4.0.5", "@pmndrs/branding": "0.0.8", "@react-three/drei": "8.8.3", "@react-three/fiber": "7.0.25", diff --git a/src/components/projects/Projects.js b/src/components/projects/Projects.js index 9abd0eb..d24002e 100644 --- a/src/components/projects/Projects.js +++ b/src/components/projects/Projects.js @@ -1,9 +1,23 @@ -import React from 'react' +import React, { useEffect } from 'react'; +import { Octokit } from '@octokit/core'; const Projects = () => { + const octokit = new Octokit({ auth: process.env.REACT_APP_GITHUB_TOKEN }); + useEffect(() => { + octokit.request('GET /user/repos', { + username: 'cwaku', + type: 'owner', + sort: 'updated', + direction: 'desc', + per_page: 100, + }).then((response) => { + console.log(response.data); + }); + }, []); + return (
Projects
- ) -} + ); +}; -export default Projects \ No newline at end of file +export default Projects; From d95451fd5cc9c6f41b764cf84b96ddf7b2e29d36 Mon Sep 17 00:00:00 2001 From: Ricky Mormor Date: Sat, 24 Sep 2022 12:44:59 +0000 Subject: [PATCH 03/16] =?UTF-8?q?=E2=9C=85=20FEAT:=20fetch=20and=20filter?= =?UTF-8?q?=20repos=20from=20Github=20Api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/projects/Projects.js | 16 +++++++++++----- src/pages/Home.js | 2 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/projects/Projects.js b/src/components/projects/Projects.js index d24002e..a2432cb 100644 --- a/src/components/projects/Projects.js +++ b/src/components/projects/Projects.js @@ -1,17 +1,19 @@ import React, { useEffect } from 'react'; import { Octokit } from '@octokit/core'; +import { GITHUB_TOKEN, GITHUB_USERNAME } from '../../apiKeys'; const Projects = () => { - const octokit = new Octokit({ auth: process.env.REACT_APP_GITHUB_TOKEN }); + const octokit = new Octokit({ auth: GITHUB_TOKEN }); useEffect(() => { - octokit.request('GET /user/repos', { - username: 'cwaku', - type: 'owner', + octokit.request('GET /user/starred', { + affiliation: 'owner', + visibility: 'public', sort: 'updated', direction: 'desc', per_page: 100, }).then((response) => { - console.log(response.data); + const myRepositories = response.data.filter((repo) => repo.owner.login === GITHUB_USERNAME); + console.log(myRepositories); }); }, []); @@ -21,3 +23,7 @@ const Projects = () => { }; export default Projects; + +// export const reposFilter = (repos) => { +// // search through a normalized data to find repos with owner key + diff --git a/src/pages/Home.js b/src/pages/Home.js index 1646b78..3ea890d 100644 --- a/src/pages/Home.js +++ b/src/pages/Home.js @@ -1,10 +1,12 @@ import Header from '../components/header/Header'; import AboutMe from '../components/about/About'; +import Projects from '../components/projects/Projects'; const Home = () => (
+
); From f671a8e717acda1abb380007ba96a0e8c8db99d3 Mon Sep 17 00:00:00 2001 From: Ricky Mormor Date: Sat, 24 Sep 2022 14:48:53 +0000 Subject: [PATCH 04/16] =?UTF-8?q?=E2=9C=85=20FEAT:=20add=20and=20style=20p?= =?UTF-8?q?rojects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/projects/Projects.js | 78 +++++++++++++++++++++++------ src/stylesheets/Skills.css | 52 ++++++++++++++++--- 2 files changed, 107 insertions(+), 23 deletions(-) diff --git a/src/components/projects/Projects.js b/src/components/projects/Projects.js index a2432cb..c99877a 100644 --- a/src/components/projects/Projects.js +++ b/src/components/projects/Projects.js @@ -2,28 +2,76 @@ import React, { useEffect } from 'react'; import { Octokit } from '@octokit/core'; import { GITHUB_TOKEN, GITHUB_USERNAME } from '../../apiKeys'; +import '../../stylesheets/Skills.css'; + const Projects = () => { + const [projects, setProjects] = React.useState([]); + const octokit = new Octokit({ auth: GITHUB_TOKEN }); useEffect(() => { - octokit.request('GET /user/starred', { - affiliation: 'owner', - visibility: 'public', - sort: 'updated', - direction: 'desc', - per_page: 100, - }).then((response) => { - const myRepositories = response.data.filter((repo) => repo.owner.login === GITHUB_USERNAME); - console.log(myRepositories); - }); + octokit + .request('GET /user/starred', { + affiliation: 'owner', + visibility: 'public', + sort: 'updated', + direction: 'desc', + per_page: 100, + }) + .then((response) => { + const myRepositories = response.data.filter( + (repo) => repo.owner.login === GITHUB_USERNAME, + ); + console.log(myRepositories); + setProjects(myRepositories); + }); }, []); return ( -
Projects
+
+

Projects

+
+ {projects.map((project) => ( +
+
+ avatar +
+
+
+

+ {project.name} +

+

+ {project.description} +

+
+
+ + {project.homepage && ( + + )} +
+
+
+ ))} +
+
); }; export default Projects; - -// export const reposFilter = (repos) => { -// // search through a normalized data to find repos with owner key - diff --git a/src/stylesheets/Skills.css b/src/stylesheets/Skills.css index e4c7432..69ce3df 100644 --- a/src/stylesheets/Skills.css +++ b/src/stylesheets/Skills.css @@ -1,11 +1,13 @@ -.skills__container { +.skills__container, +.projects__container { display: flex; flex-direction: column; align-items: center; padding: 0 16px 64px; } -.skills__container__title { +.skills__container__title, +.projects__container__title { font-family: 'DM Sans', sans-serif; font-style: normal; font-weight: 400; @@ -17,7 +19,8 @@ flex-grow: 0; } -.skills__container__skills { +.skills__container__skills, +.projects__container__projects { display: flex; flex-direction: column; align-items: flex-start; @@ -28,7 +31,8 @@ flex-grow: 0; } -.skills__container__skills__skill { +.skills__container__skills__skill, +.projects__container__projects__project { display: flex; flex-direction: column; align-items: flex-start; @@ -41,6 +45,10 @@ flex-grow: 0; } +.projects__container__projects__project { + align-items: center; +} + .skills__container__skills__skill__image { width: 50px; flex: none; @@ -48,7 +56,8 @@ flex-grow: 0; } -.skills__container__skills__skill__title { +.skills__container__skills__skill__title, +.projects__container__projects__project__description__title { font-family: 'DM Sans', sans-serif; font-style: normal; font-weight: 500; @@ -62,7 +71,8 @@ margin: 0; } -.skills__container__skills__skill__description { +.skills__container__skills__skill__description, +.projects__container__projects__project__description__text { font-family: 'DM Sans', sans-serif; font-style: normal; font-weight: 400; @@ -75,14 +85,40 @@ flex-grow: 0; } +.projects__container__projects__project__description { + display: flex; + flex-direction: column; + align-items: flex-start; + padding: 0; + gap: 10px; + flex: none; + order: 1; + flex-grow: 0; +} + +.projects__container__projects__project__description__links { + display: flex; + flex-direction: row; + align-items: center; + padding: 0; + gap: 16px; + width: 100%; + flex: none; + order: 3; + flex-grow: 0; + justify-content: space-around; +} + /* Desktop version */ @media screen and (min-width: 768px) { - .skills__container { + .skills__container, + .projects__container { padding: 0 165px 128px; gap: 60px; } - .skills__container__skills { + .skills__container__skills, + .projects__container__projects { display: grid; grid-template-columns: 354px 354px 354px; } From 2fbf99fece696379d85d9d383a005cfa84983a7b Mon Sep 17 00:00:00 2001 From: Ricky Mormor Date: Sat, 24 Sep 2022 15:27:33 +0000 Subject: [PATCH 05/16] =?UTF-8?q?=F0=9F=90=9B=20BUG=20FIX:=20fix=20linter?= =?UTF-8?q?=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/~partytown/debug/partytown-atomics.js | 1 + public/~partytown/debug/partytown-media.js | 1 + .../~partytown/debug/partytown-sandbox-sw.js | 1392 ++++++++++------- public/~partytown/debug/partytown-sw.js | 90 +- .../~partytown/debug/partytown-ww-atomics.js | 1 + public/~partytown/debug/partytown-ww-sw.js | 1 + public/~partytown/debug/partytown.js | 171 +- public/~partytown/partytown-atomics.js | 1 + public/~partytown/partytown-media.js | 1 + public/~partytown/partytown-sw.js | 51 +- public/~partytown/partytown.js | 1 + src/components/projects/Projects.js | 1 - 12 files changed, 1084 insertions(+), 628 deletions(-) diff --git a/public/~partytown/debug/partytown-atomics.js b/public/~partytown/debug/partytown-atomics.js index 410f0b9..287d8bb 100644 --- a/public/~partytown/debug/partytown-atomics.js +++ b/public/~partytown/debug/partytown-atomics.js @@ -1,3 +1,4 @@ +/* eslint-disable */ /* Partytown 0.6.2 - MIT builder.io */ (window => { const isPromise = v => "object" == typeof v && v && v.then; diff --git a/public/~partytown/debug/partytown-media.js b/public/~partytown/debug/partytown-media.js index aea01a4..9bb6f91 100644 --- a/public/~partytown/debug/partytown-media.js +++ b/public/~partytown/debug/partytown-media.js @@ -1,3 +1,4 @@ +/* eslint-disable */ /* Partytown 0.6.2 - MIT builder.io */ (self => { const [getter, setter, callMethod, constructGlobal, definePrototypePropertyDescriptor, randomId, WinIdKey, InstanceIdKey, ApplyPathKey] = self.$bridgeToMedia$; diff --git a/public/~partytown/debug/partytown-sandbox-sw.js b/public/~partytown/debug/partytown-sandbox-sw.js index e3abcce..1a01344 100644 --- a/public/~partytown/debug/partytown-sandbox-sw.js +++ b/public/~partytown/debug/partytown-sandbox-sw.js @@ -1,543 +1,891 @@ +/* eslint-disable */ /* Partytown 0.6.2 - MIT builder.io */ -(window => { - const isPromise = v => "object" == typeof v && v && v.then; - const noop = () => {}; - const len = obj => obj.length; - const getConstructorName = obj => { - var _a, _b, _c; - try { - const constructorName = null === (_a = null == obj ? void 0 : obj.constructor) || void 0 === _a ? void 0 : _a.name; - if (constructorName) { - return constructorName; - } - } catch (e) {} - try { - const zoneJsConstructorName = null === (_c = null === (_b = null == obj ? void 0 : obj.__zone_symbol__originalInstance) || void 0 === _b ? void 0 : _b.constructor) || void 0 === _c ? void 0 : _c.name; - if (zoneJsConstructorName) { - return zoneJsConstructorName; - } - } catch (e) {} - return ""; - }; - const startsWith = (str, val) => str.startsWith(val); - const isValidMemberName = memberName => !(startsWith(memberName, "webkit") || startsWith(memberName, "toJSON") || startsWith(memberName, "constructor") || startsWith(memberName, "toString") || startsWith(memberName, "_")); - const getNodeName = node => 11 === node.nodeType && node.host ? "#s" : node.nodeName; - const randomId = () => Math.round(Math.random() * Number.MAX_SAFE_INTEGER).toString(36); - const defineConstructorName = (Cstr, value) => ((obj, memberName, descriptor) => Object.defineProperty(obj, memberName, { +((window) => { + const isPromise = (v) => "object" == typeof v && v && v.then; + const noop = () => {}; + const len = (obj) => obj.length; + const getConstructorName = (obj) => { + var _a, _b, _c; + try { + const constructorName = + null === (_a = null == obj ? void 0 : obj.constructor) || void 0 === _a + ? void 0 + : _a.name; + if (constructorName) { + return constructorName; + } + } catch (e) {} + try { + const zoneJsConstructorName = + null === + (_c = + null === + (_b = + null == obj ? void 0 : obj.__zone_symbol__originalInstance) || + void 0 === _b + ? void 0 + : _b.constructor) || void 0 === _c + ? void 0 + : _c.name; + if (zoneJsConstructorName) { + return zoneJsConstructorName; + } + } catch (e) {} + return ""; + }; + const startsWith = (str, val) => str.startsWith(val); + const isValidMemberName = (memberName) => + !( + startsWith(memberName, "webkit") || + startsWith(memberName, "toJSON") || + startsWith(memberName, "constructor") || + startsWith(memberName, "toString") || + startsWith(memberName, "_") + ); + const getNodeName = (node) => + 11 === node.nodeType && node.host ? "#s" : node.nodeName; + const randomId = () => + Math.round(Math.random() * Number.MAX_SAFE_INTEGER).toString(36); + const defineConstructorName = (Cstr, value) => + ((obj, memberName, descriptor) => + Object.defineProperty(obj, memberName, { ...descriptor, - configurable: true - }))(Cstr, "name", { - value: value + configurable: true, + }))(Cstr, "name", { + value: value, }); - const htmlConstructorTags = { - Anchor: "a", - DList: "dl", - Image: "img", - OList: "ol", - Paragraph: "p", - Quote: "q", - TableCaption: "caption", - TableCell: "td", - TableCol: "colgroup", - TableRow: "tr", - TableSection: "tbody", - UList: "ul" - }; - const svgConstructorTags = { - Graphics: "g", - SVG: "svg" - }; - const InstanceIdKey = Symbol(); - const CreatedKey = Symbol(); - const instances = new Map; - const mainRefs = new Map; - const winCtxs = {}; - const windowIds = new WeakMap; - const getAndSetInstanceId = (instance, instanceId) => { - if (instance) { - if (instanceId = windowIds.get(instance)) { - return instanceId; - } - (instanceId = instance[InstanceIdKey]) || setInstanceId(instance, instanceId = randomId()); - return instanceId; - } - }; - const getInstance = (winId, instanceId, win, doc, docId) => { - if ((win = winCtxs[winId]) && win.$window$) { - if (winId === instanceId) { - return win.$window$; - } - doc = win.$window$.document; - docId = instanceId.split(".").pop(); - if ("d" === docId) { - return doc; - } - if ("e" === docId) { - return doc.documentElement; - } - if ("h" === docId) { - return doc.head; - } - if ("b" === docId) { - return doc.body; - } - } - return instances.get(instanceId); - }; - const setInstanceId = (instance, instanceId, now) => { - if (instance) { - instances.set(instanceId, instance); - instance[InstanceIdKey] = instanceId; - instance[CreatedKey] = now = Date.now(); - if (now > lastCleanup + 5e3) { - instances.forEach(((storedInstance, instanceId) => { - storedInstance[CreatedKey] < lastCleanup && storedInstance.nodeType && !storedInstance.isConnected && instances.delete(instanceId); - })); - lastCleanup = now; - } - } - }; - let lastCleanup = 0; - const mainWindow = window.parent; - const docImpl = document.implementation.createHTMLDocument(); - const config = mainWindow.partytown || {}; - const libPath = (config.lib || "/~partytown/") + "debug/"; - const logMain = msg => { - console.debug.apply(console, [ "%cMain 🌎", "background: #717171; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;", msg ]); - }; - const winIds = []; - const normalizedWinId = winId => { - winIds.includes(winId) || winIds.push(winId); - return winIds.indexOf(winId) + 1; - }; - const defineCustomElement = (winId, worker, ceData) => { - const Cstr = defineConstructorName(class extends winCtxs[winId].$window$.HTMLElement {}, ceData[0]); - const ceCallbackMethods = "connectedCallback,disconnectedCallback,attributeChangedCallback,adoptedCallback".split(","); - ceCallbackMethods.map((callbackMethodName => Cstr.prototype[callbackMethodName] = function(...args) { - worker.postMessage([ 15, winId, getAndSetInstanceId(this), callbackMethodName, args ]); - })); - Cstr.observedAttributes = ceData[1]; - return Cstr; - }; - const serializeForWorker = ($winId$, value, added, type, cstrName) => void 0 !== value && (type = typeof value) ? "string" === type || "number" === type || "boolean" === type || null == value ? [ 0, value ] : "function" === type ? [ 6 ] : (added = added || new Set) && Array.isArray(value) ? added.has(value) ? [ 1, [] ] : added.add(value) && [ 1, value.map((v => serializeForWorker($winId$, v, added))) ] : "object" === type ? serializedValueIsError(value) ? [ 14, { - name: value.name, - message: value.message, - stack: value.stack - } ] : "" === (cstrName = getConstructorName(value)) ? [ 2, {} ] : "Window" === cstrName ? [ 3, [ $winId$, $winId$ ] ] : "HTMLCollection" === cstrName || "NodeList" === cstrName ? [ 7, Array.from(value).map((v => serializeForWorker($winId$, v, added)[1])) ] : cstrName.endsWith("Event") ? [ 5, serializeObjectForWorker($winId$, value, added) ] : "CSSRuleList" === cstrName ? [ 12, Array.from(value).map(serializeCssRuleForWorker) ] : startsWith(cstrName, "CSS") && cstrName.endsWith("Rule") ? [ 11, serializeCssRuleForWorker(value) ] : "CSSStyleDeclaration" === cstrName ? [ 13, serializeObjectForWorker($winId$, value, added) ] : "Attr" === cstrName ? [ 10, [ value.name, value.value ] ] : value.nodeType ? [ 3, [ $winId$, getAndSetInstanceId(value), getNodeName(value) ] ] : [ 2, serializeObjectForWorker($winId$, value, added, true, true) ] : void 0 : value; - const serializeObjectForWorker = (winId, obj, added, includeFunctions, includeEmptyStrings, serializedObj, propName, propValue) => { - serializedObj = {}; - if (!added.has(obj)) { - added.add(obj); - for (propName in obj) { - if (isValidMemberName(propName)) { - propValue = obj[propName]; - (includeFunctions || "function" != typeof propValue) && (includeEmptyStrings || "" !== propValue) && (serializedObj[propName] = serializeForWorker(winId, propValue, added)); - } - } - } - return serializedObj; - }; - const serializeCssRuleForWorker = cssRule => { - let obj = {}; - let key; - for (key in cssRule) { - validCssRuleProps.includes(key) && (obj[key] = String(cssRule[key])); - } - return obj; - }; - const serializedValueIsError = value => value instanceof window.top.Error; - const deserializeFromWorker = (worker, serializedTransfer, serializedType, serializedValue) => { - if (serializedTransfer) { - serializedType = serializedTransfer[0]; - serializedValue = serializedTransfer[1]; - return 0 === serializedType ? serializedValue : 4 === serializedType ? deserializeRefFromWorker(worker, serializedValue) : 1 === serializedType ? serializedValue.map((v => deserializeFromWorker(worker, v))) : 3 === serializedType ? getInstance(serializedValue[0], serializedValue[1]) : 5 === serializedType ? constructEvent(deserializeObjectFromWorker(worker, serializedValue)) : 2 === serializedType ? deserializeObjectFromWorker(worker, serializedValue) : 8 === serializedType ? serializedValue : 9 === serializedType ? new window[serializedTransfer[2]](serializedValue) : void 0; + const htmlConstructorTags = { + Anchor: "a", + DList: "dl", + Image: "img", + OList: "ol", + Paragraph: "p", + Quote: "q", + TableCaption: "caption", + TableCell: "td", + TableCol: "colgroup", + TableRow: "tr", + TableSection: "tbody", + UList: "ul", + }; + const svgConstructorTags = { + Graphics: "g", + SVG: "svg", + }; + const InstanceIdKey = Symbol(); + const CreatedKey = Symbol(); + const instances = new Map(); + const mainRefs = new Map(); + const winCtxs = {}; + const windowIds = new WeakMap(); + const getAndSetInstanceId = (instance, instanceId) => { + if (instance) { + if ((instanceId = windowIds.get(instance))) { + return instanceId; + } + (instanceId = instance[InstanceIdKey]) || + setInstanceId(instance, (instanceId = randomId())); + return instanceId; + } + }; + const getInstance = (winId, instanceId, win, doc, docId) => { + if ((win = winCtxs[winId]) && win.$window$) { + if (winId === instanceId) { + return win.$window$; + } + doc = win.$window$.document; + docId = instanceId.split(".").pop(); + if ("d" === docId) { + return doc; + } + if ("e" === docId) { + return doc.documentElement; + } + if ("h" === docId) { + return doc.head; + } + if ("b" === docId) { + return doc.body; + } + } + return instances.get(instanceId); + }; + const setInstanceId = (instance, instanceId, now) => { + if (instance) { + instances.set(instanceId, instance); + instance[InstanceIdKey] = instanceId; + instance[CreatedKey] = now = Date.now(); + if (now > lastCleanup + 5e3) { + instances.forEach((storedInstance, instanceId) => { + storedInstance[CreatedKey] < lastCleanup && + storedInstance.nodeType && + !storedInstance.isConnected && + instances.delete(instanceId); + }); + lastCleanup = now; + } + } + }; + let lastCleanup = 0; + const mainWindow = window.parent; + const docImpl = document.implementation.createHTMLDocument(); + const config = mainWindow.partytown || {}; + const libPath = (config.lib || "/~partytown/") + "debug/"; + const logMain = (msg) => { + console.debug.apply(console, [ + "%cMain 🌎", + "background: #717171; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;", + msg, + ]); + }; + const winIds = []; + const normalizedWinId = (winId) => { + winIds.includes(winId) || winIds.push(winId); + return winIds.indexOf(winId) + 1; + }; + const defineCustomElement = (winId, worker, ceData) => { + const Cstr = defineConstructorName( + class extends winCtxs[winId].$window$.HTMLElement {}, + ceData[0] + ); + const ceCallbackMethods = + "connectedCallback,disconnectedCallback,attributeChangedCallback,adoptedCallback".split( + "," + ); + ceCallbackMethods.map( + (callbackMethodName) => + (Cstr.prototype[callbackMethodName] = function (...args) { + worker.postMessage([ + 15, + winId, + getAndSetInstanceId(this), + callbackMethodName, + args, + ]); + }) + ); + Cstr.observedAttributes = ceData[1]; + return Cstr; + }; + const serializeForWorker = ($winId$, value, added, type, cstrName) => + void 0 !== value && (type = typeof value) + ? "string" === type || + "number" === type || + "boolean" === type || + null == value + ? [0, value] + : "function" === type + ? [6] + : (added = added || new Set()) && Array.isArray(value) + ? added.has(value) + ? [1, []] + : added.add(value) && [ + 1, + value.map((v) => serializeForWorker($winId$, v, added)), + ] + : "object" === type + ? serializedValueIsError(value) + ? [ + 14, + { + name: value.name, + message: value.message, + stack: value.stack, + }, + ] + : "" === (cstrName = getConstructorName(value)) + ? [2, {}] + : "Window" === cstrName + ? [3, [$winId$, $winId$]] + : "HTMLCollection" === cstrName || "NodeList" === cstrName + ? [ + 7, + Array.from(value).map( + (v) => serializeForWorker($winId$, v, added)[1] + ), + ] + : cstrName.endsWith("Event") + ? [5, serializeObjectForWorker($winId$, value, added)] + : "CSSRuleList" === cstrName + ? [12, Array.from(value).map(serializeCssRuleForWorker)] + : startsWith(cstrName, "CSS") && cstrName.endsWith("Rule") + ? [11, serializeCssRuleForWorker(value)] + : "CSSStyleDeclaration" === cstrName + ? [13, serializeObjectForWorker($winId$, value, added)] + : "Attr" === cstrName + ? [10, [value.name, value.value]] + : value.nodeType + ? [3, [$winId$, getAndSetInstanceId(value), getNodeName(value)]] + : [2, serializeObjectForWorker($winId$, value, added, true, true)] + : void 0 + : value; + const serializeObjectForWorker = ( + winId, + obj, + added, + includeFunctions, + includeEmptyStrings, + serializedObj, + propName, + propValue + ) => { + serializedObj = {}; + if (!added.has(obj)) { + added.add(obj); + for (propName in obj) { + if (isValidMemberName(propName)) { + propValue = obj[propName]; + (includeFunctions || "function" != typeof propValue) && + (includeEmptyStrings || "" !== propValue) && + (serializedObj[propName] = serializeForWorker( + winId, + propValue, + added + )); } + } + } + return serializedObj; + }; + const serializeCssRuleForWorker = (cssRule) => { + let obj = {}; + let key; + for (key in cssRule) { + validCssRuleProps.includes(key) && (obj[key] = String(cssRule[key])); + } + return obj; + }; + const serializedValueIsError = (value) => value instanceof window.top.Error; + const deserializeFromWorker = ( + worker, + serializedTransfer, + serializedType, + serializedValue + ) => { + if (serializedTransfer) { + serializedType = serializedTransfer[0]; + serializedValue = serializedTransfer[1]; + return 0 === serializedType + ? serializedValue + : 4 === serializedType + ? deserializeRefFromWorker(worker, serializedValue) + : 1 === serializedType + ? serializedValue.map((v) => deserializeFromWorker(worker, v)) + : 3 === serializedType + ? getInstance(serializedValue[0], serializedValue[1]) + : 5 === serializedType + ? constructEvent(deserializeObjectFromWorker(worker, serializedValue)) + : 2 === serializedType + ? deserializeObjectFromWorker(worker, serializedValue) + : 8 === serializedType + ? serializedValue + : 9 === serializedType + ? new window[serializedTransfer[2]](serializedValue) + : void 0; + } + }; + const deserializeRefFromWorker = ( + worker, + { $winId$: $winId$, $instanceId$: $instanceId$, $refId$: $refId$ }, + ref + ) => { + ref = mainRefs.get($refId$); + if (!ref) { + ref = function (...args) { + worker.postMessage([ + 9, + { + $winId$: $winId$, + $instanceId$: $instanceId$, + $refId$: $refId$, + $thisArg$: serializeForWorker($winId$, this), + $args$: serializeForWorker($winId$, args), + }, + ]); + }; + mainRefs.set($refId$, ref); + } + return ref; + }; + const constructEvent = (eventProps) => + new ("detail" in eventProps ? CustomEvent : Event)( + eventProps.type, + eventProps + ); + const deserializeObjectFromWorker = (worker, serializedValue, obj, key) => { + obj = {}; + for (key in serializedValue) { + obj[key] = deserializeFromWorker(worker, serializedValue[key]); + } + return obj; + }; + const validCssRuleProps = + "cssText,selectorText,href,media,namespaceURI,prefix,name,conditionText".split( + "," + ); + const mainAccessHandler = async (worker, accessReq) => { + let accessRsp = { + $msgId$: accessReq.$msgId$, }; - const deserializeRefFromWorker = (worker, {$winId$: $winId$, $instanceId$: $instanceId$, $refId$: $refId$}, ref) => { - ref = mainRefs.get($refId$); - if (!ref) { - ref = function(...args) { - worker.postMessage([ 9, { - $winId$: $winId$, - $instanceId$: $instanceId$, - $refId$: $refId$, - $thisArg$: serializeForWorker($winId$, this), - $args$: serializeForWorker($winId$, args) - } ]); + let totalTasks = len(accessReq.$tasks$); + let i = 0; + let task; + let winId; + let applyPath; + let instance; + let rtnValue; + let isLast; + for (; i < totalTasks; i++) { + try { + isLast = i === totalTasks - 1; + task = accessReq.$tasks$[i]; + winId = task.$winId$; + applyPath = task.$applyPath$; + !winCtxs[winId] && + winId.startsWith("f_") && + (await new Promise((resolve) => { + let check = 0; + let callback = () => { + winCtxs[winId] || check++ > 1e3 + ? resolve() + : requestAnimationFrame(callback); }; - mainRefs.set($refId$, ref); - } - return ref; - }; - const constructEvent = eventProps => new ("detail" in eventProps ? CustomEvent : Event)(eventProps.type, eventProps); - const deserializeObjectFromWorker = (worker, serializedValue, obj, key) => { - obj = {}; - for (key in serializedValue) { - obj[key] = deserializeFromWorker(worker, serializedValue[key]); - } - return obj; - }; - const validCssRuleProps = "cssText,selectorText,href,media,namespaceURI,prefix,name,conditionText".split(","); - const mainAccessHandler = async (worker, accessReq) => { - let accessRsp = { - $msgId$: accessReq.$msgId$ - }; - let totalTasks = len(accessReq.$tasks$); - let i = 0; - let task; - let winId; - let applyPath; - let instance; - let rtnValue; - let isLast; - for (;i < totalTasks; i++) { - try { - isLast = i === totalTasks - 1; - task = accessReq.$tasks$[i]; - winId = task.$winId$; - applyPath = task.$applyPath$; - !winCtxs[winId] && winId.startsWith("f_") && await new Promise((resolve => { - let check = 0; - let callback = () => { - winCtxs[winId] || check++ > 1e3 ? resolve() : requestAnimationFrame(callback); - }; - callback(); - })); - if (1 === applyPath[0] && applyPath[1] in winCtxs[winId].$window$) { - setInstanceId(new winCtxs[winId].$window$[applyPath[1]](...deserializeFromWorker(worker, applyPath[2])), task.$instanceId$); - } else { - instance = getInstance(winId, task.$instanceId$); - if (instance) { - rtnValue = applyToInstance(worker, winId, instance, applyPath, isLast, task.$groupedGetters$); - task.$assignInstanceId$ && ("string" == typeof task.$assignInstanceId$ ? setInstanceId(rtnValue, task.$assignInstanceId$) : winCtxs[task.$assignInstanceId$.$winId$] = { - $winId$: task.$assignInstanceId$.$winId$, - $window$: { - document: rtnValue - } - }); - if (isPromise(rtnValue)) { - rtnValue = await rtnValue; - isLast && (accessRsp.$isPromise$ = true); - } - isLast && (accessRsp.$rtnValue$ = serializeForWorker(winId, rtnValue)); - } else { - accessRsp.$error$ = `Error finding instance "${task.$instanceId$}" on window ${normalizedWinId(winId)}`; - console.error(accessRsp.$error$, task); - } - } - } catch (e) { - isLast ? accessRsp.$error$ = String(e.stack || e) : console.error(e); + callback(); + })); + if (1 === applyPath[0] && applyPath[1] in winCtxs[winId].$window$) { + setInstanceId( + new winCtxs[winId].$window$[applyPath[1]]( + ...deserializeFromWorker(worker, applyPath[2]) + ), + task.$instanceId$ + ); + } else { + instance = getInstance(winId, task.$instanceId$); + if (instance) { + rtnValue = applyToInstance( + worker, + winId, + instance, + applyPath, + isLast, + task.$groupedGetters$ + ); + task.$assignInstanceId$ && + ("string" == typeof task.$assignInstanceId$ + ? setInstanceId(rtnValue, task.$assignInstanceId$) + : (winCtxs[task.$assignInstanceId$.$winId$] = { + $winId$: task.$assignInstanceId$.$winId$, + $window$: { + document: rtnValue, + }, + })); + if (isPromise(rtnValue)) { + rtnValue = await rtnValue; + isLast && (accessRsp.$isPromise$ = true); } + isLast && + (accessRsp.$rtnValue$ = serializeForWorker(winId, rtnValue)); + } else { + accessRsp.$error$ = `Error finding instance "${ + task.$instanceId$ + }" on window ${normalizedWinId(winId)}`; + console.error(accessRsp.$error$, task); + } } - return accessRsp; - }; - const applyToInstance = (worker, winId, instance, applyPath, isLast, groupedGetters) => { - let i = 0; - let l = len(applyPath); - let next; - let current; - let previous; - let args; - let groupedRtnValues; - for (;i < l; i++) { - current = applyPath[i]; - next = applyPath[i + 1]; - previous = applyPath[i - 1]; - try { - if (!Array.isArray(next)) { - if ("string" == typeof current || "number" == typeof current) { - if (i + 1 === l && groupedGetters) { - groupedRtnValues = {}; - groupedGetters.map((propName => groupedRtnValues[propName] = instance[propName])); - return groupedRtnValues; - } - instance = instance[current]; - } else { - if (0 === next) { - instance[previous] = deserializeFromWorker(worker, current); - return; - } - if ("function" == typeof instance[previous]) { - args = deserializeFromWorker(worker, current); - "define" === previous && "CustomElementRegistry" === getConstructorName(instance) && (args[1] = defineCustomElement(winId, worker, args[1])); - "insertRule" === previous && args[1] > len(instance.cssRules) && (args[1] = len(instance.cssRules)); - instance = instance[previous].apply(instance, args); - if ("play" === previous) { - return Promise.resolve(); - } - } - } - } - } catch (err) { - if (isLast) { - throw err; - } - console.debug("Non-blocking setter error:", err); + } catch (e) { + isLast ? (accessRsp.$error$ = String(e.stack || e)) : console.error(e); + } + } + return accessRsp; + }; + const applyToInstance = ( + worker, + winId, + instance, + applyPath, + isLast, + groupedGetters + ) => { + let i = 0; + let l = len(applyPath); + let next; + let current; + let previous; + let args; + let groupedRtnValues; + for (; i < l; i++) { + current = applyPath[i]; + next = applyPath[i + 1]; + previous = applyPath[i - 1]; + try { + if (!Array.isArray(next)) { + if ("string" == typeof current || "number" == typeof current) { + if (i + 1 === l && groupedGetters) { + groupedRtnValues = {}; + groupedGetters.map( + (propName) => (groupedRtnValues[propName] = instance[propName]) + ); + return groupedRtnValues; } - } - return instance; - }; - const registerWindow = (worker, $winId$, $window$) => { - if (!windowIds.has($window$)) { - windowIds.set($window$, $winId$); - const doc = $window$.document; - const history = $window$.history; - const $parentWinId$ = windowIds.get($window$.parent); - const sendInitEnvData = () => worker.postMessage([ 5, { - $winId$: $winId$, - $parentWinId$: $parentWinId$, - $url$: doc.baseURI, - $visibilityState$: doc.visibilityState - } ]); - const pushState = history.pushState.bind(history); - const replaceState = history.replaceState.bind(history); - const onLocationChange = (type, state, newUrl, oldUrl) => { - setTimeout((() => { - worker.postMessage([ 13, { - $winId$: $winId$, - type: type, - state: state, - url: doc.baseURI, - newUrl: newUrl, - oldUrl: oldUrl - } ]); - })); - }; - history.pushState = (state, _, newUrl) => { - pushState(state, _, newUrl); - onLocationChange(0, state, null == newUrl ? void 0 : newUrl.toString()); - }; - history.replaceState = (state, _, newUrl) => { - replaceState(state, _, newUrl); - onLocationChange(1, state, null == newUrl ? void 0 : newUrl.toString()); - }; - $window$.addEventListener("popstate", (event => { - onLocationChange(2, event.state); - })); - $window$.addEventListener("hashchange", (event => { - onLocationChange(3, {}, event.newURL, event.oldURL); - })); - doc.addEventListener("visibilitychange", (() => worker.postMessage([ 14, $winId$, doc.visibilityState ]))); - winCtxs[$winId$] = { - $winId$: $winId$, - $window$: $window$ - }; - winCtxs[$winId$].$startTime$ = performance.now(); - { - const winType = $winId$ === $parentWinId$ ? "top" : "iframe"; - logMain(`Registered ${winType} window ${normalizedWinId($winId$)}`); + instance = instance[current]; + } else { + if (0 === next) { + instance[previous] = deserializeFromWorker(worker, current); + return; } - "complete" === doc.readyState ? sendInitEnvData() : $window$.addEventListener("load", sendInitEnvData); - } - }; - const readNextScript = (worker, winCtx) => { - let $winId$ = winCtx.$winId$; - let win = winCtx.$window$; - let doc = win.document; - let scriptSelector = 'script[type="text/partytown"]:not([data-ptid]):not([data-pterror])'; - let scriptElm; - let $instanceId$; - let scriptData; - if (doc && doc.body) { - scriptElm = doc.querySelector('script[type="text/partytown"]:not([data-ptid]):not([data-pterror]):not([async]):not([defer])'); - scriptElm || (scriptElm = doc.querySelector(scriptSelector)); - if (scriptElm) { - scriptElm.dataset.ptid = $instanceId$ = getAndSetInstanceId(scriptElm, $winId$); - scriptData = { - $winId$: $winId$, - $instanceId$: $instanceId$ - }; - if (scriptElm.src) { - scriptData.$url$ = scriptElm.src; - scriptData.$orgUrl$ = scriptElm.dataset.ptsrc || scriptElm.src; - } else { - scriptData.$content$ = scriptElm.innerHTML; - } - worker.postMessage([ 7, scriptData ]); - } else { - if (!winCtx.$isInitialized$) { - winCtx.$isInitialized$ = 1; - ((worker, $winId$, win) => { - let queuedForwardCalls = win._ptf; - let forwards = (win.partytown || {}).forward || []; - let i; - let mainForwardFn; - let forwardCall = ($forward$, args) => worker.postMessage([ 10, { - $winId$: $winId$, - $forward$: $forward$, - $args$: serializeForWorker($winId$, Array.from(args)) - } ]); - win._ptf = void 0; - forwards.map((forwardProps => { - mainForwardFn = win; - forwardProps.split(".").map(((_, i, arr) => { - mainForwardFn = mainForwardFn[arr[i]] = i + 1 < len(arr) ? mainForwardFn[arr[i]] || ("push" === arr[i + 1] ? [] : {}) : (...args) => forwardCall(arr, args); - })); - })); - if (queuedForwardCalls) { - for (i = 0; i < len(queuedForwardCalls); i += 2) { - forwardCall(queuedForwardCalls[i], queuedForwardCalls[i + 1]); - } - } - })(worker, $winId$, win); - doc.dispatchEvent(new CustomEvent("pt0")); - { - const winType = win === win.top ? "top" : "iframe"; - logMain(`Executed ${winType} window ${normalizedWinId($winId$)} environment scripts in ${(performance.now() - winCtx.$startTime$).toFixed(1)}ms`); - } - } - worker.postMessage([ 8, $winId$ ]); + if ("function" == typeof instance[previous]) { + args = deserializeFromWorker(worker, current); + "define" === previous && + "CustomElementRegistry" === getConstructorName(instance) && + (args[1] = defineCustomElement(winId, worker, args[1])); + "insertRule" === previous && + args[1] > len(instance.cssRules) && + (args[1] = len(instance.cssRules)); + instance = instance[previous].apply(instance, args); + if ("play" === previous) { + return Promise.resolve(); + } } - } else { - requestAnimationFrame((() => readNextScript(worker, winCtx))); + } } - }; - const onMessageFromWebWorker = (worker, msg, winCtx) => { - if (4 === msg[0]) { - registerWindow(worker, randomId(), mainWindow); - } else { - winCtx = winCtxs[msg[1]]; - winCtx && (7 === msg[0] ? requestAnimationFrame((() => readNextScript(worker, winCtx))) : 6 === msg[0] && ((worker, winCtx, instanceId, errorMsg, scriptElm) => { - scriptElm = winCtx.$window$.document.querySelector(`[data-ptid="${instanceId}"]`); - if (scriptElm) { - errorMsg ? scriptElm.dataset.pterror = errorMsg : scriptElm.type += "-x"; - delete scriptElm.dataset.ptid; - } - readNextScript(worker, winCtx); - })(worker, winCtx, msg[2], msg[3])); + } catch (err) { + if (isLast) { + throw err; } - }; - const readMainPlatform = () => { - const elm = docImpl.createElement("i"); - const textNode = docImpl.createTextNode(""); - const comment = docImpl.createComment(""); - const frag = docImpl.createDocumentFragment(); - const shadowRoot = docImpl.createElement("p").attachShadow({ - mode: "open" + console.debug("Non-blocking setter error:", err); + } + } + return instance; + }; + const registerWindow = (worker, $winId$, $window$) => { + if (!windowIds.has($window$)) { + windowIds.set($window$, $winId$); + const doc = $window$.document; + const history = $window$.history; + const $parentWinId$ = windowIds.get($window$.parent); + const sendInitEnvData = () => + worker.postMessage([ + 5, + { + $winId$: $winId$, + $parentWinId$: $parentWinId$, + $url$: doc.baseURI, + $visibilityState$: doc.visibilityState, + }, + ]); + const pushState = history.pushState.bind(history); + const replaceState = history.replaceState.bind(history); + const onLocationChange = (type, state, newUrl, oldUrl) => { + setTimeout(() => { + worker.postMessage([ + 13, + { + $winId$: $winId$, + type: type, + state: state, + url: doc.baseURI, + newUrl: newUrl, + oldUrl: oldUrl, + }, + ]); }); - const intersectionObserver = getGlobalConstructor(mainWindow, "IntersectionObserver"); - const mutationObserver = getGlobalConstructor(mainWindow, "MutationObserver"); - const resizeObserver = getGlobalConstructor(mainWindow, "ResizeObserver"); - const perf = mainWindow.performance; - const screen = mainWindow.screen; - const impls = [ [ mainWindow.history ], [ perf ], [ perf.navigation ], [ perf.timing ], [ screen ], [ screen.orientation ], [ mainWindow.visualViewport ], [ intersectionObserver, 12 ], [ mutationObserver, 12 ], [ resizeObserver, 12 ], [ textNode ], [ comment ], [ frag ], [ shadowRoot ], [ elm ], [ elm.attributes ], [ elm.classList ], [ elm.dataset ], [ elm.style ], [ docImpl ], [ docImpl.doctype ] ]; - const initialInterfaces = [ readImplementation("Window", mainWindow), readImplementation("Node", textNode) ]; - const $config$ = JSON.stringify(config, ((k, v) => { - if ("function" == typeof v) { - v = String(v); - v.startsWith(k + "(") && (v = "function " + v); - } - return v; - })); - const initWebWorkerData = { - $config$: $config$, - $interfaces$: readImplementations(impls, initialInterfaces), - $libPath$: new URL(libPath, mainWindow.location) + "", - $origin$: origin, - $localStorage$: readStorage("localStorage"), - $sessionStorage$: readStorage("sessionStorage") + }; + history.pushState = (state, _, newUrl) => { + pushState(state, _, newUrl); + onLocationChange(0, state, null == newUrl ? void 0 : newUrl.toString()); + }; + history.replaceState = (state, _, newUrl) => { + replaceState(state, _, newUrl); + onLocationChange(1, state, null == newUrl ? void 0 : newUrl.toString()); + }; + $window$.addEventListener("popstate", (event) => { + onLocationChange(2, event.state); + }); + $window$.addEventListener("hashchange", (event) => { + onLocationChange(3, {}, event.newURL, event.oldURL); + }); + doc.addEventListener("visibilitychange", () => + worker.postMessage([14, $winId$, doc.visibilityState]) + ); + winCtxs[$winId$] = { + $winId$: $winId$, + $window$: $window$, + }; + winCtxs[$winId$].$startTime$ = performance.now(); + { + const winType = $winId$ === $parentWinId$ ? "top" : "iframe"; + logMain(`Registered ${winType} window ${normalizedWinId($winId$)}`); + } + "complete" === doc.readyState + ? sendInitEnvData() + : $window$.addEventListener("load", sendInitEnvData); + } + }; + const readNextScript = (worker, winCtx) => { + let $winId$ = winCtx.$winId$; + let win = winCtx.$window$; + let doc = win.document; + let scriptSelector = + 'script[type="text/partytown"]:not([data-ptid]):not([data-pterror])'; + let scriptElm; + let $instanceId$; + let scriptData; + if (doc && doc.body) { + scriptElm = doc.querySelector( + 'script[type="text/partytown"]:not([data-ptid]):not([data-pterror]):not([async]):not([defer])' + ); + scriptElm || (scriptElm = doc.querySelector(scriptSelector)); + if (scriptElm) { + scriptElm.dataset.ptid = $instanceId$ = getAndSetInstanceId( + scriptElm, + $winId$ + ); + scriptData = { + $winId$: $winId$, + $instanceId$: $instanceId$, }; - addGlobalConstructorUsingPrototype(initWebWorkerData.$interfaces$, mainWindow, "IntersectionObserverEntry"); - return initWebWorkerData; - }; - const readMainInterfaces = () => { - const elms = Object.getOwnPropertyNames(mainWindow).map((interfaceName => ((doc, interfaceName, r, tag) => { - r = interfaceName.match(/^(HTML|SVG)(.+)Element$/); - if (r) { - tag = r[2]; - return "S" == interfaceName[0] ? doc.createElementNS("http://www.w3.org/2000/svg", svgConstructorTags[tag] || tag.slice(0, 2).toLowerCase() + tag.slice(2)) : doc.createElement(htmlConstructorTags[tag] || tag); - } - })(docImpl, interfaceName))).filter((elm => elm)).map((elm => [ elm ])); - return readImplementations(elms, []); - }; - const cstrs = new Set([ "Object" ]); - const readImplementations = (impls, interfaces) => { - const cstrImpls = impls.filter((implData => implData[0])).map((implData => { - const impl = implData[0]; - const interfaceType = implData[1]; - const cstrName = getConstructorName(impl); - const CstrPrototype = mainWindow[cstrName].prototype; - return [ cstrName, CstrPrototype, impl, interfaceType ]; - })); - cstrImpls.map((([cstrName, CstrPrototype, impl, intefaceType]) => readOwnImplementation(cstrs, interfaces, cstrName, CstrPrototype, impl, intefaceType))); - return interfaces; - }; - const readImplementation = (cstrName, impl, memberName) => { - let interfaceMembers = []; - let interfaceInfo = [ cstrName, "Object", interfaceMembers ]; - for (memberName in impl) { - readImplementationMember(interfaceMembers, impl, memberName); - } - return interfaceInfo; - }; - const readOwnImplementation = (cstrs, interfaces, cstrName, CstrPrototype, impl, interfaceType) => { - if (!cstrs.has(cstrName)) { - cstrs.add(cstrName); - const SuperCstr = Object.getPrototypeOf(CstrPrototype); - const superCstrName = getConstructorName(SuperCstr); - const interfaceMembers = []; - const propDescriptors = Object.getOwnPropertyDescriptors(CstrPrototype); - readOwnImplementation(cstrs, interfaces, superCstrName, SuperCstr, impl, interfaceType); - for (const memberName in propDescriptors) { - readImplementationMember(interfaceMembers, impl, memberName); - } - interfaces.push([ cstrName, superCstrName, interfaceMembers, interfaceType, getNodeName(impl) ]); + if (scriptElm.src) { + scriptData.$url$ = scriptElm.src; + scriptData.$orgUrl$ = scriptElm.dataset.ptsrc || scriptElm.src; + } else { + scriptData.$content$ = scriptElm.innerHTML; } - }; - const readImplementationMember = (interfaceMembers, implementation, memberName, value, memberType, cstrName) => { - try { - if (isValidMemberName(memberName) && isNaN(memberName[0]) && "all" !== memberName) { - value = implementation[memberName]; - memberType = typeof value; - if ("function" === memberType) { - (String(value).includes("[native") || Object.getPrototypeOf(implementation)[memberName]) && interfaceMembers.push([ memberName, 5 ]); - } else if ("object" === memberType && null != value) { - cstrName = getConstructorName(value); - "Object" !== cstrName && self[cstrName] && interfaceMembers.push([ memberName, value.nodeType || cstrName ]); - } else { - "symbol" !== memberType && (memberName.toUpperCase() === memberName ? interfaceMembers.push([ memberName, 6, value ]) : interfaceMembers.push([ memberName, 6 ])); - } + worker.postMessage([7, scriptData]); + } else { + if (!winCtx.$isInitialized$) { + winCtx.$isInitialized$ = 1; + ((worker, $winId$, win) => { + let queuedForwardCalls = win._ptf; + let forwards = (win.partytown || {}).forward || []; + let i; + let mainForwardFn; + let forwardCall = ($forward$, args) => + worker.postMessage([ + 10, + { + $winId$: $winId$, + $forward$: $forward$, + $args$: serializeForWorker($winId$, Array.from(args)), + }, + ]); + win._ptf = void 0; + forwards.map((forwardProps) => { + mainForwardFn = win; + forwardProps.split(".").map((_, i, arr) => { + mainForwardFn = mainForwardFn[arr[i]] = + i + 1 < len(arr) + ? mainForwardFn[arr[i]] || ("push" === arr[i + 1] ? [] : {}) + : (...args) => forwardCall(arr, args); + }); + }); + if (queuedForwardCalls) { + for (i = 0; i < len(queuedForwardCalls); i += 2) { + forwardCall(queuedForwardCalls[i], queuedForwardCalls[i + 1]); + } } - } catch (e) { - console.warn(e); - } - }; - const readStorage = storageName => { - let items = []; - let i = 0; - let l = len(mainWindow[storageName]); - let key; - for (;i < l; i++) { - key = mainWindow[storageName].key(i); - items.push([ key, mainWindow[storageName].getItem(key) ]); + })(worker, $winId$, win); + doc.dispatchEvent(new CustomEvent("pt0")); + { + const winType = win === win.top ? "top" : "iframe"; + logMain( + `Executed ${winType} window ${normalizedWinId( + $winId$ + )} environment scripts in ${( + performance.now() - winCtx.$startTime$ + ).toFixed(1)}ms` + ); + } } - return items; - }; - const getGlobalConstructor = (mainWindow, cstrName) => void 0 !== mainWindow[cstrName] ? new mainWindow[cstrName](noop) : 0; - const addGlobalConstructorUsingPrototype = ($interfaces$, mainWindow, cstrName) => { - void 0 !== mainWindow[cstrName] && $interfaces$.push([ cstrName, "Object", Object.keys(mainWindow[cstrName].prototype).map((propName => [ propName, 6 ])), 12 ]); + worker.postMessage([8, $winId$]); + } + } else { + requestAnimationFrame(() => readNextScript(worker, winCtx)); + } + }; + const onMessageFromWebWorker = (worker, msg, winCtx) => { + if (4 === msg[0]) { + registerWindow(worker, randomId(), mainWindow); + } else { + winCtx = winCtxs[msg[1]]; + winCtx && + (7 === msg[0] + ? requestAnimationFrame(() => readNextScript(worker, winCtx)) + : 6 === msg[0] && + ((worker, winCtx, instanceId, errorMsg, scriptElm) => { + scriptElm = winCtx.$window$.document.querySelector( + `[data-ptid="${instanceId}"]` + ); + if (scriptElm) { + errorMsg + ? (scriptElm.dataset.pterror = errorMsg) + : (scriptElm.type += "-x"); + delete scriptElm.dataset.ptid; + } + readNextScript(worker, winCtx); + })(worker, winCtx, msg[2], msg[3])); + } + }; + const readMainPlatform = () => { + const elm = docImpl.createElement("i"); + const textNode = docImpl.createTextNode(""); + const comment = docImpl.createComment(""); + const frag = docImpl.createDocumentFragment(); + const shadowRoot = docImpl.createElement("p").attachShadow({ + mode: "open", + }); + const intersectionObserver = getGlobalConstructor( + mainWindow, + "IntersectionObserver" + ); + const mutationObserver = getGlobalConstructor( + mainWindow, + "MutationObserver" + ); + const resizeObserver = getGlobalConstructor(mainWindow, "ResizeObserver"); + const perf = mainWindow.performance; + const screen = mainWindow.screen; + const impls = [ + [mainWindow.history], + [perf], + [perf.navigation], + [perf.timing], + [screen], + [screen.orientation], + [mainWindow.visualViewport], + [intersectionObserver, 12], + [mutationObserver, 12], + [resizeObserver, 12], + [textNode], + [comment], + [frag], + [shadowRoot], + [elm], + [elm.attributes], + [elm.classList], + [elm.dataset], + [elm.style], + [docImpl], + [docImpl.doctype], + ]; + const initialInterfaces = [ + readImplementation("Window", mainWindow), + readImplementation("Node", textNode), + ]; + const $config$ = JSON.stringify(config, (k, v) => { + if ("function" == typeof v) { + v = String(v); + v.startsWith(k + "(") && (v = "function " + v); + } + return v; + }); + const initWebWorkerData = { + $config$: $config$, + $interfaces$: readImplementations(impls, initialInterfaces), + $libPath$: new URL(libPath, mainWindow.location) + "", + $origin$: origin, + $localStorage$: readStorage("localStorage"), + $sessionStorage$: readStorage("sessionStorage"), }; - let worker; - (receiveMessage => { - const swContainer = window.navigator.serviceWorker; - return swContainer.getRegistration().then((swRegistration => { - swContainer.addEventListener("message", (ev => receiveMessage(ev.data, (accessRsp => swRegistration.active && swRegistration.active.postMessage(accessRsp))))); - return (worker, msg) => { - 0 === msg[0] ? worker.postMessage([ 1, readMainPlatform() ]) : 2 === msg[0] ? worker.postMessage([ 3, readMainInterfaces() ]) : onMessageFromWebWorker(worker, msg); - }; - })); - })(((accessReq, responseCallback) => mainAccessHandler(worker, accessReq).then(responseCallback))).then((onMessageHandler => { - if (onMessageHandler) { - worker = new Worker(libPath + "partytown-ww-sw.js?v=0.6.2", { - name: "Partytown 🎉" - }); - worker.onmessage = ev => { - const msg = ev.data; - 12 === msg[0] ? mainAccessHandler(worker, msg[1]) : onMessageHandler(worker, msg); - }; - logMain("Created Partytown web worker (0.6.2)"); - worker.onerror = ev => console.error("Web Worker Error", ev); - mainWindow.addEventListener("pt1", (ev => registerWindow(worker, getAndSetInstanceId(ev.detail.frameElement), ev.detail))); + addGlobalConstructorUsingPrototype( + initWebWorkerData.$interfaces$, + mainWindow, + "IntersectionObserverEntry" + ); + return initWebWorkerData; + }; + const readMainInterfaces = () => { + const elms = Object.getOwnPropertyNames(mainWindow) + .map((interfaceName) => + ((doc, interfaceName, r, tag) => { + r = interfaceName.match(/^(HTML|SVG)(.+)Element$/); + if (r) { + tag = r[2]; + return "S" == interfaceName[0] + ? doc.createElementNS( + "http://www.w3.org/2000/svg", + svgConstructorTags[tag] || + tag.slice(0, 2).toLowerCase() + tag.slice(2) + ) + : doc.createElement(htmlConstructorTags[tag] || tag); + } + })(docImpl, interfaceName) + ) + .filter((elm) => elm) + .map((elm) => [elm]); + return readImplementations(elms, []); + }; + const cstrs = new Set(["Object"]); + const readImplementations = (impls, interfaces) => { + const cstrImpls = impls + .filter((implData) => implData[0]) + .map((implData) => { + const impl = implData[0]; + const interfaceType = implData[1]; + const cstrName = getConstructorName(impl); + const CstrPrototype = mainWindow[cstrName].prototype; + return [cstrName, CstrPrototype, impl, interfaceType]; + }); + cstrImpls.map(([cstrName, CstrPrototype, impl, intefaceType]) => + readOwnImplementation( + cstrs, + interfaces, + cstrName, + CstrPrototype, + impl, + intefaceType + ) + ); + return interfaces; + }; + const readImplementation = (cstrName, impl, memberName) => { + let interfaceMembers = []; + let interfaceInfo = [cstrName, "Object", interfaceMembers]; + for (memberName in impl) { + readImplementationMember(interfaceMembers, impl, memberName); + } + return interfaceInfo; + }; + const readOwnImplementation = ( + cstrs, + interfaces, + cstrName, + CstrPrototype, + impl, + interfaceType + ) => { + if (!cstrs.has(cstrName)) { + cstrs.add(cstrName); + const SuperCstr = Object.getPrototypeOf(CstrPrototype); + const superCstrName = getConstructorName(SuperCstr); + const interfaceMembers = []; + const propDescriptors = Object.getOwnPropertyDescriptors(CstrPrototype); + readOwnImplementation( + cstrs, + interfaces, + superCstrName, + SuperCstr, + impl, + interfaceType + ); + for (const memberName in propDescriptors) { + readImplementationMember(interfaceMembers, impl, memberName); + } + interfaces.push([ + cstrName, + superCstrName, + interfaceMembers, + interfaceType, + getNodeName(impl), + ]); + } + }; + const readImplementationMember = ( + interfaceMembers, + implementation, + memberName, + value, + memberType, + cstrName + ) => { + try { + if ( + isValidMemberName(memberName) && + isNaN(memberName[0]) && + "all" !== memberName + ) { + value = implementation[memberName]; + memberType = typeof value; + if ("function" === memberType) { + (String(value).includes("[native") || + Object.getPrototypeOf(implementation)[memberName]) && + interfaceMembers.push([memberName, 5]); + } else if ("object" === memberType && null != value) { + cstrName = getConstructorName(value); + "Object" !== cstrName && + self[cstrName] && + interfaceMembers.push([memberName, value.nodeType || cstrName]); + } else { + "symbol" !== memberType && + (memberName.toUpperCase() === memberName + ? interfaceMembers.push([memberName, 6, value]) + : interfaceMembers.push([memberName, 6])); } - })); + } + } catch (e) { + console.warn(e); + } + }; + const readStorage = (storageName) => { + let items = []; + let i = 0; + let l = len(mainWindow[storageName]); + let key; + for (; i < l; i++) { + key = mainWindow[storageName].key(i); + items.push([key, mainWindow[storageName].getItem(key)]); + } + return items; + }; + const getGlobalConstructor = (mainWindow, cstrName) => + void 0 !== mainWindow[cstrName] ? new mainWindow[cstrName](noop) : 0; + const addGlobalConstructorUsingPrototype = ( + $interfaces$, + mainWindow, + cstrName + ) => { + void 0 !== mainWindow[cstrName] && + $interfaces$.push([ + cstrName, + "Object", + Object.keys(mainWindow[cstrName].prototype).map((propName) => [ + propName, + 6, + ]), + 12, + ]); + }; + let worker; + ((receiveMessage) => { + const swContainer = window.navigator.serviceWorker; + return swContainer.getRegistration().then((swRegistration) => { + swContainer.addEventListener("message", (ev) => + receiveMessage( + ev.data, + (accessRsp) => + swRegistration.active && + swRegistration.active.postMessage(accessRsp) + ) + ); + return (worker, msg) => { + 0 === msg[0] + ? worker.postMessage([1, readMainPlatform()]) + : 2 === msg[0] + ? worker.postMessage([3, readMainInterfaces()]) + : onMessageFromWebWorker(worker, msg); + }; + }); + })((accessReq, responseCallback) => + mainAccessHandler(worker, accessReq).then(responseCallback) + ).then((onMessageHandler) => { + if (onMessageHandler) { + worker = new Worker(libPath + "partytown-ww-sw.js?v=0.6.2", { + name: "Partytown 🎉", + }); + worker.onmessage = (ev) => { + const msg = ev.data; + 12 === msg[0] + ? mainAccessHandler(worker, msg[1]) + : onMessageHandler(worker, msg); + }; + logMain("Created Partytown web worker (0.6.2)"); + worker.onerror = (ev) => console.error("Web Worker Error", ev); + mainWindow.addEventListener("pt1", (ev) => + registerWindow( + worker, + getAndSetInstanceId(ev.detail.frameElement), + ev.detail + ) + ); + } + }); })(window); diff --git a/public/~partytown/debug/partytown-sw.js b/public/~partytown/debug/partytown-sw.js index ea1df53..d56351f 100644 --- a/public/~partytown/debug/partytown-sw.js +++ b/public/~partytown/debug/partytown-sw.js @@ -1,59 +1,73 @@ +/* eslint-disable */ /* Partytown 0.6.2 - MIT builder.io */ -const resolves = new Map; +const resolves = new Map(); const swMessageError = (accessReq, $error$) => ({ - $msgId$: accessReq.$msgId$, - $error$: $error$ + $msgId$: accessReq.$msgId$, + $error$: $error$, }); -const httpRequestFromWebWorker = req => new Promise((async resolve => { +const httpRequestFromWebWorker = (req) => + new Promise(async (resolve) => { const accessReq = await req.clone().json(); - const responseData = await (accessReq => new Promise((async resolve => { + const responseData = await ((accessReq) => + new Promise(async (resolve) => { const clients = await self.clients.matchAll(); - const client = [ ...clients ].sort(((a, b) => a.url > b.url ? -1 : a.url < b.url ? 1 : 0))[0]; + const client = [...clients].sort((a, b) => + a.url > b.url ? -1 : a.url < b.url ? 1 : 0 + )[0]; if (client) { - const timeout = 12e4; - const msgResolve = [ resolve, setTimeout((() => { - resolves.delete(accessReq.$msgId$); - resolve(swMessageError(accessReq, "Timeout")); - }), timeout) ]; - resolves.set(accessReq.$msgId$, msgResolve); - client.postMessage(accessReq); + const timeout = 12e4; + const msgResolve = [ + resolve, + setTimeout(() => { + resolves.delete(accessReq.$msgId$); + resolve(swMessageError(accessReq, "Timeout")); + }, timeout), + ]; + resolves.set(accessReq.$msgId$, msgResolve); + client.postMessage(accessReq); } else { - resolve(swMessageError(accessReq, "NoParty")); + resolve(swMessageError(accessReq, "NoParty")); } - })))(accessReq); + }))(accessReq); resolve(response(JSON.stringify(responseData), "application/json")); -})); + }); -const response = (body, contentType) => new Response(body, { +const response = (body, contentType) => + new Response(body, { headers: { - "content-type": contentType || "text/html", - "Cache-Control": "no-store" - } -}); + "content-type": contentType || "text/html", + "Cache-Control": "no-store", + }, + }); self.oninstall = () => self.skipWaiting(); self.onactivate = () => self.clients.claim(); -self.onmessage = ev => { - const accessRsp = ev.data; - const r = resolves.get(accessRsp.$msgId$); - if (r) { - resolves.delete(accessRsp.$msgId$); - clearTimeout(r[1]); - r[0](accessRsp); - } +self.onmessage = (ev) => { + const accessRsp = ev.data; + const r = resolves.get(accessRsp.$msgId$); + if (r) { + resolves.delete(accessRsp.$msgId$); + clearTimeout(r[1]); + r[0](accessRsp); + } }; -self.onfetch = ev => { - const req = ev.request; - const url = new URL(req.url); - const pathname = url.pathname; - if (pathname.endsWith("sw.html")) { - ev.respondWith(response('' + ) + ); + } else { + pathname.endsWith("proxytown") && + ev.respondWith(httpRequestFromWebWorker(req)); + } }; diff --git a/public/~partytown/debug/partytown-ww-atomics.js b/public/~partytown/debug/partytown-ww-atomics.js index 0b8726f..1d41c42 100644 --- a/public/~partytown/debug/partytown-ww-atomics.js +++ b/public/~partytown/debug/partytown-ww-atomics.js @@ -1,3 +1,4 @@ +/* eslint-disable */ /* Partytown 0.6.2 - MIT builder.io */ (self => { const WinIdKey = Symbol(); diff --git a/public/~partytown/debug/partytown-ww-sw.js b/public/~partytown/debug/partytown-ww-sw.js index e41039a..578cff1 100644 --- a/public/~partytown/debug/partytown-ww-sw.js +++ b/public/~partytown/debug/partytown-ww-sw.js @@ -1,3 +1,4 @@ +/* eslint-disable */ /* Partytown 0.6.2 - MIT builder.io */ (self => { const WinIdKey = Symbol(); diff --git a/public/~partytown/debug/partytown.js b/public/~partytown/debug/partytown.js index 2438b80..ef91e27 100644 --- a/public/~partytown/debug/partytown.js +++ b/public/~partytown/debug/partytown.js @@ -1,72 +1,111 @@ +/* eslint-disable */ /* Partytown 0.6.2 - MIT builder.io */ -!function(win, doc, nav, top, useAtomics, config, libPath, timeout, scripts, sandbox, mainForwardFn, isReady) { - function ready() { - if (!isReady) { - isReady = 1; - libPath = (config.lib || "/~partytown/") + (false !== config.debug ? "debug/" : ""); - if ("/" == libPath[0]) { - scripts = doc.querySelectorAll('script[type="text/partytown"]'); - if (top != win) { - top.dispatchEvent(new CustomEvent("pt1", { - detail: win - })); - } else { - timeout = setTimeout(fallback, 1e4); - doc.addEventListener("pt0", clearFallback); - useAtomics ? loadSandbox(1) : nav.serviceWorker ? nav.serviceWorker.register(libPath + (config.swPath || "partytown-sw.js"), { - scope: libPath - }).then((function(swRegistration) { - if (swRegistration.active) { - loadSandbox(); - } else if (swRegistration.installing) { - swRegistration.installing.addEventListener("statechange", (function(ev) { - "activated" == ev.target.state && loadSandbox(); - })); - } else { - console.warn(swRegistration); - } - }), console.error) : fallback(); - } - } else { - console.warn('Partytown config.lib url must start with "/"'); - } +!(function ( + win, + doc, + nav, + top, + useAtomics, + config, + libPath, + timeout, + scripts, + sandbox, + mainForwardFn, + isReady +) { + function ready() { + if (!isReady) { + isReady = 1; + libPath = + (config.lib || "/~partytown/") + + (false !== config.debug ? "debug/" : ""); + if ("/" == libPath[0]) { + scripts = doc.querySelectorAll('script[type="text/partytown"]'); + if (top != win) { + top.dispatchEvent( + new CustomEvent("pt1", { + detail: win, + }) + ); + } else { + timeout = setTimeout(fallback, 1e4); + doc.addEventListener("pt0", clearFallback); + useAtomics + ? loadSandbox(1) + : nav.serviceWorker + ? nav.serviceWorker + .register(libPath + (config.swPath || "partytown-sw.js"), { + scope: libPath, + }) + .then(function (swRegistration) { + if (swRegistration.active) { + loadSandbox(); + } else if (swRegistration.installing) { + swRegistration.installing.addEventListener( + "statechange", + function (ev) { + "activated" == ev.target.state && loadSandbox(); + } + ); + } else { + console.warn(swRegistration); + } + }, console.error) + : fallback(); } + } else { + console.warn('Partytown config.lib url must start with "/"'); + } } - function loadSandbox(isAtomics) { - sandbox = doc.createElement(isAtomics ? "script" : "iframe"); - if (!isAtomics) { - sandbox.setAttribute("style", "display:block;width:0;height:0;border:0;visibility:hidden"); - sandbox.setAttribute("aria-hidden", !0); - } - sandbox.src = libPath + "partytown-" + (isAtomics ? "atomics.js?v=0.6.2" : "sandbox-sw.html?" + Date.now()); - doc.body.appendChild(sandbox); - } - function fallback(i, script) { - console.warn("Partytown script fallback"); - clearFallback(); - for (i = 0; i < scripts.length; i++) { - script = doc.createElement("script"); - script.innerHTML = scripts[i].innerHTML; - doc.head.appendChild(script); - } - sandbox && sandbox.parentNode.removeChild(sandbox); + } + function loadSandbox(isAtomics) { + sandbox = doc.createElement(isAtomics ? "script" : "iframe"); + if (!isAtomics) { + sandbox.setAttribute( + "style", + "display:block;width:0;height:0;border:0;visibility:hidden" + ); + sandbox.setAttribute("aria-hidden", !0); } - function clearFallback() { - clearTimeout(timeout); + sandbox.src = + libPath + + "partytown-" + + (isAtomics ? "atomics.js?v=0.6.2" : "sandbox-sw.html?" + Date.now()); + doc.body.appendChild(sandbox); + } + function fallback(i, script) { + console.warn("Partytown script fallback"); + clearFallback(); + for (i = 0; i < scripts.length; i++) { + script = doc.createElement("script"); + script.innerHTML = scripts[i].innerHTML; + doc.head.appendChild(script); } - config = win.partytown || {}; - top == win && (config.forward || []).map((function(forwardProps) { - mainForwardFn = win; - forwardProps.split(".").map((function(_, i, forwardPropsArr) { - mainForwardFn = mainForwardFn[forwardPropsArr[i]] = i + 1 < forwardPropsArr.length ? "push" == forwardPropsArr[i + 1] ? [] : mainForwardFn[forwardPropsArr[i]] || {} : function() { + sandbox && sandbox.parentNode.removeChild(sandbox); + } + function clearFallback() { + clearTimeout(timeout); + } + config = win.partytown || {}; + top == win && + (config.forward || []).map(function (forwardProps) { + mainForwardFn = win; + forwardProps.split(".").map(function (_, i, forwardPropsArr) { + mainForwardFn = mainForwardFn[forwardPropsArr[i]] = + i + 1 < forwardPropsArr.length + ? "push" == forwardPropsArr[i + 1] + ? [] + : mainForwardFn[forwardPropsArr[i]] || {} + : function () { (win._ptf = win._ptf || []).push(forwardPropsArr, arguments); - }; - })); - })); - if ("complete" == doc.readyState) { - ready(); - } else { - win.addEventListener("DOMContentLoaded", ready); - win.addEventListener("load", ready); - } -}(window, document, navigator, top, window.crossOriginIsolated); \ No newline at end of file + }; + }); + }); + if ("complete" == doc.readyState) { + ready(); + } else { + win.addEventListener("DOMContentLoaded", ready); + win.addEventListener("load", ready); + } +})(window, document, navigator, top, window.crossOriginIsolated); diff --git a/public/~partytown/partytown-atomics.js b/public/~partytown/partytown-atomics.js index 0cf7758..7364703 100644 --- a/public/~partytown/partytown-atomics.js +++ b/public/~partytown/partytown-atomics.js @@ -1,2 +1,3 @@ +/* eslint-disable */ /* Partytown 0.6.2 - MIT builder.io */ (e=>{const t=()=>{},r=e=>e.length,n=e=>{var t,r,n;try{const r=null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name;if(r)return r}catch(e){}try{const t=null===(n=null===(r=null==e?void 0:e.__zone_symbol__originalInstance)||void 0===r?void 0:r.constructor)||void 0===n?void 0:n.name;if(t)return t}catch(e){}return""},s=(e,t)=>e.startsWith(t),i=e=>!(s(e,"webkit")||s(e,"toJSON")||s(e,"constructor")||s(e,"toString")||s(e,"_")),o=e=>11===e.nodeType&&e.host?"#s":e.nodeName,a=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER).toString(36),l={Anchor:"a",DList:"dl",Image:"img",OList:"ol",Paragraph:"p",Quote:"q",TableCaption:"caption",TableCell:"td",TableCol:"colgroup",TableRow:"tr",TableSection:"tbody",UList:"ul"},c={Graphics:"g",SVG:"svg"},u=Symbol(),h=Symbol(),d=new Map,p=new Map,m={},g=new WeakMap,f=(e,t)=>{if(e)return(t=g.get(e))||(t=e[u])||$(e,t=a()),t},y=(e,t,r,n,s)=>{if((r=m[e])&&r.U){if(e===t)return r.U;if(n=r.U.document,"d"===(s=t.split(".").pop()))return n;if("e"===s)return n.documentElement;if("h"===s)return n.head;if("b"===s)return n.body}return d.get(t)},$=(e,t,r)=>{e&&(d.set(t,e),e[u]=t,e[h]=r=Date.now(),r>w+5e3&&(d.forEach(((e,t)=>{e[h]{const n=((e,t)=>{return r=e,n={value:t},Object.defineProperty(r,"name",{...n,configurable:!0});var r,n})(class extends m[e].U.HTMLElement{},r[0]);return"connectedCallback,disconnectedCallback,attributeChangedCallback,adoptedCallback".split(",").map((r=>n.prototype[r]=function(...n){t.postMessage([15,e,f(this),r,n])})),n.observedAttributes=r[1],n},C=(e,t,r,i,a)=>void 0!==t&&(i=typeof t)?"string"===i||"number"===i||"boolean"===i||null==t?[0,t]:"function"===i?[6]:(r=r||new Set)&&Array.isArray(t)?r.has(t)?[1,[]]:r.add(t)&&[1,t.map((t=>C(e,t,r)))]:"object"===i?L(t)?[14,{name:t.name,message:t.message,stack:t.stack}]:""===(a=n(t))?[2,{}]:"Window"===a?[3,[e,e]]:"HTMLCollection"===a||"NodeList"===a?[7,Array.from(t).map((t=>C(e,t,r)[1]))]:a.endsWith("Event")?[5,M(e,t,r)]:"CSSRuleList"===a?[12,Array.from(t).map(I)]:s(a,"CSS")&&a.endsWith("Rule")?[11,I(t)]:"CSSStyleDeclaration"===a?[13,M(e,t,r)]:"Attr"===a?[10,[t.name,t.value]]:t.nodeType?[3,[e,f(t),o(t)]]:[2,M(e,t,r,!0,!0)]:void 0:t,M=(e,t,r,n,s,o,a,l)=>{if(o={},!r.has(t))for(a in r.add(t),t)i(a)&&(l=t[a],(n||"function"!=typeof l)&&(s||""!==l)&&(o[a]=C(e,l,r)));return o},I=e=>{let t,r={};for(t in e)R.includes(t)&&(r[t]=String(e[t]));return r},L=t=>t instanceof e.top.Error,A=(t,r,n,s)=>r?(n=r[0],s=r[1],0===n?s:4===n?N(t,s):1===n?s.map((e=>A(t,e))):3===n?y(s[0],s[1]):5===n?U(x(t,s)):2===n?x(t,s):8===n?s:9===n?new e[r[2]](s):void 0):void 0,N=(e,{V:t,w:r,L:n},s)=>((s=p.get(n))||(s=function(...s){e.postMessage([9,{V:t,w:r,L:n,R:C(t,this),b:C(t,s)}])},p.set(n,s)),s),U=e=>new("detail"in e?CustomEvent:Event)(e.type,e),x=(e,t,r,n)=>{for(n in r={},t)r[n]=A(e,t[n]);return r},R="cssText,selectorText,href,media,namespaceURI,prefix,name,conditionText".split(","),P=async(e,t)=>{let n,s,i,o,a,l,c={F:t.F},u=r(t.Q),h=0;for(;h{let t=0,r=()=>{m[s]||t++>1e3?e():requestAnimationFrame(r)};r()})),1===i[0]&&i[1]in m[s].U?$(new m[s].U[i[1]](...A(e,i[2])),n.w):(o=y(s,n.w),o?(a=O(e,s,o,i,l,n.r),n.d&&("string"==typeof n.d?$(a,n.d):m[n.d.V]={V:n.d.V,U:{document:a}}),"object"==typeof(d=a)&&d&&d.then&&(a=await a,l&&(c.z=!0)),l&&(c.M=C(s,a))):c.p=n.w+" not found")}catch(e){l?c.p=String(e.stack||e):console.error(e)}var d;return c},O=(e,t,s,i,o,a)=>{let l,c,u,h,d,p=0,m=r(i);for(;pd[e]=s[e])),d;s=s[c]}else{if(0===l)return void(s[u]=A(e,c));if("function"==typeof s[u]&&(h=A(e,c),"define"===u&&"CustomElementRegistry"===n(s)&&(h[1]=T(t,e,h[1])),"insertRule"===u&&h[1]>r(s.cssRules)&&(h[1]=r(s.cssRules)),s=s[u].apply(s,h),"play"===u))return Promise.resolve()}}catch(e){if(o)throw e;console.debug(e)}}return s},H=(e,t,r)=>{if(!g.has(r)){g.set(r,t);const n=r.document,s=r.history,i=g.get(r.parent),o=()=>e.postMessage([5,{V:t,J:i,S:n.baseURI,T:n.visibilityState}]),a=s.pushState.bind(s),l=s.replaceState.bind(s),c=(r,s,i,o)=>{setTimeout((()=>{e.postMessage([13,{V:t,type:r,state:s,url:n.baseURI,newUrl:i,oldUrl:o}])}))};s.pushState=(e,t,r)=>{a(e,t,r),c(0,e,null==r?void 0:r.toString())},s.replaceState=(e,t,r)=>{l(e,t,r),c(1,e,null==r?void 0:r.toString())},r.addEventListener("popstate",(e=>{c(2,e.state)})),r.addEventListener("hashchange",(e=>{c(3,{},e.newURL,e.oldURL)})),n.addEventListener("visibilitychange",(()=>e.postMessage([14,t,n.visibilityState]))),m[t]={V:t,U:r},"complete"===n.readyState?o():r.addEventListener("load",o)}},k=(e,t)=>{let n,s,i,o=t.V,a=t.U,l=a.document;l&&l.body?(n=l.querySelector('script[type="text/partytown"]:not([data-ptid]):not([data-pterror]):not([async]):not([defer])'),n||(n=l.querySelector('script[type="text/partytown"]:not([data-ptid]):not([data-pterror])')),n?(n.dataset.ptid=s=f(n,o),i={V:o,w:s},n.src?(i.S=n.src,i.H=n.dataset.ptsrc||n.src):i.j=n.innerHTML,e.postMessage([7,i])):(t.x||(t.x=1,((e,t,n)=>{let s,i,o=n._ptf,a=(n.partytown||{}).forward||[],l=(r,n)=>e.postMessage([10,{V:t,q:r,b:C(t,Array.from(n))}]);if(n._ptf=void 0,a.map((e=>{i=n,e.split(".").map(((e,t,n)=>{i=i[n[t]]=t+1l(n,e)}))})),o)for(s=0;sk(e,t)))},V=()=>{const e=Object.getOwnPropertyNames(v).map((e=>((e,t,r,n)=>{if(r=t.match(/^(HTML|SVG)(.+)Element$/))return n=r[2],"S"==t[0]?e.createElementNS("http://www.w3.org/2000/svg",c[n]||n.slice(0,2).toLowerCase()+n.slice(2)):e.createElement(l[n]||n)})(b,e))).filter((e=>e)).map((e=>[e]));return B(e,[])},j=new Set(["Object"]),B=(e,t)=>(e.filter((e=>e[0])).map((e=>{const t=e[0],r=e[1],s=n(t);return[s,v[s].prototype,t,r]})).map((([e,r,n,s])=>F(j,t,e,r,n,s))),t),D=(e,t,r)=>{let n=[],s=[e,"Object",n];for(r in t)W(n,t,r);return s},F=(e,t,r,s,i,a)=>{if(!e.has(r)){e.add(r);const l=Object.getPrototypeOf(s),c=n(l),u=[],h=Object.getOwnPropertyDescriptors(s);F(e,t,c,l,i,a);for(const e in h)W(u,i,e);t.push([r,c,u,a,o(i)])}},W=(e,t,r,s,o,a)=>{try{i(r)&&isNaN(r[0])&&"all"!==r&&("function"==(o=typeof(s=t[r]))?(String(s).includes("[native")||Object.getPrototypeOf(t)[r])&&e.push([r,5]):"object"===o&&null!=s?"Object"!==(a=n(s))&&self[a]&&e.push([r,s.nodeType||a]):"symbol"!==o&&(r.toUpperCase()===r?e.push([r,6,s]):e.push([r,6])))}catch(e){console.warn(e)}},_=e=>{let t,n=[],s=0,i=r(v[e]);for(;svoid 0!==e[r]?new e[r](t):0;let J;(async e=>{const t=new SharedArrayBuffer(1073741824),r=new Int32Array(t);return(n,s)=>{const i=s[0],o=s[1];if(0===i){const e=(()=>{const e=b.createElement("i"),t=b.createTextNode(""),r=b.createComment(""),n=b.createDocumentFragment(),s=b.createElement("p").attachShadow({mode:"open"}),i=q(v,"IntersectionObserver"),o=q(v,"MutationObserver"),a=q(v,"ResizeObserver"),l=v.performance,c=v.screen,u=[[v.history],[l],[l.navigation],[l.timing],[c],[c.orientation],[v.visualViewport],[i,12],[o,12],[a,12],[t],[r],[n],[s],[e],[e.attributes],[e.classList],[e.dataset],[e.style],[b],[b.doctype]],h=[D("Window",v),D("Node",t)],d={i:JSON.stringify(S,((e,t)=>("function"==typeof t&&(t=String(t)).startsWith(e+"(")&&(t="function "+t),t))),v:B(u,h),C:new URL(E,v.location)+"",I:origin,D:_("localStorage"),O:_("sessionStorage")};return((e,t,r)=>{void 0!==t[r]&&e.push([r,"Object",Object.keys(t[r].prototype).map((e=>[e,6])),12])})(d.v,v,"IntersectionObserverEntry"),d})();e.P=t,n.postMessage([1,e])}else 2===s[0]?n.postMessage([3,V()]):11===i?e(o,(e=>{const t=JSON.stringify(e),n=t.length;for(let e=0;e{4===t[0]?H(e,a(),v):(r=m[t[1]])&&(7===t[0]?requestAnimationFrame((()=>k(e,r))):6===t[0]&&((e,t,r,n,s)=>{(s=t.U.document.querySelector(`[data-ptid="${r}"]`))&&(n?s.dataset.pterror=n:s.type+="-x",delete s.dataset.ptid),k(e,t)})(e,r,t[2],t[3]))})(n,s)}})(((e,t)=>P(J,e).then(t))).then((e=>{e&&(J=new Worker(URL.createObjectURL(new Blob(['/* Partytown 0.6.2 - MIT builder.io */\n(e=>{const t=Symbol(),r=Symbol(),n=Symbol(),i=Symbol(),s=Symbol(),o=Symbol(),a=Symbol(),l=Symbol(),$=new Map,c={},u=new WeakMap,d=[],h={},p=new Map,g=new Map,m={},f=new Map,w=new Map,y="about:blank",v=e=>e.split(","),S=e=>{if(e=h.C+e,new URL(e).origin!=location.origin)throw"Invalid "+e;return e},b=v("clientWidth,clientHeight,clientTop,clientLeft,innerWidth,innerHeight,offsetWidth,offsetHeight,offsetTop,offsetLeft,outerWidth,outerHeight,pageXOffset,pageYOffset,scrollWidth,scrollHeight,scrollTop,scrollLeft"),I=v("childElementCount,children,firstElementChild,lastElementChild,nextElementSibling,previousElementSibling"),M=v("insertBefore,remove,removeChild,replaceChild"),T=v("className,width,height,hidden,innerHTML,innerText,textContent"),E=v("setAttribute,setAttributeNS,setProperty"),N=v("addEventListener,dispatchEvent,removeEventListener"),L=N.concat(E,v("add,observe,remove,unobserve")),x=/^[A-Z_]([A-Z0-9-]*[A-Z0-9])?$/,C=()=>{},A=e=>e.length,W=e=>{var t,r,n;try{const r=null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name;if(r)return r}catch(e){}try{const t=null===(n=null===(r=null==e?void 0:e.__zone_symbol__originalInstance)||void 0===r?void 0:r.constructor)||void 0===n?void 0:n.name;if(t)return t}catch(e){}return""},H=[],R=()=>Math.round(Math.random()*Number.MAX_SAFE_INTEGER).toString(36),P="text/partytown",O=(e,t,r)=>Object.defineProperty(e,t,{...r,configurable:!0}),D=(e,t)=>O(e,"name",{value:t}),k=(e,t,r)=>O(e.prototype,t,r),U=(e,t)=>Object.defineProperties(e.prototype,t),j=(e,t,r)=>k(e,t,{value:r,writable:!0}),_=(e,t)=>t in e[o],B=(e,t)=>e[o][t],F=(e,t,r)=>e[o][t]=r,V=(e,t,r,n,i)=>(!(i=$.get(t))&&r&&m[e]&&(i=m[e].k(r,t,n),$.set(t,i)),i),z=(e,t)=>j(e,"nodeType",t),G=(e,t)=>t.map((t=>k(e,t,{get(){let e=X(this,t),r=w.get(e);return r||(r=ue(this,[t]),w.set(e,r)),r}}))),X=(e,n,i)=>[e[t],e[r],n,...(i||H).map((e=>String(e&&e[t]?e[r]:e)))].join("."),q=(e,t)=>v(t).map((t=>k(e,t,{get(){return _(this,t)||F(this,t,ue(this,[t])),B(this,t)},set(e){B(this,t)!==e&&de(this,[t],e),F(this,t,e)}}))),Z=e=>b.map((t=>k(e,t,{get(){const e=f.get(X(this,t));if("number"==typeof e)return e;const r=ue(this,[t],b);return r&&"object"==typeof r?(Object.entries(r).map((([e,t])=>f.set(X(this,e),t))),r[t]):r}}))),J=(e,t)=>t.map((t=>{e.prototype[t]=function(...e){let r=X(this,t,e),n=f.get(r);return n||(n=he(this,[t],e),f.set(r,n)),n}})),Y=(e,n,i,s,o)=>{return void 0!==i&&(o=typeof i)?"string"===o||"boolean"===o||"number"===o||null==i?[0,i]:"function"===o?[4,{V:e,w:n,L:(a=i,(l=u.get(a))||(u.set(a,l=R()),c[l]=a),l)}]:(s=s||new Set)&&Array.isArray(i)?s.has(i)?[1,[]]:s.add(i)&&[1,i.map((t=>Y(e,n,t,s)))]:"object"===o?i[r]?[3,[i[t],i[r]]]:i instanceof Event?[5,Q(e,n,i,!1,s)]:K&&i instanceof TrustedHTML?[0,i.toString()]:i instanceof ArrayBuffer?[8,i]:ArrayBuffer.isView(i)?[9,i.buffer,W(i)]:[2,Q(e,n,i,!0,s)]:void 0:i;var a,l},K="undefined"!=typeof TrustedHTML,Q=(e,t,r,n,i,s,o,a)=>{if(s={},!i.has(r))for(o in i.add(r),r)a=r[o],(n||"function"!=typeof a)&&(s[o]=Y(e,t,a,i));return s},ee=(e,n)=>e?Y(e[t],e[r],n):[0,n],te=(e,t,r,n,i,s,o,a)=>{if(n){if(i=n[0],s=n[1],0===i||11===i||12===i)return s;if(4===i)return ne(r,s);if(6===i)return e&&r.length>0?(...t)=>he(m[e].U,r,t,1):C;if(3===i)return re(s);if(7===i)return new se(s.map(re));if(10===i)return new oe(s);if(1===i)return s.map((n=>te(e,t,r,n)));if(14===i)return new ie(s);for(a in o={},s)o[a]=te(e,t,[...r,a],s[a]);if(13===i)return new m[e].U.CSSStyleDeclaration(e,t,r,o);if(5===i){if("message"===o.type&&o.origin){let e,t=JSON.stringify(o.data),r=d.find((e=>e.m===t));r&&(e=m[r.V],e&&(o.source=e.U,o.origin=e.E.origin))}return new Proxy(new Event(o.type,o),{get:(e,t)=>t in o?o[t]:"function"==typeof e[String(t)]?C:e[String(t)]})}if(2===i)return o}},re=([e,t,r])=>t===e&&m[e]?m[e].U:V(e,t,r),ne=(e,{V:t,w:r,G:n,L:i})=>(c[i]||u.set(c[i]=function(...i){const s=V(t,r,n);return he(s,e,i)},i),c[i]);class ie extends Error{constructor(e){super(e.message),this.name=e.name,this.message=e.message,this.stack=e.stack}}const se=class{constructor(e){(this._=e).map(((e,t)=>this[t]=e))}entries(){return this._.entries()}forEach(e,t){this._.map(e,t)}item(e){return this[e]}keys(){return this._.keys()}get length(){return A(this._)}values(){return this._.values()}[Symbol.iterator](){return this._[Symbol.iterator]()}},oe=class{constructor(e){this.name=e[0],this.value=e[1]}get nodeName(){return this.name}get nodeType(){return 2}},ae=(e,t,r)=>console.warn(`Partytown unable to ${e} cross-origin ${t}: `+r.E),le=[],$e=(e,n,i,o,a,l)=>{if(e[s]){if(le.push({V:e[t],w:e[r],a:[...e[s],...n],d:o,r:a}),3===i)h.K([12,{F:R(),Q:[...le]}],l?[l instanceof ArrayBuffer?l:l.buffer]:void 0),le.length=0;else if(1===i)return ce(!0);h.c=setTimeout(ce,20)}},ce=e=>{if(clearTimeout(h.c),A(le)){const t=le[A(le)-1],r={F:R(),Q:[...le]};if(le.length=0,e){const e=((e,t)=>{const r=e.P,n=new Int32Array(r);Atomics.store(n,0,0),e.K([11,t]),Atomics.wait(n,0,0);let i=Atomics.load(n,0),s="",o=0;for(;oh.i.get&&(n=h.i.get(ge(e,t)))!==a?n:n=$e(e,t,1,void 0,r),de=(e,t,r,n)=>{if(h.i.set){if((n=h.i.set({value:r,prevent:l,...ge(e,t)}))===l)return;n!==a&&(r=n)}T.some((e=>t.includes(e)))&&(f.clear(),t[t.length-1]),t=[...t,ee(e,r),0],$e(e,t,2)},he=(e,t,r,n,i,s,o,l)=>h.i.apply&&(o=h.i.apply({args:r,...ge(e,t)}))!==a?o:(l=t[A(t)-1],t=[...t,ee(e,r)],n=n||(L.includes(l)?2:1),"setAttribute"===l&&_(e,r[0])?F(e,r[0],r[1]):M.includes(l)?(f.clear(),w.clear()):E.includes(l)&&(n=2,f.clear()),o=$e(e,t,n,i,void 0,s)),pe=(e,t,r)=>{$e(e,[1,t,ee(e,r)],1)},ge=(e,t)=>({name:t.join("."),continue:a,nodeName:e[n],constructor:W(e)}),me=(e,t,r,n,i)=>{let s,o,a=t=>((t=r.get(e.origin))||r.set(e.origin,t=[]),t),l=e=>a().findIndex((t=>t[fe]===e)),$={getItem:e=>(s=l(e),s>-1?a()[s][we]:null),setItem(r,o){s=l(r),s>-1?a()[s][we]=o:a().push([r,o]),n?he(e,[t,"setItem"],[r,o],2):ae("set",t,i)},removeItem(r){s=l(r),s>-1&&a().splice(s,1),n?he(e,[t,"removeItem"],[r],2):ae("remove",t,i)},key:e=>(o=a()[e],o?o[fe]:null),clear(){a().length=0,n?he(e,[t,"clear"],H,2):ae("clear",t,i)},get length(){return a().length}};e[t]=$},fe=0,we=1,ye=(e,t,r)=>{e[r]=D(class extends t{constructor(e,t,r,i){return super(e,t,r,i||{}),new Proxy(this,{get:(e,t)=>e[t]?e[t]:(e[t]||"string"!=typeof t||e[n][t]||(e[n][t]=ue(e,[t])),e[n][t]),set:(e,t,r)=>(e[n][t]=r,de(e,[t],r),f.clear(),!0)})}setProperty(...e){this[n][e[0]]=e[1],he(this,["setProperty"],e,2),e[0],f.clear()}getPropertyValue(e){return this[e]}removeProperty(e){let t=this[n][e];return he(this,["removeProperty"],[e],2),f.clear(),this[n][e]=void 0,t}},r)},ve=(e,t)=>{e[t]=D(class{constructor(e){this.ownerNode=e}get cssRules(){const e=this.ownerNode;return new Proxy({},{get(t,r){const n=String(r);return"item"===n?t=>be(e,t):"length"===n?Se(e).length:isNaN(n)?t[r]:be(e,n)}})}insertRule(e,t){const r=Se(this.ownerNode);return(t=void 0===t?0:t)>=0&&t<=r.length&&(he(this.ownerNode,["sheet","insertRule"],[e,t],2),r.splice(t,0,0)),this.ownerNode,f.clear(),t}deleteRule(e){he(this.ownerNode,["sheet","deleteRule"],[e],2),Se(this.ownerNode).splice(e,1),this.ownerNode,f.clear()}get type(){return"text/css"}},t);const r={sheet:{get(){return new e[t](this)}}};U(e.HTMLStyleElement,r)},Se=(e,t)=>((t=B(e,2))||(t=ue(e,["sheet","cssRules"]),F(e,2,t)),t),be=(e,t,r)=>(0===(r=Se(e))[t]&&(r[t]=ue(e,["sheet","cssRules",parseInt(t,10)])),r[t]),Ie="0.6.2",Me=(e,t,r,n,i)=>{try{e.l=t,Te(e,r)}catch(e){console.error(r,e),i=String(e.stack||e)}return e.l="",i},Te=(e,t,r)=>{e.N=1,t=`with(this){${(h.i.globalFns||[]).filter((e=>/[a-zA-Z_$][0-9a-zA-Z_$]*/.test(e))).map((e=>`(typeof ${e}==\'function\'&&(window.${e}=${e}))`)).join(";")+t.replace(/\\bthis\\b/g,"(thi$(this)?window:this)").replace(/\\/\\/# so/g,"//Xso")}\\n;function thi$(t){return t===this}}`+(r?"\\n//# sourceURL="+r:""),e.A||(t=t.replace(/.postMessage\\(/g,`.postMessage(\'${e.V}\',`)),new Function(t).call(e.U),e.N=0},Ee=(e,t,r)=>{(r=B(e,t))&&setTimeout((()=>r.map((e=>e({type:t})))))},Ne=(e,t,r,n,i,s)=>{for(n=e.E;!n.host&&(n=(e=m[e.J]).E,e.V!==e.J););return i=new URL(t||"",n),r&&h.i.resolveUrl&&(s=h.i.resolveUrl(i,n,r))?s:i},Le=(e,t,r)=>Ne(e,t,r)+"",xe=()=>`' + ) + ) + : i.endsWith("proxytown") && + n.respondWith( + ((n) => + new Promise(async (s) => { + const i = await n.clone().json(), + o = await ((r) => + new Promise(async (n) => { + const s = [...(await self.clients.matchAll())].sort( + (e, t) => (e.url > t.url ? -1 : e.url < t.url ? 1 : 0) + )[0]; + if (s) { + const i = [ + n, + setTimeout(() => { + e.delete(r.F), n(t(r, "Timeout")); + }, 1e4), + ]; + e.set(r.F, i), s.postMessage(r); + } else n(t(r, "NoParty")); + }))(i); + s(r(JSON.stringify(o), "application/json")); + }))(s) + ); + }); diff --git a/public/~partytown/partytown.js b/public/~partytown/partytown.js index 7a57e0f..23de4e9 100644 --- a/public/~partytown/partytown.js +++ b/public/~partytown/partytown.js @@ -1,2 +1,3 @@ +/* eslint-disable */ /* Partytown 0.6.2 - MIT builder.io */ !function(t,e,n,i,r,o,a,d,s,c,p,l){function u(){l||(l=1,"/"==(a=(o.lib||"/~partytown/")+(o.debug?"debug/":""))[0]&&(s=e.querySelectorAll('script[type="text/partytown"]'),i!=t?i.dispatchEvent(new CustomEvent("pt1",{detail:t})):(d=setTimeout(w,1e4),e.addEventListener("pt0",f),r?h(1):n.serviceWorker?n.serviceWorker.register(a+(o.swPath||"partytown-sw.js"),{scope:a}).then((function(t){t.active?h():t.installing&&t.installing.addEventListener("statechange",(function(t){"activated"==t.target.state&&h()}))}),console.error):w())))}function h(t){c=e.createElement(t?"script":"iframe"),t||(c.setAttribute("style","display:block;width:0;height:0;border:0;visibility:hidden"),c.setAttribute("aria-hidden",!0)),c.src=a+"partytown-"+(t?"atomics.js?v=0.6.2":"sandbox-sw.html?"+Date.now()),e.body.appendChild(c)}function w(t,n){for(f(),t=0;t { const myRepositories = response.data.filter( (repo) => repo.owner.login === GITHUB_USERNAME, ); - console.log(myRepositories); setProjects(myRepositories); }); }, []); From 6a60ec1e9c03b5595610c0cc222dc20c91ef589b Mon Sep 17 00:00:00 2001 From: Ricky Mormor Date: Sat, 24 Sep 2022 15:42:13 +0000 Subject: [PATCH 06/16] =?UTF-8?q?=F0=9F=91=8C=20IMPROVE:=20remove=20projec?= =?UTF-8?q?s=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 2 -- src/components/header/Header.js | 23 +++++++++++++++-------- src/components/navbar/Navbar.js | 3 +-- src/components/projects/Projects.js | 2 +- src/pages/Projects.js | 7 ------- 5 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 src/pages/Projects.js diff --git a/src/App.js b/src/App.js index 7089c21..81e7ab6 100644 --- a/src/App.js +++ b/src/App.js @@ -9,7 +9,6 @@ import ClimbingBoxLoader from 'react-spinners/ClimbingBoxLoader'; import Navbar from './components/navbar/Navbar'; import Home from './pages/Home'; import About from './pages/About'; -import Projects from './pages/Projects'; import Contact from './pages/Contact'; import Footer from './components/footer/Footer'; @@ -60,7 +59,6 @@ function App() { } /> } /> } /> - } /> } />