diff --git a/package-lock.json b/package-lock.json index ec21e938f..aae6c97ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,8 @@ "file-saver": "^2.0.5", "formik": "^2.2.9", "framer-motion": "^10.18.0", + "html2canvas": "^1.4.1", + "jspdf": "^2.5.1", "lottie-react": "^2.4.0", "moment": "^2.29.4", "razorpay": "^2.9.3", @@ -4411,6 +4413,12 @@ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" }, + "node_modules/@types/raf": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz", + "integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==", + "optional": true + }, "node_modules/@types/react": { "version": "18.0.27", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.27.tgz", @@ -5028,6 +5036,17 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "node_modules/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } + }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -5179,6 +5198,14 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", + "engines": { + "node": ">= 0.6.0" + } + }, "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -5253,6 +5280,17 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/btoa": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", + "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==", + "bin": { + "btoa": "bin/btoa.js" + }, + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -5303,6 +5341,25 @@ } ] }, + "node_modules/canvg": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.10.tgz", + "integrity": "sha512-qwR2FRNO9NlzTeKIPIKpnTY6fqwuYSequ8Ru8c0YkYU7U0oW+hLUvWadLvAu1Rl72OMNiFhoLu4f8eUjQ7l/+Q==", + "optional": true, + "dependencies": { + "@babel/runtime": "^7.12.5", + "@types/raf": "^3.4.0", + "core-js": "^3.8.3", + "raf": "^3.4.1", + "regenerator-runtime": "^0.13.7", + "rgbcolor": "^1.0.1", + "stackblur-canvas": "^2.0.0", + "svg-pathdata": "^6.0.3" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -5433,6 +5490,17 @@ "toggle-selection": "^1.0.6" } }, + "node_modules/core-js": { + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz", + "integrity": "sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==", + "hasInstallScript": true, + "optional": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, "node_modules/core-js-compat": { "version": "3.33.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.33.0.tgz", @@ -5488,6 +5556,14 @@ "tiny-invariant": "^1.0.6" } }, + "node_modules/css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "dependencies": { + "utrie": "^1.0.2" + } + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -5762,6 +5838,12 @@ "csstype": "^3.0.2" } }, + "node_modules/dompurify": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.5.5.tgz", + "integrity": "sha512-FgbqnEPiv5Vdtwt6Mxl7XSylttCC03cqP5ldNT2z+Kj0nLxPHJH4+1Cyf5Jasxhw93Rl4Oo11qRoUV72fmya2Q==", + "optional": true + }, "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -6629,6 +6711,11 @@ "reusify": "^1.0.4" } }, + "node_modules/fflate": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz", + "integrity": "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==" + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -7185,6 +7272,18 @@ "react-is": "^16.7.0" } }, + "node_modules/html2canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", + "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", + "dependencies": { + "css-line-break": "^2.1.0", + "text-segmentation": "^1.0.3" + }, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -7769,6 +7868,23 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jspdf": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-2.5.1.tgz", + "integrity": "sha512-hXObxz7ZqoyhxET78+XR34Xu2qFGrJJ2I2bE5w4SM8eFaFEkW2xcGRVUss360fYelwRSid/jT078kbNvmoW0QA==", + "dependencies": { + "@babel/runtime": "^7.14.0", + "atob": "^2.1.2", + "btoa": "^1.2.1", + "fflate": "^0.4.8" + }, + "optionalDependencies": { + "canvg": "^3.0.6", + "core-js": "^3.6.0", + "dompurify": "^2.2.0", + "html2canvas": "^1.0.0-rc.5" + } + }, "node_modules/jsprim": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", @@ -8490,6 +8606,15 @@ } ] }, + "node_modules/raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "optional": true, + "dependencies": { + "performance-now": "^2.1.0" + } + }, "node_modules/razorpay": { "version": "2.9.3", "resolved": "https://registry.npmjs.org/razorpay/-/razorpay-2.9.3.tgz", @@ -9142,6 +9267,15 @@ "node": ">=0.10.0" } }, + "node_modules/rgbcolor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz", + "integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==", + "optional": true, + "engines": { + "node": ">= 0.8.15" + } + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -9441,6 +9575,15 @@ "node": ">=0.10.0" } }, + "node_modules/stackblur-canvas": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz", + "integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==", + "optional": true, + "engines": { + "node": ">=0.1.14" + } + }, "node_modules/stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", @@ -9594,6 +9737,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/svg-pathdata": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-6.0.3.tgz", + "integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==", + "optional": true, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/text-segmentation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", + "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", + "dependencies": { + "utrie": "^1.0.2" + } + }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -9991,6 +10151,14 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/utrie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", + "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", + "dependencies": { + "base64-arraybuffer": "^1.0.2" + } + }, "node_modules/uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -13553,6 +13721,12 @@ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz", "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==" }, + "@types/raf": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/@types/raf/-/raf-3.4.3.tgz", + "integrity": "sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==", + "optional": true + }, "@types/react": { "version": "18.0.27", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.27.tgz", @@ -13996,6 +14170,11 @@ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + }, "available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -14121,6 +14300,11 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, + "base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==" + }, "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", @@ -14169,6 +14353,11 @@ "update-browserslist-db": "^1.0.13" } }, + "btoa": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/btoa/-/btoa-1.2.1.tgz", + "integrity": "sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==" + }, "cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", @@ -14196,6 +14385,22 @@ "integrity": "sha512-W7CrtIModMAxobGhz8iXmDfuJiiKg1WADMO/9x7/CLNin5cpSbuBjooyoIUVB5eyCc36QuTVlkVa1iB2S5+/eA==", "dev": true }, + "canvg": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/canvg/-/canvg-3.0.10.tgz", + "integrity": "sha512-qwR2FRNO9NlzTeKIPIKpnTY6fqwuYSequ8Ru8c0YkYU7U0oW+hLUvWadLvAu1Rl72OMNiFhoLu4f8eUjQ7l/+Q==", + "optional": true, + "requires": { + "@babel/runtime": "^7.12.5", + "@types/raf": "^3.4.0", + "core-js": "^3.8.3", + "raf": "^3.4.1", + "regenerator-runtime": "^0.13.7", + "rgbcolor": "^1.0.1", + "stackblur-canvas": "^2.0.0", + "svg-pathdata": "^6.0.3" + } + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -14303,6 +14508,12 @@ "toggle-selection": "^1.0.6" } }, + "core-js": { + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz", + "integrity": "sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==", + "optional": true + }, "core-js-compat": { "version": "3.33.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.33.0.tgz", @@ -14348,6 +14559,14 @@ "tiny-invariant": "^1.0.6" } }, + "css-line-break": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz", + "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==", + "requires": { + "utrie": "^1.0.2" + } + }, "cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -14545,6 +14764,12 @@ "csstype": "^3.0.2" } }, + "dompurify": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.5.5.tgz", + "integrity": "sha512-FgbqnEPiv5Vdtwt6Mxl7XSylttCC03cqP5ldNT2z+Kj0nLxPHJH4+1Cyf5Jasxhw93Rl4Oo11qRoUV72fmya2Q==", + "optional": true + }, "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", @@ -15214,6 +15439,11 @@ "reusify": "^1.0.4" } }, + "fflate": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz", + "integrity": "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==" + }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -15612,6 +15842,15 @@ "react-is": "^16.7.0" } }, + "html2canvas": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz", + "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==", + "requires": { + "css-line-break": "^2.1.0", + "text-segmentation": "^1.0.3" + } + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -16031,6 +16270,21 @@ "universalify": "^2.0.0" } }, + "jspdf": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jspdf/-/jspdf-2.5.1.tgz", + "integrity": "sha512-hXObxz7ZqoyhxET78+XR34Xu2qFGrJJ2I2bE5w4SM8eFaFEkW2xcGRVUss360fYelwRSid/jT078kbNvmoW0QA==", + "requires": { + "@babel/runtime": "^7.14.0", + "atob": "^2.1.2", + "btoa": "^1.2.1", + "canvg": "^3.0.6", + "core-js": "^3.6.0", + "dompurify": "^2.2.0", + "fflate": "^0.4.8", + "html2canvas": "^1.0.0-rc.5" + } + }, "jsprim": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", @@ -16548,6 +16802,15 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, + "raf": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz", + "integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==", + "optional": true, + "requires": { + "performance-now": "^2.1.0" + } + }, "razorpay": { "version": "2.9.3", "resolved": "https://registry.npmjs.org/razorpay/-/razorpay-2.9.3.tgz", @@ -17008,6 +17271,12 @@ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, + "rgbcolor": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rgbcolor/-/rgbcolor-1.0.1.tgz", + "integrity": "sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==", + "optional": true + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -17200,6 +17469,12 @@ "tweetnacl": "~0.14.0" } }, + "stackblur-canvas": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz", + "integrity": "sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==", + "optional": true + }, "stealthy-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", @@ -17311,6 +17586,20 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" }, + "svg-pathdata": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/svg-pathdata/-/svg-pathdata-6.0.3.tgz", + "integrity": "sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==", + "optional": true + }, + "text-segmentation": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz", + "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==", + "requires": { + "utrie": "^1.0.2" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -17588,6 +17877,14 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "utrie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz", + "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==", + "requires": { + "base64-arraybuffer": "^1.0.2" + } + }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", diff --git a/package.json b/package.json index b57650137..cc038e2c4 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ "file-saver": "^2.0.5", "formik": "^2.2.9", "framer-motion": "^10.18.0", + "html2canvas": "^1.4.1", + "jspdf": "^2.5.1", "lottie-react": "^2.4.0", "moment": "^2.29.4", "razorpay": "^2.9.3", diff --git a/src/modules/Public/Donation/Donation.tsx b/src/modules/Public/Donation/Donation.tsx index 06f5b0dd0..58c8864a4 100644 --- a/src/modules/Public/Donation/Donation.tsx +++ b/src/modules/Public/Donation/Donation.tsx @@ -42,6 +42,8 @@ const Donation = () => { mobile: mobile, pan: pan }); + //save data to local storage + localStorage.setItem("donationData", JSON.stringify({ amount, name, company, email, mobile, pan }));// saving the data because the server does not return all the required data } else { submitForm({ amount: amount, @@ -50,6 +52,8 @@ const Donation = () => { mobile: mobile, pan: pan }); + //save data to local storage + localStorage.setItem("donationData", JSON.stringify({ amount, name, email, mobile, pan })); } }; diff --git a/src/modules/Public/Donation/assets/receipt/.svg b/src/modules/Public/Donation/assets/receipt/.svg new file mode 100644 index 000000000..b0f318b28 --- /dev/null +++ b/src/modules/Public/Donation/assets/receipt/.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/modules/Public/Donation/assets/receipt/group-75.svg b/src/modules/Public/Donation/assets/receipt/group-75.svg new file mode 100644 index 000000000..22ebbce09 --- /dev/null +++ b/src/modules/Public/Donation/assets/receipt/group-75.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/modules/Public/Donation/assets/receipt/learn.svg b/src/modules/Public/Donation/assets/receipt/learn.svg new file mode 100644 index 000000000..ab954c959 --- /dev/null +++ b/src/modules/Public/Donation/assets/receipt/learn.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/modules/Public/Donation/assets/receipt/logo.svg b/src/modules/Public/Donation/assets/receipt/logo.svg new file mode 100644 index 000000000..db38ae0d5 --- /dev/null +++ b/src/modules/Public/Donation/assets/receipt/logo.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/modules/Public/Donation/assets/receipt/vector.svg b/src/modules/Public/Donation/assets/receipt/vector.svg new file mode 100644 index 000000000..6c68578a2 --- /dev/null +++ b/src/modules/Public/Donation/assets/receipt/vector.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/modules/Public/Donation/assets/receipt/watermark.svg b/src/modules/Public/Donation/assets/receipt/watermark.svg new file mode 100644 index 000000000..03fdf5c41 --- /dev/null +++ b/src/modules/Public/Donation/assets/receipt/watermark.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/modules/Public/Donation/pages/DonationSuccess.tsx b/src/modules/Public/Donation/pages/DonationSuccess.tsx index d26d1bd67..6d1ed5b2f 100644 --- a/src/modules/Public/Donation/pages/DonationSuccess.tsx +++ b/src/modules/Public/Donation/pages/DonationSuccess.tsx @@ -1,12 +1,17 @@ import { Link } from "react-router-dom"; -import { useEffect } from "react"; +import { useEffect,useState,useRef } from "react"; import Footer from "../components/Footer"; import Navbar from "../components/Navbar"; import styles from "./DonationSuccess.module.css"; import NotFound from "../../../../components/NotFound"; +import Receipt from "./receipt/Receipt"; + +import jsPDF from "jspdf"; +import html2canvas from "html2canvas"; const DonationSuccess = () => { - const pdfData = localStorage.getItem("pdfData"); + const pdfElement = useRef(null!); + const pdfData = localStorage.getItem("pdfData") as string; const base64toBlob = (base64data: any) => { const byteString = atob(base64data.split(",")[1]); @@ -20,26 +25,45 @@ const DonationSuccess = () => { }; const downloadReceipt = () => { - const base64data = localStorage.getItem("pdfData"); + // const base64data = localStorage.getItem("pdfData"); - if (base64data) { - const pdfBlob = base64toBlob(base64data); - const pdfUrl = URL.createObjectURL(pdfBlob); - const link = document.createElement("a"); - link.href = pdfUrl; - link.download = "downloaded-file.pdf"; + // if (base64data) { + // const pdfBlob = base64toBlob(base64data); + // const pdfUrl = URL.createObjectURL(pdfBlob); + // const link = document.createElement("a"); + // link.href = pdfUrl; + // link.download = "downloaded-file.pdf"; - document.body.appendChild(link); - link.click(); + // document.body.appendChild(link); + // link.click(); - document.body.removeChild(link); - } else { - console.error("No PDF data found in localStorage."); - } + // document.body.removeChild(link); + // } else { + // console.error("No PDF data found in localStorage."); + // } + + //to handel the pdf data in the forndend + html2canvas(pdfElement.current).then((canvas) => { + const imgData = canvas.toDataURL("image/png"); + const pdf = new jsPDF("p", "mm", "a4"); + pdf.addImage(imgData, "PNG", 0, 0, 210, 297); + pdf.save("Receipt.pdf"); + + //to download the png + // const link = document.createElement('a'); + // link.href = imgData; // Set the href to the PNG data URL + // link.download = 'Receipt.png'; // Set the desired filename for the download + + // // Append the link to the document, click it to trigger the download, and then remove it + // document.body.appendChild(link); + // link.click(); + // document.body.removeChild(link); + }); }; const handleUnload = () => { localStorage.removeItem("pdfData"); + localStorage.removeItem('donationData'); }; useEffect(() => { @@ -50,54 +74,62 @@ const DonationSuccess = () => { }, []); return pdfData ? ( -
- - -
-
- textured background -
-
-
- - Thank You!{" "} - - We appreciate your support -
-

