From 5ba2d62aeedfee7255e7b26e9bca5c67ddec9fe0 Mon Sep 17 00:00:00 2001 From: cnrad Date: Thu, 14 Nov 2024 01:27:11 -0500 Subject: [PATCH] refactor(renderCard): MUCH nicer + less package weight --- .prettierignore | 1 - package.json | 8 +- pnpm-lock.yaml | 458 +---------- src/app/layout.tsx | 4 +- src/app/page.tsx | 34 +- src/components/{ui => }/popover.tsx | 1 - src/utils/getFlags.ts | 19 - src/utils/helpers.ts | 26 + src/utils/parameters.ts | 6 +- src/utils/renderCard.tsx | 1159 ++++++++++++++------------- 10 files changed, 687 insertions(+), 1029 deletions(-) rename src/components/{ui => }/popover.tsx (99%) delete mode 100644 src/utils/getFlags.ts create mode 100644 src/utils/helpers.ts diff --git a/.prettierignore b/.prettierignore index b4c06a8..e69de29 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +0,0 @@ -src/utils/renderCard.tsx \ No newline at end of file diff --git a/package.json b/package.json index 41ec475..e879a45 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "app-router", + "name": "lanyard-profile-readme", "version": "0.1.0", "private": true, "scripts": { @@ -10,8 +10,6 @@ }, "packageManager": "pnpm@9.11.0", "dependencies": { - "@emotion/css": "^11.13.4", - "@emotion/server": "^11.11.0", "@radix-ui/react-popover": "^1.1.2", "@types/escape-html": "^1.0.4", "class-variance-authority": "^0.7.0", @@ -24,11 +22,9 @@ "next": "15.0.3", "react": "18.3.1", "react-dom": "18.3.1", - "sharp": "^0.33.5", "swr": "^2.2.5", "tailwind-merge": "^2.5.4", - "tailwindcss-animate": "^1.0.7", - "use-smooth-count": "^1.0.1" + "tailwindcss-animate": "^1.0.7" }, "devDependencies": { "@types/node": "^20", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6395f93..63a7d69 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,12 +8,6 @@ importers: .: dependencies: - '@emotion/css': - specifier: ^11.13.4 - version: 11.13.4 - '@emotion/server': - specifier: ^11.11.0 - version: 11.11.0(@emotion/css@11.13.4) '@radix-ui/react-popover': specifier: ^1.1.2 version: 1.1.2(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -50,9 +44,6 @@ importers: react-dom: specifier: 18.3.1 version: 18.3.1(react@18.3.1) - sharp: - specifier: ^0.33.5 - version: 0.33.5 swr: specifier: ^2.2.5 version: 2.2.5(react@18.3.1) @@ -62,9 +53,6 @@ importers: tailwindcss-animate: specifier: ^1.0.7 version: 1.0.7(tailwindcss@3.4.14) - use-smooth-count: - specifier: ^1.0.1 - version: 1.0.1(react@18.3.1) devDependencies: '@types/node': specifier: ^20 @@ -103,94 +91,19 @@ packages: resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} - '@babel/code-frame@7.26.2': - resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} - engines: {node: '>=6.9.0'} - - '@babel/generator@7.26.2': - resolution: {integrity: sha512-zevQbhbau95nkoxSq3f/DC/SC+EEOUZd3DYqfSkMhY2/wfSeaHV1Ew4vk8e+x8lja31IbyuUa2uQ3JONqKbysw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-module-imports@7.25.9': - resolution: {integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==} - engines: {node: '>=6.9.0'} - - '@babel/helper-string-parser@7.25.9': - resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} - engines: {node: '>=6.9.0'} - - '@babel/helper-validator-identifier@7.25.9': - resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.26.2': - resolution: {integrity: sha512-DWMCZH9WA4Maitz2q21SRKHo9QXZxkDsbNZoVD62gusNtNBBqDg9i7uOhASfTfIGNzW+O+r7+jAlM8dwphcJKQ==} - engines: {node: '>=6.0.0'} - hasBin: true - '@babel/runtime@7.25.9': resolution: {integrity: sha512-4zpTHZ9Cm6L9L+uIqghQX8ZXg8HKFcjYO3qHoO8zTmRm6HQUJ8SSJ+KRvbMBZn0EGVlT4DRYeQ/6hjlyXBh+Kg==} engines: {node: '>=6.9.0'} - '@babel/template@7.25.9': - resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} - engines: {node: '>=6.9.0'} - - '@babel/traverse@7.25.9': - resolution: {integrity: sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.26.0': - resolution: {integrity: sha512-Z/yiTPj+lDVnF7lWeKCIJzaIkI0vYO87dMpZ4bg4TDrFe4XXLFWL1TbXU27gBP3QccxV9mZICCrnjnYlJjXHOA==} - engines: {node: '>=6.9.0'} - '@emnapi/runtime@1.3.1': resolution: {integrity: sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==} - '@emotion/babel-plugin@11.12.0': - resolution: {integrity: sha512-y2WQb+oP8Jqvvclh8Q55gLUyb7UFvgv7eJfsj7td5TToBrIUtPay2kMrZi4xjq9qw2vD0ZR5fSho0yqoFgX7Rw==} - - '@emotion/cache@11.13.1': - resolution: {integrity: sha512-iqouYkuEblRcXmylXIwwOodiEK5Ifl7JcX7o6V4jI3iW4mLXX3dmt5xwBtIkJiQEXFAI+pC8X0i67yiPkH9Ucw==} - - '@emotion/css@11.13.4': - resolution: {integrity: sha512-CthbOD5EBw+iN0rfM96Tuv5kaZN4nxPyYDvGUs0bc7wZBBiU/0mse+l+0O9RshW2d+v5HH1cme+BAbLJ/3Folw==} - - '@emotion/hash@0.9.2': - resolution: {integrity: sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==} - '@emotion/is-prop-valid@0.8.8': resolution: {integrity: sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==} '@emotion/memoize@0.7.4': resolution: {integrity: sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==} - '@emotion/memoize@0.9.0': - resolution: {integrity: sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==} - - '@emotion/serialize@1.3.2': - resolution: {integrity: sha512-grVnMvVPK9yUVE6rkKfAJlYZgo0cu3l9iMC77V7DW6E1DUIrU68pSEXRmFZFOFB1QFo57TncmOcvcbMDWsL4yA==} - - '@emotion/server@11.11.0': - resolution: {integrity: sha512-6q89fj2z8VBTx9w93kJ5n51hsmtYuFPtZgnc1L8VzRx9ti4EU6EyvF6Nn1H1x3vcCQCF7u2dB2lY4AYJwUW4PA==} - peerDependencies: - '@emotion/css': ^11.0.0-rc.0 - peerDependenciesMeta: - '@emotion/css': - optional: true - - '@emotion/sheet@1.4.0': - resolution: {integrity: sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==} - - '@emotion/unitless@0.10.0': - resolution: {integrity: sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==} - - '@emotion/utils@1.4.1': - resolution: {integrity: sha512-BymCXzCG3r72VKJxaYVwOXATqXIZ85cuvg0YOUDxMGNrKc1DJRZk8MgV5wyXRyEayIMd4FuXJIUgTBXvDNW5cA==} - - '@emotion/weak-memoize@0.4.0': - resolution: {integrity: sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==} - '@eslint-community/eslint-utils@4.4.0': resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -842,9 +755,6 @@ packages: '@types/node@20.16.13': resolution: {integrity: sha512-GjQ7im10B0labo8ZGXDGROUl9k0BNyDgzfGpb4g/cl+4yYDWVKcozANF4FGr4/p0O/rAkQClM6Wiwkije++1Tg==} - '@types/parse-json@4.0.2': - resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} - '@types/prop-types@15.7.13': resolution: {integrity: sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==} @@ -1010,10 +920,6 @@ packages: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} - babel-plugin-macros@3.1.0: - resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} - engines: {node: '>=10', npm: '>=6'} - balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1031,9 +937,6 @@ packages: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} - buffer-from@0.1.2: - resolution: {integrity: sha512-RiWIenusJsmI2KcvqQABB83tLxCByE3upSP8QU3rJDMVFGPWLvPQJt/O1Su9moRWeH7d+Q2HYb68f6+v+tw2vg==} - busboy@1.6.0: resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} engines: {node: '>=10.16.0'} @@ -1106,16 +1009,6 @@ packages: concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} - convert-source-map@1.9.0: - resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} - - core-util-is@1.0.3: - resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - - cosmiconfig@7.1.0: - resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} - engines: {node: '>=10'} - cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -1200,9 +1093,6 @@ packages: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} - duplexer2@0.1.4: - resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} - eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -1216,9 +1106,6 @@ packages: resolution: {integrity: sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==} engines: {node: '>=10.13.0'} - error-ex@1.3.2: - resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} - es-abstract@1.23.3: resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} engines: {node: '>= 0.4'} @@ -1396,9 +1283,6 @@ packages: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} - find-root@1.1.0: - resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} - find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -1480,10 +1364,6 @@ packages: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported - globals@11.12.0: - resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} - engines: {node: '>=4'} - globals@13.24.0: resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} @@ -1527,10 +1407,6 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} - html-tokenize@2.0.1: - resolution: {integrity: sha512-QY6S+hZ0f5m1WT8WffYN+Hg+xm/w5I8XeUcAq/ZYP5wVC8xbKi4Whhru3FtrAebD5EhBW8rmFzkDI6eCAuFe2w==} - hasBin: true - ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -1569,9 +1445,6 @@ packages: resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} engines: {node: '>= 0.4'} - is-arrayish@0.2.1: - resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - is-arrayish@0.3.2: resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} @@ -1683,12 +1556,6 @@ packages: resolution: {integrity: sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==} engines: {node: '>= 0.4'} - isarray@0.0.1: - resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} - - isarray@1.0.0: - resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} @@ -1713,17 +1580,9 @@ packages: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true - jsesc@3.0.2: - resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} - engines: {node: '>=6'} - hasBin: true - json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} - json-parse-even-better-errors@2.3.1: - resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -1813,9 +1672,6 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - multipipe@1.0.2: - resolution: {integrity: sha512-6uiC9OvY71vzSGX8lZvSqscE7ft9nPupJ8fMjrCNRAUy2LREUW42UL+V/NTrogr6rFgRydUrCX4ZitfpSNkSCQ==} - mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -1868,9 +1724,6 @@ packages: resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==} engines: {node: '>= 0.4'} - object-keys@0.4.0: - resolution: {integrity: sha512-ncrLw+X55z7bkl5PnUvHwFK9FcGuFYo9gtjws2XtSzL+aZ8tm830P60WJ0dSmFVaSalWieW5MD7kEdnXda9yJw==} - object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} @@ -1917,10 +1770,6 @@ packages: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} - parse-json@5.2.0: - resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} - engines: {node: '>=8'} - path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -1940,10 +1789,6 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} - path-type@4.0.0: - resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} - engines: {node: '>=8'} - picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -2072,9 +1917,6 @@ packages: engines: {node: '>=14'} hasBin: true - process-nextick-args@2.0.1: - resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} @@ -2140,12 +1982,6 @@ packages: read-cache@1.0.0: resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} - readable-stream@1.0.34: - resolution: {integrity: sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==} - - readable-stream@2.3.8: - resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} - readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} @@ -2200,9 +2036,6 @@ packages: resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} engines: {node: '>=0.4'} - safe-buffer@5.1.2: - resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - safe-regex-test@1.0.3: resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} engines: {node: '>= 0.4'} @@ -2254,10 +2087,6 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} - source-map@0.5.7: - resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==} - engines: {node: '>=0.10.0'} - standard-as-callback@2.1.0: resolution: {integrity: sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==} @@ -2299,12 +2128,6 @@ packages: resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} engines: {node: '>= 0.4'} - string_decoder@0.10.31: - resolution: {integrity: sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==} - - string_decoder@1.1.1: - resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} - strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -2334,9 +2157,6 @@ packages: babel-plugin-macros: optional: true - stylis@4.2.0: - resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==} - sucrase@3.35.0: resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} engines: {node: '>=16 || 14 >=14.17'} @@ -2382,12 +2202,6 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - through2@0.4.2: - resolution: {integrity: sha512-45Llu+EwHKtAZYTPPVn3XZHBgakWMN3rokhEv5hu596XP+cNgplMg+Gj+1nmAvj+L0K7+N49zBKx5rah5u0QIQ==} - - through@2.3.8: - resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} - to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -2465,11 +2279,6 @@ packages: '@types/react': optional: true - use-smooth-count@1.0.1: - resolution: {integrity: sha512-IBYiH4qRUtQa62o8T+WK85beCwCmEhqRA4ch7FUaeR3rTppcxieIMe2ImC1sF4grmMfXTDVWqOA9ZGcl/VC37w==} - peerDependencies: - react: '>=16' - use-sync-external-store@1.2.2: resolution: {integrity: sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==} peerDependencies: @@ -2513,14 +2322,6 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - xtend@2.1.2: - resolution: {integrity: sha512-vMNKzr2rHP9Dp/e1NQFnLQlwlhp9L/LfvnsVdHxN1f+uggyVI3i08uD14GPvCToPkdsRfyPqIyYGmIk58V98ZQ==} - engines: {node: '>=0.4'} - - yaml@1.10.2: - resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} - engines: {node: '>= 6'} - yaml@2.6.0: resolution: {integrity: sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==} engines: {node: '>= 14'} @@ -2534,103 +2335,15 @@ snapshots: '@alloc/quick-lru@5.2.0': {} - '@babel/code-frame@7.26.2': - dependencies: - '@babel/helper-validator-identifier': 7.25.9 - js-tokens: 4.0.0 - picocolors: 1.1.1 - - '@babel/generator@7.26.2': - dependencies: - '@babel/parser': 7.26.2 - '@babel/types': 7.26.0 - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 - jsesc: 3.0.2 - - '@babel/helper-module-imports@7.25.9': - dependencies: - '@babel/traverse': 7.25.9 - '@babel/types': 7.26.0 - transitivePeerDependencies: - - supports-color - - '@babel/helper-string-parser@7.25.9': {} - - '@babel/helper-validator-identifier@7.25.9': {} - - '@babel/parser@7.26.2': - dependencies: - '@babel/types': 7.26.0 - '@babel/runtime@7.25.9': dependencies: regenerator-runtime: 0.14.1 - '@babel/template@7.25.9': - dependencies: - '@babel/code-frame': 7.26.2 - '@babel/parser': 7.26.2 - '@babel/types': 7.26.0 - - '@babel/traverse@7.25.9': - dependencies: - '@babel/code-frame': 7.26.2 - '@babel/generator': 7.26.2 - '@babel/parser': 7.26.2 - '@babel/template': 7.25.9 - '@babel/types': 7.26.0 - debug: 4.3.7 - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - - '@babel/types@7.26.0': - dependencies: - '@babel/helper-string-parser': 7.25.9 - '@babel/helper-validator-identifier': 7.25.9 - '@emnapi/runtime@1.3.1': dependencies: tslib: 2.8.0 optional: true - '@emotion/babel-plugin@11.12.0': - dependencies: - '@babel/helper-module-imports': 7.25.9 - '@babel/runtime': 7.25.9 - '@emotion/hash': 0.9.2 - '@emotion/memoize': 0.9.0 - '@emotion/serialize': 1.3.2 - babel-plugin-macros: 3.1.0 - convert-source-map: 1.9.0 - escape-string-regexp: 4.0.0 - find-root: 1.1.0 - source-map: 0.5.7 - stylis: 4.2.0 - transitivePeerDependencies: - - supports-color - - '@emotion/cache@11.13.1': - dependencies: - '@emotion/memoize': 0.9.0 - '@emotion/sheet': 1.4.0 - '@emotion/utils': 1.4.1 - '@emotion/weak-memoize': 0.4.0 - stylis: 4.2.0 - - '@emotion/css@11.13.4': - dependencies: - '@emotion/babel-plugin': 11.12.0 - '@emotion/cache': 11.13.1 - '@emotion/serialize': 1.3.2 - '@emotion/sheet': 1.4.0 - '@emotion/utils': 1.4.1 - transitivePeerDependencies: - - supports-color - - '@emotion/hash@0.9.2': {} - '@emotion/is-prop-valid@0.8.8': dependencies: '@emotion/memoize': 0.7.4 @@ -2639,33 +2352,6 @@ snapshots: '@emotion/memoize@0.7.4': optional: true - '@emotion/memoize@0.9.0': {} - - '@emotion/serialize@1.3.2': - dependencies: - '@emotion/hash': 0.9.2 - '@emotion/memoize': 0.9.0 - '@emotion/unitless': 0.10.0 - '@emotion/utils': 1.4.1 - csstype: 3.1.3 - - '@emotion/server@11.11.0(@emotion/css@11.13.4)': - dependencies: - '@emotion/utils': 1.4.1 - html-tokenize: 2.0.1 - multipipe: 1.0.2 - through: 2.3.8 - optionalDependencies: - '@emotion/css': 11.13.4 - - '@emotion/sheet@1.4.0': {} - - '@emotion/unitless@0.10.0': {} - - '@emotion/utils@1.4.1': {} - - '@emotion/weak-memoize@0.4.0': {} - '@eslint-community/eslint-utils@4.4.0(eslint@8.57.1)': dependencies: eslint: 8.57.1 @@ -3222,8 +2908,6 @@ snapshots: dependencies: undici-types: 6.19.8 - '@types/parse-json@4.0.2': {} - '@types/prop-types@15.7.13': {} '@types/react-dom@18.3.1': @@ -3435,12 +3119,6 @@ snapshots: axobject-query@4.1.0: {} - babel-plugin-macros@3.1.0: - dependencies: - '@babel/runtime': 7.25.9 - cosmiconfig: 7.1.0 - resolve: 1.22.8 - balanced-match@1.0.2: {} binary-extensions@2.3.0: {} @@ -3458,8 +3136,6 @@ snapshots: dependencies: fill-range: 7.1.1 - buffer-from@0.1.2: {} - busboy@1.6.0: dependencies: streamsearch: 1.1.0 @@ -3527,28 +3203,18 @@ snapshots: dependencies: color-name: 1.1.4 simple-swizzle: 0.2.2 + optional: true color@4.2.3: dependencies: color-convert: 2.0.1 color-string: 1.9.1 + optional: true commander@4.1.1: {} concat-map@0.0.1: {} - convert-source-map@1.9.0: {} - - core-util-is@1.0.3: {} - - cosmiconfig@7.1.0: - dependencies: - '@types/parse-json': 4.0.2 - import-fresh: 3.3.0 - parse-json: 5.2.0 - path-type: 4.0.0 - yaml: 1.10.2 - cross-spawn@7.0.3: dependencies: path-key: 3.1.1 @@ -3624,7 +3290,8 @@ snapshots: denque@2.1.0: {} - detect-libc@2.0.3: {} + detect-libc@2.0.3: + optional: true detect-node-es@1.1.0: {} @@ -3640,10 +3307,6 @@ snapshots: dependencies: esutils: 2.0.3 - duplexer2@0.1.4: - dependencies: - readable-stream: 2.3.8 - eastasianwidth@0.2.0: {} emoji-regex@8.0.0: {} @@ -3655,10 +3318,6 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.2.1 - error-ex@1.3.2: - dependencies: - is-arrayish: 0.2.1 - es-abstract@1.23.3: dependencies: array-buffer-byte-length: 1.0.1 @@ -3775,8 +3434,8 @@ snapshots: '@typescript-eslint/parser': 8.10.0(eslint@8.57.1)(typescript@5.6.3) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) eslint-plugin-jsx-a11y: 6.10.0(eslint@8.57.1) eslint-plugin-react: 7.37.1(eslint@8.57.1) eslint-plugin-react-hooks: 5.0.0(eslint@8.57.1) @@ -3795,37 +3454,37 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1): + eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.3.7 enhanced-resolve: 5.17.1 eslint: 8.57.1 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1))(eslint@8.57.1) fast-glob: 3.3.2 get-tsconfig: 4.8.1 is-bun-module: 1.2.1 is-glob: 4.0.3 optionalDependencies: - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1) transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1))(eslint@8.57.1): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 8.10.0(eslint@8.57.1)(typescript@5.6.3) eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -3836,7 +3495,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.1 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1))(eslint@8.57.1))(eslint@8.57.1) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@8.10.0(eslint@8.57.1)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.1))(eslint@8.57.1) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -4002,8 +3661,6 @@ snapshots: dependencies: to-regex-range: 5.0.1 - find-root@1.1.0: {} - find-up@5.0.0: dependencies: locate-path: 6.0.0 @@ -4096,8 +3753,6 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 - globals@11.12.0: {} - globals@13.24.0: dependencies: type-fest: 0.20.2 @@ -4135,14 +3790,6 @@ snapshots: dependencies: function-bind: 1.1.2 - html-tokenize@2.0.1: - dependencies: - buffer-from: 0.1.2 - inherits: 2.0.4 - minimist: 1.2.8 - readable-stream: 1.0.34 - through2: 0.4.2 - ignore@5.3.2: {} import-fresh@3.3.0: @@ -4193,9 +3840,8 @@ snapshots: call-bind: 1.0.7 get-intrinsic: 1.2.4 - is-arrayish@0.2.1: {} - - is-arrayish@0.3.2: {} + is-arrayish@0.3.2: + optional: true is-async-function@2.0.0: dependencies: @@ -4294,10 +3940,6 @@ snapshots: call-bind: 1.0.7 get-intrinsic: 1.2.4 - isarray@0.0.1: {} - - isarray@1.0.0: {} - isarray@2.0.5: {} isexe@2.0.0: {} @@ -4324,12 +3966,8 @@ snapshots: dependencies: argparse: 2.0.1 - jsesc@3.0.2: {} - json-buffer@3.0.1: {} - json-parse-even-better-errors@2.3.1: {} - json-schema-traverse@0.4.1: {} json-stable-stringify-without-jsonify@1.0.1: {} @@ -4407,11 +4045,6 @@ snapshots: ms@2.1.3: {} - multipipe@1.0.2: - dependencies: - duplexer2: 0.1.4 - object-assign: 4.1.1 - mz@2.7.0: dependencies: any-promise: 1.3.0 @@ -4460,8 +4093,6 @@ snapshots: call-bind: 1.0.7 define-properties: 1.2.1 - object-keys@0.4.0: {} - object-keys@1.1.1: {} object.assign@4.1.5: @@ -4523,13 +4154,6 @@ snapshots: dependencies: callsites: 3.1.0 - parse-json@5.2.0: - dependencies: - '@babel/code-frame': 7.26.2 - error-ex: 1.3.2 - json-parse-even-better-errors: 2.3.1 - lines-and-columns: 1.2.4 - path-exists@4.0.0: {} path-is-absolute@1.0.1: {} @@ -4543,8 +4167,6 @@ snapshots: lru-cache: 10.4.3 minipass: 7.1.2 - path-type@4.0.0: {} - picocolors@1.1.1: {} picomatch@2.3.1: {} @@ -4606,8 +4228,6 @@ snapshots: prettier@3.3.3: {} - process-nextick-args@2.0.1: {} - prop-types@15.8.1: dependencies: loose-envify: 1.4.0 @@ -4673,23 +4293,6 @@ snapshots: dependencies: pify: 2.3.0 - readable-stream@1.0.34: - dependencies: - core-util-is: 1.0.3 - inherits: 2.0.4 - isarray: 0.0.1 - string_decoder: 0.10.31 - - readable-stream@2.3.8: - dependencies: - core-util-is: 1.0.3 - inherits: 2.0.4 - isarray: 1.0.0 - process-nextick-args: 2.0.1 - safe-buffer: 5.1.2 - string_decoder: 1.1.1 - util-deprecate: 1.0.2 - readdirp@3.6.0: dependencies: picomatch: 2.3.1 @@ -4752,8 +4355,6 @@ snapshots: has-symbols: 1.0.3 isarray: 2.0.5 - safe-buffer@5.1.2: {} - safe-regex-test@1.0.3: dependencies: call-bind: 1.0.7 @@ -4809,6 +4410,7 @@ snapshots: '@img/sharp-wasm32': 0.33.5 '@img/sharp-win32-ia32': 0.33.5 '@img/sharp-win32-x64': 0.33.5 + optional: true shebang-command@2.0.0: dependencies: @@ -4828,11 +4430,10 @@ snapshots: simple-swizzle@0.2.2: dependencies: is-arrayish: 0.3.2 + optional: true source-map-js@1.2.1: {} - source-map@0.5.7: {} - standard-as-callback@2.1.0: {} stop-iteration-iterator@1.0.0: @@ -4898,12 +4499,6 @@ snapshots: define-properties: 1.2.1 es-object-atoms: 1.0.0 - string_decoder@0.10.31: {} - - string_decoder@1.1.1: - dependencies: - safe-buffer: 5.1.2 - strip-ansi@6.0.1: dependencies: ansi-regex: 5.0.1 @@ -4921,8 +4516,6 @@ snapshots: client-only: 0.0.1 react: 18.3.1 - stylis@4.2.0: {} - sucrase@3.35.0: dependencies: '@jridgewell/gen-mapping': 0.3.5 @@ -4990,13 +4583,6 @@ snapshots: dependencies: any-promise: 1.3.0 - through2@0.4.2: - dependencies: - readable-stream: 1.0.34 - xtend: 2.1.2 - - through@2.3.8: {} - to-regex-range@5.0.1: dependencies: is-number: 7.0.0 @@ -5084,10 +4670,6 @@ snapshots: optionalDependencies: '@types/react': 18.3.12 - use-smooth-count@1.0.1(react@18.3.1): - dependencies: - react: 18.3.1 - use-sync-external-store@1.2.2(react@18.3.1): dependencies: react: 18.3.1 @@ -5152,12 +4734,6 @@ snapshots: wrappy@1.0.2: {} - xtend@2.1.2: - dependencies: - object-keys: 0.4.0 - - yaml@1.10.2: {} - yaml@2.6.0: {} yocto-queue@0.1.0: {} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 1b3dcbe..e917d7d 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -11,10 +11,10 @@ const poppins = Poppins({ export const metadata: Metadata = { title: "Lanyard for GitHub Profile", - description: "Utilize Lanyard to display your Discord Presence in your GitHub Profile", + description: "Display your Discord Presence anywhere, using Lanyard", openGraph: { title: "Lanyard for GitHub Profile", - description: "Utilize Lanyard to display your Discord Presence in your GitHub Profile", + description: "Display your Discord Presence anywhere, using Lanyard", }, }; diff --git a/src/app/page.tsx b/src/app/page.tsx index 80f4e45..d5853fe 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,18 +1,21 @@ "use client"; -import React, { useState, useMemo, JSX, useRef, useEffect } from "react"; +import React, { useState, JSX, useRef, useEffect } from "react"; import { motion } from "framer-motion"; import useSWR from "swr"; import { getUserCount } from "@/utils/actions"; import { isSnowflake } from "@/utils/snowflake"; import Link from "next/link"; -import { PARAMETERS } from "@/utils/parameters"; +import { PARAMETER_INFO } from "@/utils/parameters"; import * as Icon from "lucide-react"; -import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; +import { Popover, PopoverContent, PopoverTrigger } from "@/components/popover"; import { cn, filterLetters } from "@/lib/utils"; export default function Home() { - const originUrl = process.env.NODE_ENV === "development" ? "http://localhost:3001" : "https://lanyard.cnrad.dev"; + const ORIGIN_URL = + process.env.NODE_ENV === "development" + ? "https://ae78-128-119-202-198.ngrok-free.app" + : "https://lanyard.cnrad.dev"; const [userId, setUserId] = useState(""); const [userError, setUserError] = useState(); @@ -32,7 +35,7 @@ export default function Home() { if (userId.length > 0 && !isSnowflake(userId)) return setUserError("Invalid Discord ID"); } - const url = `${originUrl}/api/${userId}${ + const url = `${ORIGIN_URL}/api/${userId}${ Object.keys(options).length > 0 ? `?${Object.keys(options) .map(option => `${option}=${options[option]}`) @@ -73,7 +76,18 @@ export default function Home() {

🏷️ lanyard-profile-readme

-

Uses Lanyard to display your Discord Presence anywhere.

+

+ Uses{" "} + + Lanyard + {" "} + to display your Discord Presence anywhere. +

- {PARAMETERS.filter(item => item.type !== "boolean").map(item => { + {PARAMETER_INFO.filter(item => item.type !== "boolean").map(item => { return (
@@ -136,7 +150,7 @@ export default function Home() { const filteredValue = encodeURIComponent( filterLetters( e.target.value, - (PARAMETERS.find(p => p.parameter === item.parameter) as any).options.omit, + (PARAMETER_INFO.find(p => p.parameter === item.parameter) as any).options.omit, ), ); @@ -188,7 +202,7 @@ export default function Home() { {/* Separated for easier styling/readability */}
- {PARAMETERS.filter(item => item.type === "boolean").map(item => { + {PARAMETER_INFO.filter(item => item.type === "boolean").map(item => { return (
p.parameter === item.parameter)?.deprecated + textDecoration: PARAMETER_INFO.find(p => p.parameter === item.parameter)?.deprecated ? "line-through" : "none", }} diff --git a/src/components/ui/popover.tsx b/src/components/popover.tsx similarity index 99% rename from src/components/ui/popover.tsx rename to src/components/popover.tsx index afb20c8..6d897bd 100644 --- a/src/components/ui/popover.tsx +++ b/src/components/popover.tsx @@ -2,7 +2,6 @@ import * as React from "react"; import * as PopoverPrimitive from "@radix-ui/react-popover"; - import { cn } from "@/lib/utils"; const Popover = PopoverPrimitive.Root; diff --git a/src/utils/getFlags.ts b/src/utils/getFlags.ts deleted file mode 100644 index 0f45516..0000000 --- a/src/utils/getFlags.ts +++ /dev/null @@ -1,19 +0,0 @@ -export const getFlags = (flag: number): string[] => { - let flags: string[] = []; - - // In the order they appear on profiles - if (flag & 1) flags.push("Discord_Employee"); // 1 << 0 - if (flag & 262144) flags.push("Discord_Certified_Moderator"); // 1 << 18 - if (flag & 2) flags.push("Partnered_Server_Owner"); // 1 << 1 - if (flag & 4) flags.push("HypeSquad_Events"); // 1 << 2 - if (flag & 64) flags.push("House_Bravery"); // 1 << 6 - if (flag & 128) flags.push("House_Brilliance"); // 1 << 7 - if (flag & 256) flags.push("House_Balance"); // 1 << 8 - if (flag & 8) flags.push("Bug_Hunter_Level_1"); // 1 << 3 - if (flag & 16384) flags.push("Bug_Hunter_Level_2"); // 1 << 14 - if (flag & 4194304) flags.push("Active_Developer"); // 1 << 22 - if (flag & 131072) flags.push("Early_Verified_Bot_Developer"); // 1 << 17 - if (flag & 512) flags.push("Early_Supporter"); // 1 << 9 - - return flags; -}; diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts new file mode 100644 index 0000000..c013e2f --- /dev/null +++ b/src/utils/helpers.ts @@ -0,0 +1,26 @@ +import type { renderToStaticMarkup as _renderToStaticMarkup } from "react-dom/server"; + +export let renderToStaticMarkup: typeof _renderToStaticMarkup; +import("react-dom/server").then(module => { + renderToStaticMarkup = module.renderToStaticMarkup; +}); + +export const getFlags = (flag: number): string[] => { + let flags: string[] = []; + + // In the order they appear on profiles + if (flag & 1) flags.push("Discord_Employee"); // 1 << 0 + if (flag & 262144) flags.push("Discord_Certified_Moderator"); // 1 << 18 + if (flag & 2) flags.push("Partnered_Server_Owner"); // 1 << 1 + if (flag & 4) flags.push("HypeSquad_Events"); // 1 << 2 + if (flag & 64) flags.push("House_Bravery"); // 1 << 6 + if (flag & 128) flags.push("House_Brilliance"); // 1 << 7 + if (flag & 256) flags.push("House_Balance"); // 1 << 8 + if (flag & 8) flags.push("Bug_Hunter_Level_1"); // 1 << 3 + if (flag & 16384) flags.push("Bug_Hunter_Level_2"); // 1 << 14 + if (flag & 4194304) flags.push("Active_Developer"); // 1 << 22 + if (flag & 131072) flags.push("Early_Verified_Bot_Developer"); // 1 << 17 + if (flag & 512) flags.push("Early_Supporter"); // 1 << 9 + + return flags; +}; diff --git a/src/utils/parameters.ts b/src/utils/parameters.ts index ce4abcc..a1d992d 100644 --- a/src/utils/parameters.ts +++ b/src/utils/parameters.ts @@ -19,7 +19,7 @@ export type Parameters = { idleMessage?: string; }; -export type IParameter = Array< +export type IParameterInfo = Array< { deprecated?: boolean } & ( | { parameter: string; @@ -55,7 +55,7 @@ export type IParameter = Array< ) >; -export const PARAMETERS: IParameter = [ +export const PARAMETER_INFO: IParameterInfo = [ { parameter: "theme", type: "list", @@ -190,4 +190,4 @@ export const PARAMETERS: IParameter = [ description: "Hides your discriminator. (DEPRECATED, RIP)", deprecated: true, }, -].sort((a, b) => b.type.localeCompare(a.type)) as IParameter; +].sort((a, b) => b.type.localeCompare(a.type)) as IParameterInfo; diff --git a/src/utils/renderCard.tsx b/src/utils/renderCard.tsx index cd01864..1f63392 100644 --- a/src/utils/renderCard.tsx +++ b/src/utils/renderCard.tsx @@ -1,193 +1,190 @@ "use server"; -// probably the messiest code i've ever written but it works so :) import { Badges } from "#/public/assets/badges/BadgesEncoded"; -import { getFlags } from "@/utils/getFlags"; +import { getFlags, renderToStaticMarkup } from "@/utils/helpers"; import * as LanyardTypes from "@/utils/LanyardTypes"; import { encodeBase64 } from "@/utils/toBase64"; -import escape from "escape-html"; - -import createEmotion from '@emotion/css/create-instance' - -import createEmotionServer from '@emotion/server/create-instance' - -const key = 'render-card' -const { css, cache } = createEmotion({ key }) -const { extractCritical } = createEmotionServer(cache) +import { DetailedHTMLProps, HTMLAttributes } from "react"; export type Parameters = { - theme?: string; - bg?: string; - clanbg?: string; - animated?: string; - animatedDecoration?: string; - hideDiscrim?: string; - hideStatus?: string; - hideTimestamp?: string; - hideBadges?: string; - hideProfile?: string; - hideActivity?: string; - hideSpotify?: string; - hideClan?: string; - hideDecoration?: string; - ignoreAppId?: string; - showDisplayName?: string; - borderRadius?: string; - idleMessage?: string; + theme?: string; + bg?: string; + clanbg?: string; + animated?: string; + animatedDecoration?: string; + hideDiscrim?: string; + hideStatus?: string; + hideTimestamp?: string; + hideBadges?: string; + hideProfile?: string; + hideActivity?: string; + hideSpotify?: string; + hideClan?: string; + hideDecoration?: string; + ignoreAppId?: string; + showDisplayName?: string; + borderRadius?: string; + idleMessage?: string; }; -const parseBool = (string: string | undefined): boolean => string === "true" ? true : false; +const parseBool = (string: string | undefined): boolean => (string === "true" ? true : false); const parseAppId = (string: string | undefined): Array => { - if (string === undefined) return []; - return string.split(","); -} + if (string === undefined) return []; + return string.split(","); +}; const elapsedTime = (timestamp: any): string => { - let startTime = timestamp; - let endTime = Number(new Date()); - let difference = (endTime - startTime) / 1000; + let startTime = timestamp; + let endTime = Number(new Date()); + let difference = (endTime - startTime) / 1000; - // we only calculate them, but we don't display them. - // this fixes a bug in the Discord API that does not send the correct timestamp to presence. - let daysDifference = Math.floor(difference / 60 / 60 / 24); - difference -= daysDifference * 60 * 60 * 24; + // we only calculate them, but we don't display them. + // this fixes a bug in the Discord API that does not send the correct timestamp to presence. + let daysDifference = Math.floor(difference / 60 / 60 / 24); + difference -= daysDifference * 60 * 60 * 24; - let hoursDifference = Math.floor(difference / 60 / 60); - difference -= hoursDifference * 60 * 60; + let hoursDifference = Math.floor(difference / 60 / 60); + difference -= hoursDifference * 60 * 60; - let minutesDifference = Math.floor(difference / 60); - difference -= minutesDifference * 60; + let minutesDifference = Math.floor(difference / 60); + difference -= minutesDifference * 60; - let secondsDifference = Math.floor(difference); + let secondsDifference = Math.floor(difference); - return `${hoursDifference >= 1 ? ("0" + hoursDifference).slice(-2) + ":" : ""}${("0" + minutesDifference).slice( - -2 - )}:${("0" + secondsDifference).slice(-2)}`; + return `${hoursDifference >= 1 ? ("0" + hoursDifference).slice(-2) + ":" : ""}${("0" + minutesDifference).slice( + -2, + )}:${("0" + secondsDifference).slice(-2)}`; }; async function renderCard(body: LanyardTypes.Root, params: Parameters): Promise { - let { data } = body; + let { data } = body; - let avatarBorderColor: string = "#747F8D", - avatarExtension: string = "webp", - statusExtension: string = "webp", - activity: any = false, - backgroundColor: string = "1a1c1f", - theme = "dark", - borderRadius = "10px", - idleMessage = "I'm not currently doing anything!"; + let avatarBorderColor: string = "#747F8D", + avatarExtension: string = "webp", + statusExtension: string = "webp", + activity: any = false, + backgroundColor: string = "1a1c1f", + theme = "dark", + borderRadius = "10px", + idleMessage = "I'm not currently doing anything!"; - let hideStatus = parseBool(params.hideStatus); - let hideTimestamp = parseBool(params.hideTimestamp); - let hideBadges = parseBool(params.hideBadges); - let hideProfile = parseBool(params.hideProfile); - let hideActivity = params.hideActivity ?? "false"; - let hideSpotify = parseBool(params.hideSpotify); - let hideClan = parseBool(params.hideClan); - let hideDecoration = parseBool(params.hideDecoration); - let ignoreAppId = parseAppId(params.ignoreAppId); - let hideDiscrim = parseBool(params.hideDiscrim); - let showDisplayName = parseBool(params.showDisplayName); + let hideStatus = parseBool(params.hideStatus); + let hideTimestamp = parseBool(params.hideTimestamp); + let hideBadges = parseBool(params.hideBadges); + let hideProfile = parseBool(params.hideProfile); + let hideActivity = params.hideActivity ?? "false"; + let hideSpotify = parseBool(params.hideSpotify); + let hideClan = parseBool(params.hideClan); + let hideDecoration = parseBool(params.hideDecoration); + let ignoreAppId = parseAppId(params.ignoreAppId); + let hideDiscrim = parseBool(params.hideDiscrim); + let showDisplayName = parseBool(params.showDisplayName); - if (!data.discord_user.avatar_decoration_data) hideDecoration = true; - if (parseBool(params.hideDiscrim) || body.data.discord_user.discriminator === "0") hideDiscrim = true; - if (!body.data.discord_user.clan) hideClan = true; - if (data.activities[0]?.emoji?.animated) statusExtension = "gif"; - if (data.discord_user.avatar && data.discord_user.avatar.startsWith("a_")) avatarExtension = "gif"; - if (params.animated === "false") avatarExtension = "webp"; - if (params.theme === "light") { - backgroundColor = "eee"; - theme = "light"; - } - if (params.bg) backgroundColor = params.bg; - let clanBackgroundColor: string = theme === "light" ? "#e0dede" : "#111214"; - if (params.clanbg) clanBackgroundColor = params.clanbg; - if (params.idleMessage) idleMessage = params.idleMessage; - if (params.borderRadius) borderRadius = params.borderRadius; - - let avatar: string; - if (data.discord_user.avatar) { - avatar = await encodeBase64( - `https://cdn.discordapp.com/avatars/${data.discord_user.id}/${ - data.discord_user.avatar - }.${avatarExtension}?size=${avatarExtension === "gif" ? "64" : "256"}` - ); - } else { - avatar = await encodeBase64( - `https://cdn.discordapp.com/embed/avatars/${data.discord_user.discriminator === "0" - ? ((Number(BigInt(data.discord_user.id) >> BigInt(22))) % 6) - : Number(data.discord_user.discriminator) % 5}.png` - ); - } + if (!data.discord_user.avatar_decoration_data) hideDecoration = true; + if (parseBool(params.hideDiscrim) || body.data.discord_user.discriminator === "0") hideDiscrim = true; + if (!body.data.discord_user.clan) hideClan = true; + if (data.activities[0]?.emoji?.animated) statusExtension = "gif"; + if (data.discord_user.avatar && data.discord_user.avatar.startsWith("a_")) avatarExtension = "gif"; + if (params.animated === "false") avatarExtension = "webp"; + if (params.theme === "light") { + backgroundColor = "eee"; + theme = "light"; + } + if (params.bg) backgroundColor = params.bg; + let clanBackgroundColor: string = theme === "light" ? "#e0dede" : "#111214"; + if (params.clanbg) clanBackgroundColor = params.clanbg; + if (params.idleMessage) idleMessage = params.idleMessage; + if (params.borderRadius) borderRadius = params.borderRadius; - let clanBadge: string; - if (data.discord_user.clan) { - clanBadge = await encodeBase64( - `https://cdn.discordapp.com/clan-badges/${data.discord_user.clan.identity_guild_id}/${data.discord_user.clan.badge}.png?size=16` - ); - } + let avatar: string; + if (data.discord_user.avatar) { + avatar = await encodeBase64( + `https://cdn.discordapp.com/avatars/${data.discord_user.id}/${ + data.discord_user.avatar + }.${avatarExtension}?size=${avatarExtension === "gif" ? "64" : "256"}`, + ); + } else { + avatar = await encodeBase64( + `https://cdn.discordapp.com/embed/avatars/${ + data.discord_user.discriminator === "0" + ? Number(BigInt(data.discord_user.id) >> BigInt(22)) % 6 + : Number(data.discord_user.discriminator) % 5 + }.png`, + ); + } - let avatarDecoration: string; - if (data.discord_user.avatar_decoration_data) { - avatarDecoration = await encodeBase64( - `https://cdn.discordapp.com/avatar-decoration-presets/${data.discord_user.avatar_decoration_data.asset}.png?size=64&passthrough=${params.animatedDecoration || "true"}` - ); - } + let clanBadge: string; + if (data.discord_user.clan) { + clanBadge = await encodeBase64( + `https://cdn.discordapp.com/clan-badges/${data.discord_user.clan.identity_guild_id}/${data.discord_user.clan.badge}.png?size=16`, + ); + } - switch (data.discord_status) { - case "online": - avatarBorderColor = "#43B581"; - break; - case "idle": - avatarBorderColor = "#FAA61A"; - break; - case "dnd": - avatarBorderColor = "#F04747"; - break; - case "offline": - avatarBorderColor = "#747F8D"; - break; - } + let avatarDecoration: string; + if (data.discord_user.avatar_decoration_data) { + avatarDecoration = await encodeBase64( + `https://cdn.discordapp.com/avatar-decoration-presets/${data.discord_user.avatar_decoration_data.asset}.png?size=64&passthrough=${params.animatedDecoration || "true"}`, + ); + } - let flags: string[] = getFlags(data.discord_user.public_flags); - if (data.discord_user.avatar && data.discord_user.avatar.includes("a_")) flags.push("Nitro"); + switch (data.discord_status) { + case "online": + avatarBorderColor = "#43B581"; + break; + case "idle": + avatarBorderColor = "#FAA61A"; + break; + case "dnd": + avatarBorderColor = "#F04747"; + break; + case "offline": + avatarBorderColor = "#747F8D"; + break; + } - let userStatus: Record | null = null; - if (data.activities[0] && data.activities[0].type === 4) userStatus = data.activities[0]; + let flags: string[] = getFlags(data.discord_user.public_flags); + if (data.discord_user.avatar && data.discord_user.avatar.includes("a_")) flags.push("Nitro"); - const activities = data.activities - // Filter only type 0 - .filter(activity => activity.type === 0) - // Filter ignored app ID - .filter(activity => !ignoreAppId.includes(activity.application_id ?? "")); + let userStatus: Record | null = null; + if (data.activities[0] && data.activities[0].type === 4) userStatus = data.activities[0]; - // Take the highest one - activity = Array.isArray(activities) ? activities[0] : activities; + const activities = data.activities + // Filter only type 0 + .filter(activity => activity.type === 0) + // Filter ignored app ID + .filter(activity => !ignoreAppId.includes(activity.application_id ?? "")); - // Calculate height of parent SVG element - const svgHeight = (): string => { - if (hideProfile) return "130"; - if (hideActivity === "true") return "91"; - if (hideActivity === "whenNotUsed" && !activity && !data.listening_to_spotify) return "91"; - if (hideSpotify && data.listening_to_spotify) return "210"; - return "210"; - } + // Take the highest one + activity = Array.isArray(activities) ? activities[0] : activities; - // Calculate height of main div element - const divHeight = (): string => { - if (hideProfile) return "120"; - if (hideActivity === "true") return "81"; - if (hideActivity === "whenNotUsed" && !activity && !data.listening_to_spotify) return "81"; - if (hideSpotify && data.listening_to_spotify) return "200"; - return "200"; - } + // Calculate height of parent SVG element + const svgHeight = (): string => { + if (hideProfile) return "130"; + if (hideActivity === "true") return "91"; + if (hideActivity === "whenNotUsed" && !activity && !data.listening_to_spotify) return "91"; + if (hideSpotify && data.listening_to_spotify) return "210"; + return "210"; + }; - const renderSVG = ` - - -
{props.children}
+ ); + + const renderedSVG = ( + + + - {{ emotion-css }} - - -
- - ${ - hideProfile ? "" : ` -
-
- - ${hideDecoration || !data.discord_user.avatar_decoration_data ? "" : ` - - `} - -
-
-
-

- ${escape(showDisplayName ? data.discord_user.global_name : data.discord_user.username)}${ - !hideDiscrim && !showDisplayName - ? `#${ - data.discord_user.discriminator - }` - : "" - } -

+ }`} + + + + + {!hideProfile ? ( +
+
+ User Avatar - ${hideClan || !data.discord_user.clan?.tag && !data.discord_user.clan?.badge ? "" : ` - - -

${escape(data.discord_user.clan!.tag)}

-
- `} - - ${hideBadges ? "" : flags.map(v => ` - `).join("") - } -
- ${showDisplayName ? - `

- ${escape(data.discord_user.username)} -

` - : `` - } - ${ - userStatus && !hideStatus ? ` -

- ${ - userStatus.emoji?.id ? ` - ` : '' - } - ${ - userStatus.state && userStatus.emoji?.name && !userStatus.emoji.id - ? `${userStatus.emoji.name} ${escape(userStatus.state)}` - : userStatus.state - ? escape(userStatus.state) - : !userStatus.state && userStatus.emoji?.name && !userStatus.emoji.id - ? escape(userStatus.emoji.name) - : '' - } -

` : `` - } -
-
` - } - - ${ - activity ? ` -
-
- ${ - activity.assets?.large_image ? ` - - ` : ` - - `} - ${ - activity.assets?.small_image ? ` - ` : `` - } -
-
-

${escape(activity.name)}

- ${ - activity.details - ? ` -

${escape(activity.details)}

` - : `` - } - ${ - activity.state - ? ` -

${escape(activity.state)}${ - activity.party?.size - ? ` (${activity.party.size[0]} of ${activity.party.size[1]})` - : "" - }

` : `` - } - ${ - activity.timestamps?.start && !hideTimestamp ? ` -

${elapsedTime(new Date(activity.timestamps.start).getTime())} elapsed

` - : `` - } -
-
- ` : `` - } - - ${ - data.listening_to_spotify && !activity && !hideSpotify && data.activities[Object.keys(data.activities).length - 1].type === 2 - ? ` -
- + Avatar Decoration -
-

LISTENING TO SPOTIFY...

-

${escape(data.spotify.song)}

-

By ${escape(data.spotify.artist)}

-
+ + + )} +
+
+
+

+ {showDisplayName && data.discord_user.global_name + ? data.discord_user.global_name + : data.discord_user.username} + + {!hideDiscrim && !showDisplayName ? ( + + #{data.discord_user.discriminator} + + ) : null} +

+ + {hideClan || (!data.discord_user.clan?.tag && !data.discord_user.clan?.badge) ? null : ( + + Clan Badge +

{data.discord_user.clan!.tag}

+
+ )} + + {!!hideBadges + ? null + : flags.map(v => ( + {v} + ))}
- ` : `` - } - ${ - !activity && (!data.listening_to_spotify || hideSpotify) && hideActivity === "false" - ? `
-

- ${escape(idleMessage)} -

-
` : `` - } -
- - - `; + {showDisplayName ? ( +

+ {data.discord_user.username} +

+ ) : null} + {userStatus && !hideStatus ? ( +

+ {userStatus.emoji?.id ? ( + User Status Emoji + ) : null} - let emotion = extractCritical(renderSVG); + {userStatus.state && userStatus.emoji?.name && !userStatus.emoji.id + ? `${userStatus.emoji.name} ${userStatus.state}` + : userStatus.state + ? userStatus.state + : !userStatus.state && userStatus.emoji?.name && !userStatus.emoji.id + ? userStatus.emoji.name + : null} +

+ ) : null} +
+
+ ) : null} - return renderSVG.replace("{{ emotion-css }}", ``) -}; + {activity ? ( +
+
+ {activity.assets?.large_image ? ( + Activity Large Image + ) : ( + Unknown Icon + )} + + {activity.assets?.small_image ? ( + Activity Small Image + ) : null} +
+
+

+ {activity.name} +

+ {activity.details ? ( +

+ {activity.details} +

+ ) : null} + {activity.state ? ( +

+ {activity.state} + {activity.party?.size ? ` (${activity.party.size[0]} of ${activity.party.size[1]})` : null} +

+ ) : null} + {activity.timestamps?.start && !hideTimestamp ? ( +

+ {elapsedTime(new Date(activity.timestamps.start).getTime())} elapsed +

+ ) : null} +
+
+ ) : null} + {data.listening_to_spotify && + !activity && + !hideSpotify && + data.activities[Object.keys(data.activities).length - 1].type === 2 ? ( +
+ { + const album = await encodeBase64(data.spotify.album_art_url); + if (album) return `data:image/png;base64,${album}`; + return "https://lanyard-profile-readme.vercel.app/assets/unknown.png"; + })()} + alt="Album Cover" + style={{ + border: data.spotify.album_art_url ? "border: solid 0.5px #222" : undefined, + filter: !data.spotify.album_art_url ? "invert(100)" : undefined, + width: "80px", + height: "80px", + borderRadius: "10px", + marginRight: "15px", + }} + /> + +
+

+ LISTENING TO SPOTIFY... +

+

+ {data.spotify.song} +

+

+ By {data.spotify.artist} +

+
+
+ ) : null} + {!activity && (!data.listening_to_spotify || hideSpotify) && hideActivity === "false" ? ( +
+

+ {idleMessage} +

+
+ ) : null} + + + + ); + + return renderToStaticMarkup(renderedSVG); +} export default renderCard;