- Your donation was successful. A confirmation email has been - sent. -

+ <> +
+
+
+ -
-
-
-

Success!

-

- Thank you for your donation. Your support means a - lot to us. -

+
+
+ textured background
-
- - - - +
+
+ + Thank You!{" "} + + We appreciate your support
+

+ Your donation was successful. A confirmation email has been + sent. +

-
-
-
+
+
+
+

Success!

+

+ Thank you for your donation. Your support means a + lot to us. +

+
+
+ + + + +
+
+
+ +
+
+ ) : (
diff --git a/src/modules/Public/Donation/pages/receipt/Receipt.module.css b/src/modules/Public/Donation/pages/receipt/Receipt.module.css new file mode 100644 index 000000000..426f72b4f --- /dev/null +++ b/src/modules/Public/Donation/pages/receipt/Receipt.module.css @@ -0,0 +1,296 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); +.receiptContainer { + display: flex; + justify-content: center; + padding: 20px; + background-color: #f4f4f4; +} + +.recipt { + background-color: #ffffff; + padding: 20px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + width: 800px; + font-family: 'Arial', sans-serif; + font-size: 14px; + color: #333333; +} + +.vector-icon { + display: none; /* Assuming this is not visible in the image provided */ +} + +.frame-parent { + display: flex; + flex-direction: column; + gap: 3rem; +} + +.frame-group { + display: flex; + flex-direction: column; + gap: 2rem; +} + +.frame-container { + display: flex; + justify-content: space-between; + align-items: flex-start; +} + +.frame-wrapper { + display: flex; + align-items: center; +} + +.frame-div { + display: flex; + flex-direction: column; +} + +.learn-wrapper { + margin-bottom: 10px; +} + +.learn-icon { + width: 100px; + height: auto; +} + +.contribution-sum { + font-size: 20px; + font-weight: bold; +} + +.frame-parent1 { + display: flex; + flex-direction: column; + justify-content: start; + align-items: center; + margin-top: 10px; +} + +.rahul-nath-wrapper { + margin-bottom: 5px; +} + +.rahul-nath { + font-weight: bold; + font-size: 16px; +} + +.rrahu { + font-size: 14px; + color: #555555; +} + +.may20240649-wrapper { + display: flex; + align-items: center; +} + +.may20240649 { + font-size: 14px; + color: #999999; +} + +.background-parent { + display: flex; + flex-direction: row; + align-items: center; + margin-bottom: 20px; + background-color: #f4faff; + padding: 15px; + border-radius: 8px; +} + +.background { + display: none; +} + +.frame-parent3 { + display: flex; + flex-direction: column; + gap: 5px; +} + +.beneficiaryfund-wrapper { + font-size: 14px; + font-weight: bold; +} + +.beneficiaryfund { + font-size: 14px; + font-weight: bold; +} + +.frame-parent4 { + display: flex; + flex-direction: column; + gap: 5px; +} + +.swami-vivekanand-wrapper { + font-size: 18px; + font-weight: bold; +} + +.swami-vivekanand { + font-size: 18px; + font-weight: bold; +} + +.b-207pacific-es { + font-size: 12px; + color: #555555; +} + +.wrapper { + margin-left: auto; +} + +.icon { + width: 80px; + height: auto; + padding: 1.5rem 0rem; +} + +.frame-parent5 { + display: flex; + flex-direction: column; + gap: 20px; + position: relative; +} + +.frame-parent6 { + display: flex; + flex-direction: column; + gap: 10px; +} + +.background-group { + display: flex; + flex-direction: column; + gap: 10px; +} + +.background1 { + display: none; +} + +.detailsofcontrib-wrapper { + font-size: 14px; + font-weight: bold; + margin-bottom: 10px; +} + +.detailsofcontrib { + font-size: 14px; + font-weight: bold; +} + +.frame-child { + /* width: 50%; */ + height: auto; + position: absolute; + /*center the elemene*/ + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + +} + +.background-container { + display: flex; + flex-direction: column; + gap: 10px; +} + +.contribution-amo-parent, +.mode-of-payment-parent, +.paytm-order-id-parent, +.amount-paid-parent { + padding: 0.5rem 0rem; + display: flex; + justify-content: space-between; + /* background: #000; */ + border-bottom: 2px solid #C0D7F9; +} + +.contribution-amo, +.mode-of-payment, +.paytm-order-id, +.amount-paid { + font-size: 14px; + font-weight: bold; +} + +.div, +.div1, +.div2, +.upi { + font-size: 14px; +} + +.background-parent1 { + display: flex; + flex-direction: column; + gap: 10px; + background-color: #f4faff; + padding: 15px; + border-radius: 8px; +} + +.background6 { + display: none; +} + +.detailsofcontrib1 { + font-size: 14px; + font-weight: bold; +} + +.rahul-parent { + display: flex; + flex-direction: column; + gap: 5px; +} + +.rahul { + font-size: 14px; + color: #333333; +} + +.pankollam { + font-size: 14px; + color: #555555; +} + +.frame-section { + margin-top: 20px; +} + +.vector-parent { + font-size: 12px; + color: #555555; +} + +.the-contribution { + padding: 5rem 0rem; + padding-bottom: 2rem; + font-size: 14px; + font-weight: bold; + color: #555555; +} + +.all-donations-are-voluntary-a-wrapper { + font-size: 16px; + color: #999999; + margin-top: 20px; +} + +.all-donations-are { + font-size: 12px; + color: #999999; +} diff --git a/src/modules/Public/Donation/pages/receipt/Receipt.tsx b/src/modules/Public/Donation/pages/receipt/Receipt.tsx new file mode 100644 index 000000000..ed4df6fbd --- /dev/null +++ b/src/modules/Public/Donation/pages/receipt/Receipt.tsx @@ -0,0 +1,201 @@ +import { useState,useEffect } from 'react' +import logo from '../../assets/receipt/logo.svg' +import mulearn from '../../assets/receipt/learn.svg' +import vector from '../../assets/receipt/vector.svg' +import bigLogo from '../../assets/receipt/group-75.svg' +import styles from './Receipt.module.css'; + +interface donation_data { + amount: number, + name: string, + company: string|null, + email: string, + mobile: number, + pan: string +} +interface pdf_data { + Amount: number, + Name: string, + Company: string|null, + Email: string, + Payment_method: string, + payment_id:string +} +const defaultPdfData: pdf_data = { + Amount: 0, + Name: '', + Email: '', + Company: null, + Payment_method: '', + payment_id:'' +}; + +const defaultDonationData: donation_data = { + amount: 0, + name: '', + company: null, + email: '', + mobile: 0, + pan: '', +}; + +function Receipt() { + + const [pdfData, setpdfData] = useState(defaultPdfData) + const [donationData, setdonationData] = useState(defaultDonationData) + + const formatDate = (date:any) => { + const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + const day = date.getDate(); + const month = months[date.getMonth()]; + const year = date.getFullYear(); + let hours = date.getHours(); + const minutes = date.getMinutes(); + const ampm = hours >= 12 ? 'PM' : 'AM'; + hours = hours % 12; + hours = hours ? hours : 12; + const strMinutes = minutes < 10 ? '0'+minutes : minutes; + + return `${day}${month},${year},${hours}:${strMinutes}${ampm}`; + } + + + useEffect(() => { + const data = localStorage.getItem("pdfData") as string; + const d_data = localStorage.getItem("donationData") as string; + const setData = async () => { + if(data && d_data){ + let success_data = await JSON.parse(data) + let donation_data = await JSON.parse(d_data) + setdonationData(donation_data) + setpdfData(success_data.response) + } + } + setData() + },[]) + return ( +
+
+ + +
+
+
+
+
+
+ +
+
Contribution Receipt
+
+
+
+
+
+ Name:{pdfData.Name} +
+
+91 {donationData.mobile}
{pdfData.Email}
+
+
+
+ { + //to print the date and time in this format 11May,2024,06:49PM + formatDate(new Date()) + } +
+
+
+
+
+
+
+
+
BENEFICIARY INFO
+
+
+
+

µLearn Foundation

+
+
+ Gtech Lobby Area Technopark Trivandrum, + Kerala, India +
+
+
+
+ +
+
+
+
+
+
+
+
+ DETAILS OF CONTRIBUTION +
+
+ + +
+
+
Contribution Amount
+
₹{pdfData.Amount}
+
+
+
Mode of Payment
+
{pdfData.Payment_method}
+
+
+
Razorpay Order ID
+
{pdfData.payment_id}
+
+
+
Amount Paid
+
₹{pdfData.Amount}
+
+
+
+
+
+
DETAILS OF CONTRIBUTOR
+
+ Name:{pdfData.Name} +
PAN:{donationData.pan}
+
+
+
+
+
+
+
+ The contribution made to is eligible for µLearn claiming exemptions + under Section 80(G)of the Income Tax Act, 1961 vide Registration + No.- ############## by the Office of the Income Tax + Department(Dehradun)valid from assessment year 2022-23 till + 2026-27. +
+
+
+ +
+
+
+
+ ); +} + +export default Receipt; \ No newline at end of file diff --git a/src/modules/Public/Donation/services/api.ts b/src/modules/Public/Donation/services/api.ts index aa967f9ae..1ad7d7c1a 100644 --- a/src/modules/Public/Donation/services/api.ts +++ b/src/modules/Public/Donation/services/api.ts @@ -34,7 +34,8 @@ export const submitForm = async ({ name, company, email, - mobile + mobile, + pan }) .then(response => { const paymentId: string = response.data.response.id; @@ -49,8 +50,7 @@ export const submitForm = async ({ image: "/assets/µLearn.png", order_id: paymentId, handler: function (response: any) { - console.log(response); - + console.log(paymentAmount,this.currency) publicGateway .post(donationRoutes.verify, { razorpay_order_id: response.razorpay_order_id, @@ -59,6 +59,7 @@ export const submitForm = async ({ }) .then(res => { console.log(res?.data); + console.log("type",typeof(res?.data)); toast.success( res?.data?.message?.general[0] || "Payment Successful" @@ -66,11 +67,12 @@ export const submitForm = async ({ // Assuming response.data contains the PDF data const pdfData = res?.data; + localStorage.setItem("pdfData", JSON.stringify(pdfData)); // Create a new blob from the PDF data - const pdfBlob = new Blob([pdfData], { - type: "application/pdf" - }); + // const pdfBlob = new Blob([pdfData], { + // type: "application/pdf" + // }); // // Create a URL for the blob // const pdfUrl = URL.createObjectURL(pdfBlob); @@ -86,21 +88,27 @@ export const submitForm = async ({ // window.location.href = "/donation/success"; // Convert blob data to a base64 string - const reader = new FileReader(); - reader.onloadend = function () { - const base64data = reader.result; - if (base64data) { - localStorage.setItem( - "pdfData", - base64data as string - ); + // const reader = new FileReader(); + // reader.onloadend = function () { + // const base64data = reader.result; + // if (base64data) { + // localStorage.setItem( + // "pdfData", + // base64data as string + // ); - window.location.href = "/donation/success"; - } else { - console.error("Failed to read PDF data."); - } - }; - reader.readAsDataURL(pdfBlob); + // window.location.href = "/donation/success"; + // } else { + // console.error("Failed to read PDF data."); + // } + // }; + // reader.readAsDataURL(pdfBlob); + const storeData = localStorage.getItem("pdfData"); + if (storeData) { + window.location.href = "/donation/success"; + } else { + console.error("Failed to read PDF data."); + } }) .catch(error => { console.log(error); diff --git a/src/modules/Public/TrivialIdeas/modules/trivial.module.css b/src/modules/Public/TrivialIdeas/modules/trivial.module.css index a6207addc..46a1b83ef 100644 --- a/src/modules/Public/TrivialIdeas/modules/trivial.module.css +++ b/src/modules/Public/TrivialIdeas/modules/trivial.module.css @@ -300,7 +300,7 @@ div[style*="padding: 0rem 0"] { } @media (max-width: 425px) { .content p{ - font-size: 24px; + font-size: 8vw; } .content img{ width: 50px; diff --git a/src/services/urls.ts b/src/services/urls.ts index 56c1a14f1..b8571ebcb 100644 --- a/src/services/urls.ts +++ b/src/services/urls.ts @@ -91,7 +91,7 @@ export const dashboardRoutes = { getStudentLeaderBoard: "/api/v1/leaderboard/students/", getIgDetails: "/api/v1/dashboard/profile/ig-edit/", getSocials: "/api/v1/dashboard/profile/socials/", - postProfileImage: "api/v1/dashboard/user/profile/update/", + postProfileImage: "/api/v1/dashboard/user/profile/update/", zonalStudentDetails: "/api/v1/dashboard/zonal/student-details/", zonalStudentData: "/api/v1/dashboard/zonal/student-details/csv/",