Skip to content

🔥 The free & Open Source DocuSign alternative

refactor: remove mf-cra & change routes

prafull-opensignlabsca98b5a21054
diff --git a/apps/OpenSign/moduleFederation.config.js b/apps/OpenSign/moduleFederation.config.js
deleted file mode 100644
index 9ba314cd1..000000000
--- a/apps/OpenSign/moduleFederation.config.js
+++ /dev/null
@@ -1,25 +0,0 @@
-const { dependencies } = require("./package.json");
-
-module.exports = {
- name: "shell_app", // change me
- filename: "remoteEntry.js",
- exposes: {},
- remotes: {},
- shared: {
- ...dependencies,
- react: {
- singleton: true,
- import: "react", // fallback is also react
- shareScope: "default",
- requiredVersion: dependencies.react
- },
- "react-dom": {
- singleton: true,
- requiredVersion: dependencies["react-dom"]
- },
- "react-router-dom": {
- singleton: true,
- requiredVersion: dependencies["react-router-dom"]
- }
- }
-};
diff --git a/apps/OpenSign/package-lock.json b/apps/OpenSign/package-lock.json
index d72a03ae5..188907a75 100644
--- a/apps/OpenSign/package-lock.json
+++ b/apps/OpenSign/package-lock.json
@@ -8,34 +8,45 @@
"name": "open_sign",
"version": "0.1.0",
"dependencies": {
+ "@radix-ui/themes": "^2.0.3",
+ "@react-pdf/renderer": "^3.3.8",
"@reduxjs/toolkit": "^1.9.7",
"axios": "^1.6.0",
"daisyui": "^3.9.2",
"file-saver": "^2.0.5",
"html-react-parser": "^4.2.2",
- "json-rules-engine-simplified": "^0.1.17",
"jwt-decode": "^4.0.0",
- "mf-cra": "^0.0.5",
"moment": "^2.29.4",
"parse": "^4.3.1",
+ "pdf-lib": "^1.17.1",
+ "print-js": "^1.6.0",
+ "radix-ui": "^1.0.1",
"react": "^18.2.0",
- "react-bootstrap": "^2.9.0",
+ "react-bootstrap": "^2.10.1",
+ "react-datepicker": "^6.2.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dnd-multi-backend": "^8.0.3",
"react-dnd-touch-backend": "^16.0.1",
"react-dom": "^18.2.0",
"react-drag-listview": "^2.0.0",
+ "react-draggable": "^4.4.6",
"react-gtm-module": "^2.0.11",
"react-helmet": "^6.1.0",
+ "react-konva": "^18.2.10",
"react-modal": "^3.16.1",
+ "react-pdf": "^7.7.1",
"react-redux": "^8.1.3",
+ "react-rnd": "^10.4.1",
"react-router-dom": "^6.16.0",
"react-scripts": "5.0.1",
+ "react-scrollbars-custom": "^4.1.1",
"react-select": "^5.7.7",
+ "react-signature-canvas": "^1.0.6",
"reactour": "^1.19.2",
"redux": "^4.2.1",
"redux-thunk": "^2.4.2",
+ "regex-parser": "^2.3.0",
"serve": "^14.2.1",
"styled-components": "^4.4.1",
"web-vitals": "^2.1.4"
@@ -2927,14 +2938,50 @@
}
},
"node_modules/@floating-ui/dom": {
- "version": "1.5.3",
- "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz",
- "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==",
+ "version": "1.6.3",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.3.tgz",
+ "integrity": "sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==",
"dependencies": {
- "@floating-ui/core": "^1.4.2",
- "@floating-ui/utils": "^0.1.3"
+ "@floating-ui/core": "^1.0.0",
+ "@floating-ui/utils": "^0.2.0"
+ }
+ },
+ "node_modules/@floating-ui/dom/node_modules/@floating-ui/utils": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz",
+ "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q=="
+ },
+ "node_modules/@floating-ui/react": {
+ "version": "0.26.9",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.26.9.tgz",
+ "integrity": "sha512-p86wynZJVEkEq2BBjY/8p2g3biQ6TlgT4o/3KgFKyTWoJLU1GZ8wpctwRqtkEl2tseYA+kw7dBAIDFcednfI5w==",
+ "dependencies": {
+ "@floating-ui/react-dom": "^2.0.8",
+ "@floating-ui/utils": "^0.2.1",
+ "tabbable": "^6.0.1"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@floating-ui/react-dom": {
+ "version": "2.0.8",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.8.tgz",
+ "integrity": "sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==",
+ "dependencies": {
+ "@floating-ui/dom": "^1.6.1"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
}
},
+ "node_modules/@floating-ui/react/node_modules/@floating-ui/utils": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz",
+ "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q=="
+ },
"node_modules/@floating-ui/utils": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz",
@@ -3695,6 +3742,26 @@
"resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz",
"integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A=="
},
+ "node_modules/@mapbox/node-pre-gyp": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz",
+ "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==",
+ "optional": true,
+ "dependencies": {
+ "detect-libc": "^2.0.0",
+ "https-proxy-agent": "^5.0.0",
+ "make-dir": "^3.1.0",
+ "node-fetch": "^2.6.7",
+ "nopt": "^5.0.0",
+ "npmlog": "^5.0.1",
+ "rimraf": "^3.0.2",
+ "semver": "^7.3.5",
+ "tar": "^6.1.11"
+ },
+ "bin": {
+ "node-pre-gyp": "bin/node-pre-gyp"
+ }
+ },
"node_modules/@nicolo-ribaudo/eslint-scope-5-internals": {
"version": "5.1.1-v1",
"resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz",
@@ -3743,75 +3810,1532 @@
"node": ">= 8"
}
},
- "node_modules/@nodelib/fs.walk": {
- "version": "1.2.8",
- "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
- "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "node_modules/@nodelib/fs.walk": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
+ "dependencies": {
+ "@nodelib/fs.scandir": "2.1.5",
+ "fastq": "^1.6.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/@pdf-lib/standard-fonts": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/@pdf-lib/standard-fonts/-/standard-fonts-1.0.0.tgz",
+ "integrity": "sha512-hU30BK9IUN/su0Mn9VdlVKsWBS6GyhVfqjwl1FjZN4TxP6cCw0jP2w7V3Hf5uX7M0AZJ16vey9yE0ny7Sa59ZA==",
+ "dependencies": {
+ "pako": "^1.0.6"
+ }
+ },
+ "node_modules/@pdf-lib/upng": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@pdf-lib/upng/-/upng-1.0.1.tgz",
+ "integrity": "sha512-dQK2FUMQtowVP00mtIksrlZhdFXQZPC+taih1q4CvPZ5vqdxR/LKBaFg0oAfzd1GlHZXXSPdQfzQnt+ViGvEIQ==",
+ "dependencies": {
+ "pako": "^1.0.10"
+ }
+ },
+ "node_modules/@pmmmwh/react-refresh-webpack-plugin": {
+ "version": "0.5.11",
+ "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.11.tgz",
+ "integrity": "sha512-7j/6vdTym0+qZ6u4XbSAxrWBGYSdCfTzySkj7WAFgDLmSyWlOrWvpyzxlFh5jtw9dn0oL/jtW+06XfFiisN3JQ==",
+ "dependencies": {
+ "ansi-html-community": "^0.0.8",
+ "common-path-prefix": "^3.0.0",
+ "core-js-pure": "^3.23.3",
+ "error-stack-parser": "^2.0.6",
+ "find-up": "^5.0.0",
+ "html-entities": "^2.1.0",
+ "loader-utils": "^2.0.4",
+ "schema-utils": "^3.0.0",
+ "source-map": "^0.7.3"
+ },
+ "engines": {
+ "node": ">= 10.13"
+ },
+ "peerDependencies": {
+ "@types/webpack": "4.x || 5.x",
+ "react-refresh": ">=0.10.0 <1.0.0",
+ "sockjs-client": "^1.4.0",
+ "type-fest": ">=0.17.0 <5.0.0",
+ "webpack": ">=4.43.0 <6.0.0",
+ "webpack-dev-server": "3.x || 4.x",
+ "webpack-hot-middleware": "2.x",
+ "webpack-plugin-serve": "0.x || 1.x"
+ },
+ "peerDependenciesMeta": {
+ "@types/webpack": {
+ "optional": true
+ },
+ "sockjs-client": {
+ "optional": true
+ },
+ "type-fest": {
+ "optional": true
+ },
+ "webpack-dev-server": {
+ "optional": true
+ },
+ "webpack-hot-middleware": {
+ "optional": true
+ },
+ "webpack-plugin-serve": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@popperjs/core": {
+ "version": "2.11.8",
+ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
+ "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/popperjs"
+ }
+ },
+ "node_modules/@radix-ui/colors": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/colors/-/colors-3.0.0.tgz",
+ "integrity": "sha512-FUOsGBkHrYJwCSEtWRCIfQbZG7q1e6DgxCIOe1SUQzDe/7rXXeA47s8yCn6fuTNQAj1Zq4oTFi9Yjp3wzElcxg=="
+ },
+ "node_modules/@radix-ui/number": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/number/-/number-1.0.1.tgz",
+ "integrity": "sha512-T5gIdVO2mmPW3NNhjNgEP3cqMXjXL9UbO0BzWcXfvdBs+BohbQxvd/K5hSVKmn9/lbTdsQVKbUcP5WLCwvUbBg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ }
+ },
+ "node_modules/@radix-ui/primitive": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.0.1.tgz",
+ "integrity": "sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ }
+ },
+ "node_modules/@radix-ui/react-accessible-icon": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.0.3.tgz",
+ "integrity": "sha512-duVGKeWPSUILr/MdlPxV+GeULTc2rS1aihGdQ3N2qCUPMgxYLxvAsHJM3mCVLF8d5eK+ympmB22mb1F3a5biNw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-visually-hidden": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-accordion": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-accordion/-/react-accordion-1.1.2.tgz",
+ "integrity": "sha512-fDG7jcoNKVjSK6yfmuAs0EnPDro0WMXIhMtXdTBWqEioVW206ku+4Lw07e+13lUkFkpoEQ2PdeMIAGpdqEAmDg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-collapsible": "1.0.3",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-alert-dialog": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.0.5.tgz",
+ "integrity": "sha512-OrVIOcZL0tl6xibeuGt5/+UxoT2N27KCFOPjFyfXMnchxSHZ/OW7cCX2nGlIYJrbHK/fczPcFzAwvNBB6XBNMA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-dialog": "1.0.5",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-slot": "1.0.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-arrow": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.0.3.tgz",
+ "integrity": "sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-aspect-ratio": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.0.3.tgz",
+ "integrity": "sha512-fXR5kbMan9oQqMuacfzlGG/SQMcmMlZ4wrvpckv8SgUulD0MMpspxJrxg/Gp/ISV3JfV1AeSWTYK9GvxA4ySwA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-avatar": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.0.4.tgz",
+ "integrity": "sha512-kVK2K7ZD3wwj3qhle0ElXhOjbezIgyl2hVvgwfIdexL3rN6zJmy5AqqIf+D31lxVppdzV8CjAfZ6PklkmInZLw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-checkbox": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.0.4.tgz",
+ "integrity": "sha512-CBuGQa52aAYnADZVt/KBQzXrwx6TqnlwtcIPGtVt5JkkzQwMOLJjPukimhfKEr4GQNd43C+djUh5Ikopj8pSLg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "@radix-ui/react-use-previous": "1.0.1",
+ "@radix-ui/react-use-size": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-collapsible": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.0.3.tgz",
+ "integrity": "sha512-UBmVDkmR6IvDsloHVN+3rtx4Mi5TFvylYXpluuv0f37dtaz3H99bp8No0LGXRigVpl3UAT4l9j6bIchh42S/Gg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-collection": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.0.3.tgz",
+ "integrity": "sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-slot": "1.0.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-compose-refs": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.1.tgz",
+ "integrity": "sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-context": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.0.1.tgz",
+ "integrity": "sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-context-menu": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-context-menu/-/react-context-menu-2.1.5.tgz",
+ "integrity": "sha512-R5XaDj06Xul1KGb+WP8qiOh7tKJNz2durpLBXAGZjSVtctcRFCuEvy2gtMwRJGePwQQE5nV77gs4FwRi8T+r2g==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-menu": "2.0.6",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-dialog": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.0.5.tgz",
+ "integrity": "sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.5",
+ "@radix-ui/react-focus-guards": "1.0.1",
+ "@radix-ui/react-focus-scope": "1.0.4",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-portal": "1.0.4",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-slot": "1.0.2",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "aria-hidden": "^1.1.1",
+ "react-remove-scroll": "2.5.5"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-direction": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.0.1.tgz",
+ "integrity": "sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-dismissable-layer": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz",
+ "integrity": "sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-escape-keydown": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-dropdown-menu": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.0.6.tgz",
+ "integrity": "sha512-i6TuFOoWmLWq+M/eCLGd/bQ2HfAX1RJgvrBQ6AQLmzfvsLdefxbWu8G9zczcPFfcSPehz9GcpF6K9QYreFV8hA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-menu": "2.0.6",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-focus-guards": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.0.1.tgz",
+ "integrity": "sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-focus-scope": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.4.tgz",
+ "integrity": "sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-form": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-form/-/react-form-0.0.3.tgz",
+ "integrity": "sha512-kgE+Z/haV6fxE5WqIXj05KkaXa3OkZASoTDy25yX2EIp/x0c54rOH/vFr5nOZTg7n7T1z8bSyXmiVIFP9bbhPQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-label": "2.0.2",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-hover-card": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-hover-card/-/react-hover-card-1.0.7.tgz",
+ "integrity": "sha512-OcUN2FU0YpmajD/qkph3XzMcK/NmSk9hGWnjV68p6QiZMgILugusgQwnLSDs3oFSJYGKf3Y49zgFedhGh04k9A==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.5",
+ "@radix-ui/react-popper": "1.1.3",
+ "@radix-ui/react-portal": "1.0.4",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-id": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.0.1.tgz",
+ "integrity": "sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-label": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.0.2.tgz",
+ "integrity": "sha512-N5ehvlM7qoTLx7nWPodsPYPgMzA5WM8zZChQg8nyFJKnDO5WHdba1vv5/H6IO5LtJMfD2Q3wh1qHFGNtK0w3bQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-menu": {
+ "version": "2.0.6",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.0.6.tgz",
+ "integrity": "sha512-BVkFLS+bUC8HcImkRKPSiVumA1VPOOEC5WBMiT+QAVsPzW1FJzI9KnqgGxVDPBcql5xXrHkD3JOVoXWEXD8SYA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.5",
+ "@radix-ui/react-focus-guards": "1.0.1",
+ "@radix-ui/react-focus-scope": "1.0.4",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-popper": "1.1.3",
+ "@radix-ui/react-portal": "1.0.4",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-roving-focus": "1.0.4",
+ "@radix-ui/react-slot": "1.0.2",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "aria-hidden": "^1.1.1",
+ "react-remove-scroll": "2.5.5"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-navigation-menu": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-navigation-menu/-/react-navigation-menu-1.1.4.tgz",
+ "integrity": "sha512-Cc+seCS3PmWmjI51ufGG7zp1cAAIRqHVw7C9LOA2TZ+R4hG6rDvHcTqIsEEFLmZO3zNVH72jOOE7kKNy8W+RtA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.5",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1",
+ "@radix-ui/react-use-previous": "1.0.1",
+ "@radix-ui/react-visually-hidden": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-popover": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.0.7.tgz",
+ "integrity": "sha512-shtvVnlsxT6faMnK/a7n0wptwBD23xc1Z5mdrtKLwVEfsEMXodS0r5s0/g5P0hX//EKYZS2sxUjqfzlg52ZSnQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.5",
+ "@radix-ui/react-focus-guards": "1.0.1",
+ "@radix-ui/react-focus-scope": "1.0.4",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-popper": "1.1.3",
+ "@radix-ui/react-portal": "1.0.4",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-slot": "1.0.2",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "aria-hidden": "^1.1.1",
+ "react-remove-scroll": "2.5.5"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-popper": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.1.3.tgz",
+ "integrity": "sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@floating-ui/react-dom": "^2.0.0",
+ "@radix-ui/react-arrow": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1",
+ "@radix-ui/react-use-rect": "1.0.1",
+ "@radix-ui/react-use-size": "1.0.1",
+ "@radix-ui/rect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-portal": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.4.tgz",
+ "integrity": "sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-presence": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.0.1.tgz",
+ "integrity": "sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-primitive": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-1.0.3.tgz",
+ "integrity": "sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-slot": "1.0.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-progress": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.0.3.tgz",
+ "integrity": "sha512-5G6Om/tYSxjSeEdrb1VfKkfZfn/1IlPWd731h2RfPuSbIfNUgfqAwbKfJCg/PP6nuUCTrYzalwHSpSinoWoCag==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-radio-group": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.1.3.tgz",
+ "integrity": "sha512-x+yELayyefNeKeTx4fjK6j99Fs6c4qKm3aY38G3swQVTN6xMpsrbigC0uHs2L//g8q4qR7qOcww8430jJmi2ag==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-roving-focus": "1.0.4",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "@radix-ui/react-use-previous": "1.0.1",
+ "@radix-ui/react-use-size": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-roving-focus": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.0.4.tgz",
+ "integrity": "sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-scroll-area": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-scroll-area/-/react-scroll-area-1.0.5.tgz",
+ "integrity": "sha512-b6PAgH4GQf9QEn8zbT2XUHpW5z8BzqEc7Kl11TwDrvuTrxlkcjTD5qa/bxgKr+nmuXKu4L/W5UZ4mlP/VG/5Gw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/number": "1.0.1",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-select": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.0.0.tgz",
+ "integrity": "sha512-RH5b7af4oHtkcHS7pG6Sgv5rk5Wxa7XI8W5gvB1N/yiuDGZxko1ynvOiVhFM7Cis2A8zxF9bTOUVbRDzPepe6w==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/number": "1.0.1",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.5",
+ "@radix-ui/react-focus-guards": "1.0.1",
+ "@radix-ui/react-focus-scope": "1.0.4",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-popper": "1.1.3",
+ "@radix-ui/react-portal": "1.0.4",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-slot": "1.0.2",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1",
+ "@radix-ui/react-use-previous": "1.0.1",
+ "@radix-ui/react-visually-hidden": "1.0.3",
+ "aria-hidden": "^1.1.1",
+ "react-remove-scroll": "2.5.5"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-separator": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.0.3.tgz",
+ "integrity": "sha512-itYmTy/kokS21aiV5+Z56MZB54KrhPgn6eHDKkFeOLR34HMN2s8PaN47qZZAGnvupcjxHaFZnW4pQEh0BvvVuw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-slider": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slider/-/react-slider-1.1.2.tgz",
+ "integrity": "sha512-NKs15MJylfzVsCagVSWKhGGLNR1W9qWs+HtgbmjjVUB3B9+lb3PYoXxVju3kOrpf0VKyVCtZp+iTwVoqpa1Chw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/number": "1.0.1",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1",
+ "@radix-ui/react-use-previous": "1.0.1",
+ "@radix-ui/react-use-size": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-slot": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.2.tgz",
+ "integrity": "sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-compose-refs": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-switch": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.0.3.tgz",
+ "integrity": "sha512-mxm87F88HyHztsI7N+ZUmEoARGkC22YVW5CaC+Byc+HRpuvCrOBPTAnXgf+tZ/7i0Sg/eOePGdMhUKhPaQEqow==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "@radix-ui/react-use-previous": "1.0.1",
+ "@radix-ui/react-use-size": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-tabs": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.0.4.tgz",
+ "integrity": "sha512-egZfYY/+wRNCflXNHx+dePvnz9FbmssDTJBtgRfDY7e8SE5oIo3Py2eCB1ckAbh1Q7cQ/6yJZThJ++sgbxibog==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-roving-focus": "1.0.4",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-toast": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toast/-/react-toast-1.1.5.tgz",
+ "integrity": "sha512-fRLn227WHIBRSzuRzGJ8W+5YALxofH23y0MlPLddaIpLpCDqdE0NZlS2NRQDRiptfxDeeCjgFIpexB1/zkxDlw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-collection": "1.0.3",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.5",
+ "@radix-ui/react-portal": "1.0.4",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-callback-ref": "1.0.1",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "@radix-ui/react-use-layout-effect": "1.0.1",
+ "@radix-ui/react-visually-hidden": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-toggle": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.0.3.tgz",
+ "integrity": "sha512-Pkqg3+Bc98ftZGsl60CLANXQBBQ4W3mTFS9EJvNxKMZ7magklKV69/id1mlAlOFDDfHvlCms0fx8fA4CMKDJHg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-toggle-group": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle-group/-/react-toggle-group-1.0.4.tgz",
+ "integrity": "sha512-Uaj/M/cMyiyT9Bx6fOZO0SAG4Cls0GptBWiBmBxofmDbNVnYYoyRWj/2M/6VCi/7qcXFWnHhRUfdfZFvvkuu8A==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-roving-focus": "1.0.4",
+ "@radix-ui/react-toggle": "1.0.3",
+ "@radix-ui/react-use-controllable-state": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-toolbar": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-toolbar/-/react-toolbar-1.0.4.tgz",
+ "integrity": "sha512-tBgmM/O7a07xbaEkYJWYTXkIdU/1pW4/KZORR43toC/4XWyBCURK0ei9kMUdp+gTPPKBgYLxXmRSH1EVcIDp8Q==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-direction": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-roving-focus": "1.0.4",
+ "@radix-ui/react-separator": "1.0.3",
+ "@radix-ui/react-toggle-group": "1.0.4"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-tooltip": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.0.7.tgz",
+ "integrity": "sha512-lPh5iKNFVQ/jav/j6ZrWq3blfDJ0OH9R6FlNUHPMqdLuQ9vwDgFsRxvl8b7Asuy5c8xmoojHUxKHQSOAvMHxyw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/primitive": "1.0.1",
+ "@radix-ui/react-compose-refs": "1.0.1",
+ "@radix-ui/react-context": "1.0.1",
+ "@radix-ui/react-dismissable-layer": "1.0.5",
+ "@radix-ui/react-id": "1.0.1",
+ "@radix-ui/react-popper": "1.1.3",
+ "@radix-ui/react-portal": "1.0.4",
+ "@radix-ui/react-presence": "1.0.1",
+ "@radix-ui/react-primitive": "1.0.3",
+ "@radix-ui/react-slot": "1.0.2",
+ "@radix-ui/react-use-controllable-state": "1.0.1",
+ "@radix-ui/react-visually-hidden": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ },
+ "@types/react-dom": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-callback-ref": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.0.1.tgz",
+ "integrity": "sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-controllable-state": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.0.1.tgz",
+ "integrity": "sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-callback-ref": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-escape-keydown": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.3.tgz",
+ "integrity": "sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-callback-ref": "1.0.1"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-layout-effect": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.1.tgz",
+ "integrity": "sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-previous": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-previous/-/react-use-previous-1.0.1.tgz",
+ "integrity": "sha512-cV5La9DPwiQ7S0gf/0qiD6YgNqM5Fk97Kdrlc5yBcrF3jyEZQwm7vYFqMo4IfeHgJXsRaMvLABFtd0OVEmZhDw==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-use-rect": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-rect/-/react-use-rect-1.0.1.tgz",
+ "integrity": "sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw==",
"dependencies": {
- "@nodelib/fs.scandir": "2.1.5",
- "fastq": "^1.6.0"
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/rect": "1.0.1"
},
- "engines": {
- "node": ">= 8"
+ "peerDependencies": {
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
}
},
- "node_modules/@pmmmwh/react-refresh-webpack-plugin": {
- "version": "0.5.11",
- "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.11.tgz",
- "integrity": "sha512-7j/6vdTym0+qZ6u4XbSAxrWBGYSdCfTzySkj7WAFgDLmSyWlOrWvpyzxlFh5jtw9dn0oL/jtW+06XfFiisN3JQ==",
+ "node_modules/@radix-ui/react-use-size": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.0.1.tgz",
+ "integrity": "sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g==",
"dependencies": {
- "ansi-html-community": "^0.0.8",
- "common-path-prefix": "^3.0.0",
- "core-js-pure": "^3.23.3",
- "error-stack-parser": "^2.0.6",
- "find-up": "^5.0.0",
- "html-entities": "^2.1.0",
- "loader-utils": "^2.0.4",
- "schema-utils": "^3.0.0",
- "source-map": "^0.7.3"
- },
- "engines": {
- "node": ">= 10.13"
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-use-layout-effect": "1.0.1"
},
"peerDependencies": {
- "@types/webpack": "4.x || 5.x",
- "react-refresh": ">=0.10.0 <1.0.0",
- "sockjs-client": "^1.4.0",
- "type-fest": ">=0.17.0 <5.0.0",
- "webpack": ">=4.43.0 <6.0.0",
- "webpack-dev-server": "3.x || 4.x",
- "webpack-hot-middleware": "2.x",
- "webpack-plugin-serve": "0.x || 1.x"
+ "@types/react": "*",
+ "react": "^16.8 || ^17.0 || ^18.0"
},
"peerDependenciesMeta": {
- "@types/webpack": {
- "optional": true
- },
- "sockjs-client": {
+ "@types/react": {
"optional": true
- },
- "type-fest": {
+ }
+ }
+ },
+ "node_modules/@radix-ui/react-visually-hidden": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.0.3.tgz",
+ "integrity": "sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10",
+ "@radix-ui/react-primitive": "1.0.3"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
"optional": true
},
- "webpack-dev-server": {
+ "@types/react-dom": {
"optional": true
- },
- "webpack-hot-middleware": {
+ }
+ }
+ },
+ "node_modules/@radix-ui/rect": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/@radix-ui/rect/-/rect-1.0.1.tgz",
+ "integrity": "sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.13.10"
+ }
+ },
+ "node_modules/@radix-ui/themes": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/@radix-ui/themes/-/themes-2.0.3.tgz",
+ "integrity": "sha512-yaXQ8aWT2P1CQ0Xe6YCRD9HXsfMTvKkrIYkrc4aitCzhGTLS0sjtTqKmrxIWMVA+3DIbEuG9K/8aAMRJBhep8g==",
+ "dependencies": {
+ "@radix-ui/colors": "^3.0.0",
+ "@radix-ui/primitive": "^1.0.1",
+ "@radix-ui/react-accessible-icon": "^1.0.3",
+ "@radix-ui/react-alert-dialog": "^1.0.5",
+ "@radix-ui/react-aspect-ratio": "^1.0.3",
+ "@radix-ui/react-avatar": "^1.0.4",
+ "@radix-ui/react-checkbox": "^1.0.4",
+ "@radix-ui/react-context-menu": "^2.1.5",
+ "@radix-ui/react-dialog": "^1.0.5",
+ "@radix-ui/react-direction": "^1.0.1",
+ "@radix-ui/react-dropdown-menu": "^2.0.6",
+ "@radix-ui/react-form": "^0.0.3",
+ "@radix-ui/react-hover-card": "^1.0.7",
+ "@radix-ui/react-popover": "^1.0.7",
+ "@radix-ui/react-portal": "^1.0.4",
+ "@radix-ui/react-radio-group": "^1.1.3",
+ "@radix-ui/react-scroll-area": "^1.0.5",
+ "@radix-ui/react-select": "^2.0.0",
+ "@radix-ui/react-separator": "^1.0.3",
+ "@radix-ui/react-slider": "^1.1.2",
+ "@radix-ui/react-slot": "^1.0.2",
+ "@radix-ui/react-switch": "^1.0.3",
+ "@radix-ui/react-tabs": "^1.0.4",
+ "@radix-ui/react-tooltip": "^1.0.7",
+ "@radix-ui/react-use-callback-ref": "^1.0.1",
+ "@radix-ui/react-visually-hidden": "^1.0.3",
+ "classnames": "^2.3.2"
+ },
+ "peerDependencies": {
+ "@types/react": "*",
+ "@types/react-dom": "*",
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
"optional": true
},
- "webpack-plugin-serve": {
+ "@types/react-dom": {
"optional": true
}
}
},
- "node_modules/@popperjs/core": {
- "version": "2.11.8",
- "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
- "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/popperjs"
- }
+ "node_modules/@radix-ui/themes/node_modules/classnames": {
+ "version": "2.5.1",
+ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz",
+ "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow=="
},
"node_modules/@react-aria/ssr": {
"version": "3.8.0",
@@ -3842,6 +5366,167 @@
"resolved": "https://registry.npmjs.org/@react-dnd/shallowequal/-/shallowequal-4.0.2.tgz",
"integrity": "sha512-/RVXdLvJxLg4QKvMoM5WlwNR9ViO9z8B/qPcc+C0Sa/teJY7QG7kJ441DwzOjMYEY7GmU4dj5EcGHIkKZiQZCA=="
},
+ "node_modules/@react-pdf/fns": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/@react-pdf/fns/-/fns-2.2.1.tgz",
+ "integrity": "sha512-s78aDg0vDYaijU5lLOCsUD+qinQbfOvcNeaoX9AiE7+kZzzCo6B/nX+l48cmt9OosJmvZvE9DWR9cLhrhOi2pA==",
+ "dependencies": {
+ "@babel/runtime": "^7.20.13"
+ }
+ },
+ "node_modules/@react-pdf/font": {
+ "version": "2.4.4",
+ "resolved": "https://registry.npmjs.org/@react-pdf/font/-/font-2.4.4.tgz",
+ "integrity": "sha512-yjK5eSY+LcbxS0m+sOYln8GdgIbUgti4xjwf14kx8OSsOMJQJyHFALHMh2cLcKJR9yZeqVDo1FwCsY6gw1yCkg==",
+ "dependencies": {
+ "@babel/runtime": "^7.20.13",
+ "@react-pdf/types": "^2.4.1",
+ "cross-fetch": "^3.1.5",
+ "fontkit": "^2.0.2",
+ "is-url": "^1.2.4"
+ }
+ },
+ "node_modules/@react-pdf/image": {
+ "version": "2.3.4",
+ "resolved": "https://registry.npmjs.org/@react-pdf/image/-/image-2.3.4.tgz",
+ "integrity": "sha512-IE34l7gfTdaxXe3XR9240xMZsFdxF1myIwmEWK28XoeTaucUPAUyOiNcFSGRT59vNuZVBuakYz3BlGGrkvAPVQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.20.13",
+ "@react-pdf/png-js": "^2.3.1",
+ "cross-fetch": "^3.1.5",
+ "jay-peg": "^1.0.0"
+ }
+ },
+ "node_modules/@react-pdf/layout": {
+ "version": "3.11.2",
+ "resolved": "https://registry.npmjs.org/@react-pdf/layout/-/layout-3.11.2.tgz",
+ "integrity": "sha512-5EiHJ+Eb0odqnkWll9pWbTp+dwH1QRm7mOXDMiklqIWK98eI7e3cEae5Dgr0TtdnB7KgPW9Tvul2CwRJTwq54A==",
+ "dependencies": {
+ "@babel/runtime": "^7.20.13",
+ "@react-pdf/fns": "2.2.1",
+ "@react-pdf/image": "^2.3.4",
+ "@react-pdf/pdfkit": "^3.1.6",
+ "@react-pdf/primitives": "^3.1.1",
+ "@react-pdf/stylesheet": "^4.2.4",
+ "@react-pdf/textkit": "^4.4.1",
+ "@react-pdf/types": "^2.4.1",
+ "cross-fetch": "^3.1.5",
+ "emoji-regex": "^10.3.0",
+ "queue": "^6.0.1",
+ "yoga-layout": "^2.0.1"
+ }
+ },
+ "node_modules/@react-pdf/layout/node_modules/emoji-regex": {
+ "version": "10.3.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz",
+ "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw=="
+ },
+ "node_modules/@react-pdf/pdfkit": {
+ "version": "3.1.6",
+ "resolved": "https://registry.npmjs.org/@react-pdf/pdfkit/-/pdfkit-3.1.6.tgz",
+ "integrity": "sha512-U96VVhphniDBsLbmeJHgEml15nng8cr90mmEfPATh98gsqg6wev0avBr4k9XPjLdaN1f2xTXD4VdlaMYJZ+n7Q==",
+ "dependencies": {
+ "@babel/runtime": "^7.20.13",
+ "@react-pdf/png-js": "^2.3.1",
+ "browserify-zlib": "^0.2.0",
+ "crypto-js": "^4.2.0",
+ "fontkit": "^2.0.2",
+ "jay-peg": "^1.0.0",
+ "vite-compatible-readable-stream": "^3.6.1"
+ }
+ },
+ "node_modules/@react-pdf/png-js": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/@react-pdf/png-js/-/png-js-2.3.1.tgz",
+ "integrity": "sha512-pEZ18I4t1vAUS4lmhvXPmXYP4PHeblpWP/pAlMMRkEyP7tdAeHUN7taQl9sf9OPq7YITMY3lWpYpJU6t4CZgZg==",
+ "dependencies": {
+ "browserify-zlib": "^0.2.0"
+ }
+ },
+ "node_modules/@react-pdf/primitives": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/@react-pdf/primitives/-/primitives-3.1.1.tgz",
+ "integrity": "sha512-miwjxLwTnO3IjoqkTVeTI+9CdyDggwekmSLhVCw+a/7FoQc+gF3J2dSKwsHvAcVFM0gvU8mzCeTofgw0zPDq0w=="
+ },
+ "node_modules/@react-pdf/render": {
+ "version": "3.4.3",
+ "resolved": "https://registry.npmjs.org/@react-pdf/render/-/render-3.4.3.tgz",
+ "integrity": "sha512-9LL059vfwrK1gA0uIA4utpQ/pUH9EW/yia4bb7pCoARs8IlupY5UP265jgax15ua0p+MdUwShZzQ9rilu7kGsw==",
+ "dependencies": {
+ "@babel/runtime": "^7.20.13",
+ "@react-pdf/fns": "2.2.1",
+ "@react-pdf/primitives": "^3.1.1",
+ "@react-pdf/textkit": "^4.4.1",
+ "@react-pdf/types": "^2.4.1",
+ "abs-svg-path": "^0.1.1",
+ "color-string": "^1.9.1",
+ "normalize-svg-path": "^1.1.0",
+ "parse-svg-path": "^0.1.2",
+ "svg-arc-to-cubic-bezier": "^3.2.0"
+ }
+ },
+ "node_modules/@react-pdf/renderer": {
+ "version": "3.3.8",
+ "resolved": "https://registry.npmjs.org/@react-pdf/renderer/-/renderer-3.3.8.tgz",
+ "integrity": "sha512-wJESEZCNNbog4MxDjRgKtgdmyGm+lDce9cMX2THRs1Jltckq3M8N0yt/fkvGyB8nwiDPtEBOsz9JKlw5vLidbw==",
+ "dependencies": {
+ "@babel/runtime": "^7.20.13",
+ "@react-pdf/font": "^2.4.4",
+ "@react-pdf/layout": "^3.11.2",
+ "@react-pdf/pdfkit": "^3.1.6",
+ "@react-pdf/primitives": "^3.1.1",
+ "@react-pdf/render": "^3.4.3",
+ "@react-pdf/types": "^2.4.1",
+ "events": "^3.3.0",
+ "object-assign": "^4.1.1",
+ "prop-types": "^15.6.2",
+ "queue": "^6.0.1",
+ "scheduler": "^0.17.0"
+ },
+ "peerDependencies": {
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
+ "node_modules/@react-pdf/renderer/node_modules/scheduler": {
+ "version": "0.17.0",
+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.17.0.tgz",
+ "integrity": "sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA==",
+ "dependencies": {
+ "loose-envify": "^1.1.0",
+ "object-assign": "^4.1.1"
+ }
+ },
+ "node_modules/@react-pdf/stylesheet": {
+ "version": "4.2.4",
+ "resolved": "https://registry.npmjs.org/@react-pdf/stylesheet/-/stylesheet-4.2.4.tgz",
+ "integrity": "sha512-CgRfDzeMtnV0GL7zSn381NubmgwqKhFKcK1YrWX3azl/KWVh52jjFd3HWi6dvcETNT862mjWz5MnExe4WOBJXA==",
+ "dependencies": {
+ "@babel/runtime": "^7.20.13",
+ "@react-pdf/fns": "2.2.1",
+ "@react-pdf/types": "^2.4.1",
+ "color-string": "^1.9.1",
+ "hsl-to-hex": "^1.0.0",
+ "media-engine": "^1.0.3",
+ "postcss-value-parser": "^4.1.0"
+ }
+ },
+ "node_modules/@react-pdf/textkit": {
+ "version": "4.4.1",
+ "resolved": "https://registry.npmjs.org/@react-pdf/textkit/-/textkit-4.4.1.tgz",
+ "integrity": "sha512-Jl9wdTqIvJ5pX+vAGz0EOhP7ut5Two9H6CzTKo/YYPeD79cM2yTXF3JzTERBC28y7LR0Waq9D2LHQjI+b/EYUQ==",
+ "dependencies": {
+ "@babel/runtime": "^7.20.13",
+ "@react-pdf/fns": "2.2.1",
+ "bidi-js": "^1.0.2",
+ "hyphen": "^1.6.4",
+ "unicode-properties": "^1.4.1"
+ }
+ },
+ "node_modules/@react-pdf/types": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/@react-pdf/types/-/types-2.4.1.tgz",
+ "integrity": "sha512-w8pk7svhjVj5f7d7kjEGXSk26ffCqRSQcgWR4DwcFltNpSM18ZJmzmM6WrNeeP437y48LlykLnmGDA3oATakgw=="
+ },
"node_modules/@reduxjs/toolkit": {
"version": "1.9.7",
"resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-1.9.7.tgz",
@@ -4527,6 +6212,14 @@
"csstype": "^3.0.2"
}
},
+ "node_modules/@types/react-reconciler": {
+ "version": "0.28.8",
+ "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.28.8.tgz",
+ "integrity": "sha512-SN9c4kxXZonFhbX4hJrZy37yw9e7EIxcpHCxQv5JUS18wDE5ovkQKlqQEkufdJCCMfuI9BnjUJvhYeJ9x5Ra7g==",
+ "dependencies": {
+ "@types/react": "*"
+ }
+ },
"node_modules/@types/react-transition-group": {
"version": "4.4.7",
"resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.7.tgz",
@@ -5003,6 +6696,17 @@
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz",
"integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA=="
},
+ "node_modules/abbrev": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+ "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
+ "optional": true
+ },
+ "node_modules/abs-svg-path": {
+ "version": "0.1.1",
+ "resolved": "https://registry.npmjs.org/abs-svg-path/-/abs-svg-path-0.1.1.tgz",
+ "integrity": "sha512-d8XPSGjfyzlXC3Xx891DJRyZfqk5JU0BJrDQcsWomFIV1/BIzPW5HDH5iDdWpqWaav0YVIEzT1RHTwWr0FFshA=="
+ },
"node_modules/accepts": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
@@ -5229,6 +6933,12 @@
"node": ">= 8"
}
},
+ "node_modules/aproba": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz",
+ "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==",
+ "optional": true
+ },
"node_modules/arch": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz",
@@ -5248,6 +6958,19 @@
}
]
},
+ "node_modules/are-we-there-yet": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz",
+ "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==",
+ "optional": true,
+ "dependencies": {
+ "delegates": "^1.0.0",
+ "readable-stream": "^3.6.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/arg": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
@@ -5261,6 +6984,17 @@
"sprintf-js": "~1.0.2"
}
},
+ "node_modules/aria-hidden": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.3.tgz",
+ "integrity": "sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==",
+ "dependencies": {
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/aria-query": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
@@ -5872,7 +7606,6 @@
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
- "dev": true,
"funding": [
{
"type": "github",
@@ -5908,6 +7641,14 @@
"node": ">= 8.0.0"
}
},
+ "node_modules/bidi-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz",
+ "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==",
+ "dependencies": {
+ "require-from-string": "^2.0.2"
+ }
+ },
"node_modules/big.js": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
@@ -6153,16 +7894,27 @@
"node": ">=8"
}
},
- "node_modules/brackets2dots": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/brackets2dots/-/brackets2dots-1.1.0.tgz",
- "integrity": "sha512-DEIJz+ebFQ2SYPpXd8owCjy+8H+9N2Pd9DeSf0J33oavLyBYpAtjLg/Z/RmdJdTeHmKVva+L411HjnvyV2rSOA=="
+ "node_modules/brotli": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.3.tgz",
+ "integrity": "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==",
+ "dependencies": {
+ "base64-js": "^1.1.2"
+ }
},
"node_modules/browser-process-hrtime": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz",
"integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow=="
},
+ "node_modules/browserify-zlib": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz",
+ "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==",
+ "dependencies": {
+ "pako": "~1.0.5"
+ }
+ },
"node_modules/browserslist": {
"version": "4.22.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz",
@@ -6345,6 +8097,21 @@
}
]
},
+ "node_modules/canvas": {
+ "version": "2.11.2",
+ "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz",
+ "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==",
+ "hasInstallScript": true,
+ "optional": true,
+ "dependencies": {
+ "@mapbox/node-pre-gyp": "^1.0.0",
+ "nan": "^2.17.0",
+ "simple-get": "^3.0.3"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/case-sensitive-paths-webpack-plugin": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz",
@@ -6500,6 +8267,15 @@
"node": ">= 6"
}
},
+ "node_modules/chownr": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz",
+ "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==",
+ "optional": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/chrome-trace-event": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz",
@@ -6696,6 +8472,23 @@
"node": ">=0.8"
}
},
+ "node_modules/clsx": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.0.tgz",
+ "integrity": "sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/cnbuilder": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/cnbuilder/-/cnbuilder-3.1.0.tgz",
+ "integrity": "sha512-9sxWwwprkPNTVQnx92WYPEWCmyZRqbf9VWUYABU4rl0mLL17VAV2MvvOApkMA6bQVXRLJ8jN//8Yp6drElpLWA==",
+ "funding": {
+ "type": "patreon",
+ "url": "https://www.patreon.com/xobotyi"
+ }
+ },
"node_modules/co": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
@@ -6736,6 +8529,24 @@
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
},
+ "node_modules/color-string": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
+ "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
+ "dependencies": {
+ "color-name": "^1.0.0",
+ "simple-swizzle": "^0.2.2"
+ }
+ },
+ "node_modules/color-support": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
+ "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
+ "optional": true,
+ "bin": {
+ "color-support": "bin.js"
+ }
+ },
"node_modules/colord": {
"version": "2.9.3",
"resolved": "https://registry.npmjs.org/colord/-/colord-2.9.3.tgz",
@@ -6901,6 +8712,12 @@
"node": ">=0.8"
}
},
+ "node_modules/console-control-strings": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
+ "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==",
+ "optional": true
+ },
"node_modules/content-disposition": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
@@ -7015,6 +8832,14 @@
"integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==",
"optional": true
},
+ "node_modules/cross-fetch": {
+ "version": "3.1.8",
+ "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz",
+ "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==",
+ "dependencies": {
+ "node-fetch": "^2.6.12"
+ }
+ },
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
@@ -7031,8 +8856,7 @@
"node_modules/crypto-js": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz",
- "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==",
- "optional": true
+ "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
},
"node_modules/crypto-random-string": {
"version": "2.0.0",
@@ -7464,14 +9288,6 @@
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
},
- "node_modules/curry2": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/curry2/-/curry2-1.0.3.tgz",
- "integrity": "sha512-2vXqPLsITt0ccyczu1BFl3tc8Q6BOCsTHt+NZYasd8wp60RQIYhGM3Beis5h5FgJPT11M1rfiKOR7dPL6cL14Q==",
- "dependencies": {
- "fast-bind": "^1.0.0"
- }
- },
"node_modules/cz-conventional-changelog": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/cz-conventional-changelog/-/cz-conventional-changelog-3.3.0.tgz",
@@ -7529,6 +9345,15 @@
"node": ">=10"
}
},
+ "node_modules/date-fns": {
+ "version": "3.3.1",
+ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.3.1.tgz",
+ "integrity": "sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==",
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/kossnocorp"
+ }
+ },
"node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@@ -7550,16 +9375,23 @@
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz",
"integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA=="
},
+ "node_modules/decompress-response": {
+ "version": "4.2.1",
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz",
+ "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==",
+ "optional": true,
+ "dependencies": {
+ "mimic-response": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/dedent": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz",
"integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA=="
},
- "node_modules/deep-equal": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
- "integrity": "sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw=="
- },
"node_modules/deep-extend": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
@@ -7649,6 +9481,12 @@
"node": ">=0.4.0"
}
},
+ "node_modules/delegates": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
+ "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==",
+ "optional": true
+ },
"node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
@@ -7692,6 +9530,15 @@
"node": ">=8"
}
},
+ "node_modules/detect-libc": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz",
+ "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==",
+ "optional": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/detect-newline": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz",
@@ -7739,6 +9586,11 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
},
+ "node_modules/dfa": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/dfa/-/dfa-1.2.0.tgz",
+ "integrity": "sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q=="
+ },
"node_modules/didyoumean": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz",
@@ -7935,11 +9787,6 @@
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz",
"integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA=="
},
- "node_modules/dotsplit.js": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/dotsplit.js/-/dotsplit.js-1.1.0.tgz",
- "integrity": "sha512-oFVx9VEE+M3yM4oUkaiDa+U2RhOmjXWyXwtfdc5UiHDSZWleE96FS3nx3yXMVuhLJOdI2GMThvaegkwRYPgAFQ=="
- },
"node_modules/duplexer": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
@@ -9075,11 +10922,6 @@
"node": ">=0.10.0"
}
},
- "node_modules/fast-bind": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fast-bind/-/fast-bind-1.0.0.tgz",
- "integrity": "sha512-kna1xVU4nn4HW4RVwh6VYSWoii+u8EkWKS3I6YZluncEvtQwahHKhZTRPFHOOkeJK4m0/Tz2Ir9n10tARqeiXw=="
- },
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@@ -9127,6 +10969,11 @@
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="
},
+ "node_modules/fast-memoize": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz",
+ "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw=="
+ },
"node_modules/fast-url-parser": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz",
@@ -9412,6 +11259,39 @@
}
}
},
+ "node_modules/fontkit": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/fontkit/-/fontkit-2.0.2.tgz",
+ "integrity": "sha512-jc4k5Yr8iov8QfS6u8w2CnHWVmbOGtdBtOXMze5Y+QD966Rx6PEVWXSEGwXlsDlKtu1G12cJjcsybnqhSk/+LA==",
+ "dependencies": {
+ "@swc/helpers": "^0.4.2",
+ "brotli": "^1.3.2",
+ "clone": "^2.1.2",
+ "dfa": "^1.2.0",
+ "fast-deep-equal": "^3.1.3",
+ "restructure": "^3.0.0",
+ "tiny-inflate": "^1.0.3",
+ "unicode-properties": "^1.4.0",
+ "unicode-trie": "^2.0.0"
+ }
+ },
+ "node_modules/fontkit/node_modules/@swc/helpers": {
+ "version": "0.4.36",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.36.tgz",
+ "integrity": "sha512-5lxnyLEYFskErRPenYItLRSge5DjrJngYKdVjRSrWfza9G6KkgHEXi0vUZiyUeMU5JfXH1YnvXZzSp8ul88o2Q==",
+ "dependencies": {
+ "legacy-swc-helpers": "npm:@swc/helpers@=0.4.14",
+ "tslib": "^2.4.0"
+ }
+ },
+ "node_modules/fontkit/node_modules/clone": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
+ "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==",
+ "engines": {
+ "node": ">=0.8"
+ }
+ },
"node_modules/for-each": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
@@ -9630,6 +11510,36 @@
"node": ">=12"
}
},
+ "node_modules/fs-minipass": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz",
+ "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==",
+ "optional": true,
+ "dependencies": {
+ "minipass": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/fs-minipass/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "optional": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/fs-minipass/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "optional": true
+ },
"node_modules/fs-monkey": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.5.tgz",
@@ -9683,6 +11593,26 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/gauge": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz",
+ "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==",
+ "optional": true,
+ "dependencies": {
+ "aproba": "^1.0.3 || ^2.0.0",
+ "color-support": "^1.1.2",
+ "console-control-strings": "^1.0.0",
+ "has-unicode": "^2.0.1",
+ "object-assign": "^4.1.1",
+ "signal-exit": "^3.0.0",
+ "string-width": "^4.2.3",
+ "strip-ansi": "^6.0.1",
+ "wide-align": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
"node_modules/gensync": {
"version": "1.0.0-beta.2",
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
@@ -9725,6 +11655,14 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/get-nonce": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-nonce/-/get-nonce-1.0.1.tgz",
+ "integrity": "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/get-own-enumerable-property-symbols": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz",
@@ -10004,6 +11942,12 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/has-unicode": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
+ "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==",
+ "optional": true
+ },
"node_modules/he": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
@@ -10088,6 +12032,19 @@
"safe-buffer": "~5.1.0"
}
},
+ "node_modules/hsl-to-hex": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/hsl-to-hex/-/hsl-to-hex-1.0.0.tgz",
+ "integrity": "sha512-K6GVpucS5wFf44X0h2bLVRDsycgJmf9FF2elg+CrqD8GcFU8c6vYhgXn8NjUkFCwj+xDFb70qgLbTUm6sxwPmA==",
+ "dependencies": {
+ "hsl-to-rgb-for-reals": "^1.1.0"
+ }
+ },
+ "node_modules/hsl-to-rgb-for-reals": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/hsl-to-rgb-for-reals/-/hsl-to-rgb-for-reals-1.1.1.tgz",
+ "integrity": "sha512-LgOWAkrN0rFaQpfdWBQlv/VhkOxb5AsBjk6NQVx4yEzWS923T07X0M1Y0VNko2H52HeSpZrZNNMJ0aFqsdVzQg=="
+ },
"node_modules/html-dom-parser": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/html-dom-parser/-/html-dom-parser-4.0.0.tgz",
@@ -10379,6 +12336,11 @@
"node": ">=10.17.0"
}
},
+ "node_modules/hyphen": {
+ "version": "1.10.4",
+ "resolved": "https://registry.npmjs.org/hyphen/-/hyphen-1.10.4.tgz",
+ "integrity": "sha512-SejXzIpv9gOVdDWXd4suM1fdF1k2dxZGvuTdkOVLoazYfK7O4DykIQbdrvuyG+EaTNlXAGhMndtKrhykgbt0gg=="
+ },
"node_modules/iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
@@ -11054,6 +13016,11 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/is-url": {
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz",
+ "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww=="
+ },
"node_modules/is-utf8": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
@@ -11248,6 +13215,17 @@
"set-function-name": "^2.0.1"
}
},
+ "node_modules/its-fine": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/its-fine/-/its-fine-1.1.1.tgz",
+ "integrity": "sha512-v1Ia1xl20KbuSGlwoaGsW0oxsw8Be+TrXweidxD9oT/1lAh6O3K3/GIM95Tt6WCiv6W+h2M7RB1TwdoAjQyyKw==",
+ "dependencies": {
+ "@types/react-reconciler": "^0.28.0"
+ },
+ "peerDependencies": {
+ "react": ">=18.0"
+ }
+ },
"node_modules/jake": {
"version": "10.8.7",
"resolved": "https://registry.npmjs.org/jake/-/jake-10.8.7.tgz",
@@ -11329,6 +13307,14 @@
"node": ">=8"
}
},
+ "node_modules/jay-peg": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/jay-peg/-/jay-peg-1.0.1.tgz",
+ "integrity": "sha512-zBfjkGbuuNXk8JW+rEePpPEbRRjupS8q+5yPak7kjy3e2GvvNwsLle9okEFvfGyZA6HvtSSiYrVd1/jgnYebaQ==",
+ "dependencies": {
+ "restructure": "^3.0.0"
+ }
+ },
"node_modules/jest": {
"version": "27.5.1",
"resolved": "https://registry.npmjs.org/jest/-/jest-27.5.1.tgz",
@@ -13297,20 +15283,6 @@
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
},
- "node_modules/json-rules-engine-simplified": {
- "version": "0.1.17",
- "resolved": "https://registry.npmjs.org/json-rules-engine-simplified/-/json-rules-engine-simplified-0.1.17.tgz",
- "integrity": "sha512-02Di/9NtC0vBvV/cnWCybQmNNWuXDaxDbRszIGDiwc4nJasCVVz2YsTCR9VCmFsovh/GBwvj5NoQjGN/FiZ04A==",
- "dependencies": {
- "deep-equal": "1.0.1",
- "predicate": "1.2.0",
- "selectn": "1.1.2"
- },
- "engines": {
- "node": ">=8",
- "npm": "^2.14.7"
- }
- },
"node_modules/json-schema": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
@@ -13432,6 +15404,26 @@
"node": ">= 8"
}
},
+ "node_modules/konva": {
+ "version": "9.3.5",
+ "resolved": "https://registry.npmjs.org/konva/-/konva-9.3.5.tgz",
+ "integrity": "sha512-mMs9TAlz5709m41F2dc8Q8vMtN09wJ1se0x72v9jwSnIAiaXWAr5OP4/8qQPtV7/VADYwCMv6NN3+qn6lTJacg==",
+ "funding": [
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/lavrton"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/konva"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/lavrton"
+ }
+ ],
+ "peer": true
+ },
"node_modules/language-subtag-registry": {
"version": "0.3.22",
"resolved": "https://registry.npmjs.org/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz",
@@ -13454,6 +15446,15 @@
"shell-quote": "^1.8.1"
}
},
+ "node_modules/legacy-swc-helpers": {
+ "name": "@swc/helpers",
+ "version": "0.4.14",
+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.4.14.tgz",
+ "integrity": "sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==",
+ "dependencies": {
+ "tslib": "^2.4.0"
+ }
+ },
"node_modules/leven": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
@@ -14196,6 +16197,14 @@
"sourcemap-codec": "^1.4.8"
}
},
+ "node_modules/make-cancellable-promise": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/make-cancellable-promise/-/make-cancellable-promise-1.3.2.tgz",
+ "integrity": "sha512-GCXh3bq/WuMbS+Ky4JBPW1hYTOU+znU+Q5m9Pu+pI8EoUqIHk9+tviOKC6/qhHh8C4/As3tzJ69IF32kdz85ww==",
+ "funding": {
+ "url": "https://github.com/wojtekmaj/make-cancellable-promise?sponsor=1"
+ }
+ },
"node_modules/make-dir": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz",
@@ -14224,6 +16233,14 @@
"integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
"optional": true
},
+ "node_modules/make-event-props": {
+ "version": "1.6.2",
+ "resolved": "https://registry.npmjs.org/make-event-props/-/make-event-props-1.6.2.tgz",
+ "integrity": "sha512-iDwf7mA03WPiR8QxvcVHmVWEPfMY1RZXerDVNCRYW7dUr2ppH3J58Rwb39/WG39yTZdRSxr3x+2v22tvI0VEvA==",
+ "funding": {
+ "url": "https://github.com/wojtekmaj/make-event-props?sponsor=1"
+ }
+ },
"node_modules/makeerror": {
"version": "1.0.12",
"resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz",
@@ -14237,6 +16254,11 @@
"resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.4.tgz",
"integrity": "sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA=="
},
+ "node_modules/media-engine": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/media-engine/-/media-engine-1.0.3.tgz",
+ "integrity": "sha512-aa5tG6sDoK+k70B9iEX1NeyfT8ObCKhNDs6lJVpwF6r8vhUfuKMslIcirq6HIUYuuUYLefcEQOn9bSBOvawtwg=="
+ },
"node_modules/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
@@ -14280,6 +16302,22 @@
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
},
+ "node_modules/merge-refs": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/merge-refs/-/merge-refs-1.2.2.tgz",
+ "integrity": "sha512-RwcT7GsQR3KbuLw1rRuodq4Nt547BKEBkliZ0qqsrpyNne9bGTFtsFIsIpx82huWhcl3kOlOlH4H0xkPk/DqVw==",
+ "funding": {
+ "url": "https://github.com/wojtekmaj/merge-refs?sponsor=1"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
"node_modules/merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@@ -14301,21 +16339,6 @@
"node": ">= 0.6"
}
},
- "node_modules/mf-cra": {
- "version": "0.0.5",
- "resolved": "https://registry.npmjs.org/mf-cra/-/mf-cra-0.0.5.tgz",
- "integrity": "sha512-a5sRFMIlDSZCwOfC7wFJc39lwMQxm+18dZ7S2wrKkKHfb5/v1jFNcO9Rj9xvs6yFJL75h44K8GnadTVvxw1Inw==",
- "bin": {
- "mf-cra": "bin/mf-cra.js"
- },
- "engines": {
- "node": ">=14.0.0"
- },
- "peerDependencies": {
- "react": ">= 16",
- "react-scripts": "^5.0.0"
- }
- },
"node_modules/micromatch": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
@@ -14366,6 +16389,18 @@
"node": ">=6"
}
},
+ "node_modules/mimic-response": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz",
+ "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==",
+ "optional": true,
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/mini-css-extract-plugin": {
"version": "2.7.6",
"resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-2.7.6.tgz",
@@ -14457,6 +16492,46 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/minipass": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz",
+ "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==",
+ "optional": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minizlib": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz",
+ "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==",
+ "optional": true,
+ "dependencies": {
+ "minipass": "^3.0.0",
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/minizlib/node_modules/minipass": {
+ "version": "3.3.6",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
+ "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==",
+ "optional": true,
+ "dependencies": {
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/minizlib/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "optional": true
+ },
"node_modules/mkdirp": {
"version": "0.5.6",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
@@ -14534,6 +16609,12 @@
"thenify-all": "^1.0.0"
}
},
+ "node_modules/nan": {
+ "version": "2.18.0",
+ "resolved": "https://registry.npmjs.org/nan/-/nan-2.18.0.tgz",
+ "integrity": "sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==",
+ "optional": true
+ },
"node_modules/nanoid": {
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
@@ -14583,6 +16664,44 @@
"tslib": "^2.0.3"
}
},
+ "node_modules/node-fetch": {
+ "version": "2.7.0",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
+ "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
+ "dependencies": {
+ "whatwg-url": "^5.0.0"
+ },
+ "engines": {
+ "node": "4.x || >=6.0.0"
+ },
+ "peerDependencies": {
+ "encoding": "^0.1.0"
+ },
+ "peerDependenciesMeta": {
+ "encoding": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/node-fetch/node_modules/tr46": {
+ "version": "0.0.3",
+ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
+ "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
+ },
+ "node_modules/node-fetch/node_modules/webidl-conversions": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
+ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
+ },
+ "node_modules/node-fetch/node_modules/whatwg-url": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
+ "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
+ "dependencies": {
+ "tr46": "~0.0.3",
+ "webidl-conversions": "^3.0.0"
+ }
+ },
"node_modules/node-forge": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
@@ -14601,6 +16720,21 @@
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
"integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ=="
},
+ "node_modules/nopt": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
+ "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==",
+ "optional": true,
+ "dependencies": {
+ "abbrev": "1"
+ },
+ "bin": {
+ "nopt": "bin/nopt.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/normalize-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
@@ -14617,6 +16751,14 @@
"node": ">=0.10.0"
}
},
+ "node_modules/normalize-svg-path": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/normalize-svg-path/-/normalize-svg-path-1.1.0.tgz",
+ "integrity": "sha512-r9KHKG2UUeB5LoTouwDzBy2VxXlHsiM6fyLQvnJa0S5hrhzqElH/CH7TUGhT1fVvIYBIKf3OpY4YJ4CK+iaqHg==",
+ "dependencies": {
+ "svg-arc-to-cubic-bezier": "^3.0.0"
+ }
+ },
"node_modules/normalize-url": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz",
@@ -14639,6 +16781,18 @@
"node": ">=8"
}
},
+ "node_modules/npmlog": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz",
+ "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==",
+ "optional": true,
+ "dependencies": {
+ "are-we-there-yet": "^2.0.0",
+ "console-control-strings": "^1.1.0",
+ "gauge": "^3.0.0",
+ "set-blocking": "^2.0.0"
+ }
+ },
"node_modules/nth-check": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
@@ -15018,6 +17172,11 @@
"node": ">=6"
}
},
+ "node_modules/pako": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
+ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="
+ },
"node_modules/param-case": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
@@ -15083,6 +17242,11 @@
"node": ">=0.10.0"
}
},
+ "node_modules/parse-svg-path": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/parse-svg-path/-/parse-svg-path-0.1.2.tgz",
+ "integrity": "sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ=="
+ },
"node_modules/parse/node_modules/uuid": {
"version": "9.0.1",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
@@ -15184,6 +17348,43 @@
"node": ">=8"
}
},
+ "node_modules/path2d-polyfill": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz",
+ "integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==",
+ "optional": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/pdf-lib": {
+ "version": "1.17.1",
+ "resolved": "https://registry.npmjs.org/pdf-lib/-/pdf-lib-1.17.1.tgz",
+ "integrity": "sha512-V/mpyJAoTsN4cnP31vc0wfNA1+p20evqqnap0KLoRUN0Yk/p3wN52DOEsL4oBFcLdb76hlpKPtzJIgo67j/XLw==",
+ "dependencies": {
+ "@pdf-lib/standard-fonts": "^1.0.0",
+ "@pdf-lib/upng": "^1.0.1",
+ "pako": "^1.0.11",
+ "tslib": "^1.11.1"
+ }
+ },
+ "node_modules/pdf-lib/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
+ },
+ "node_modules/pdfjs-dist": {
+ "version": "3.11.174",
+ "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz",
+ "integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==",
+ "engines": {
+ "node": ">=18"
+ },
+ "optionalDependencies": {
+ "canvas": "^2.11.2",
+ "path2d-polyfill": "^2.0.1"
+ }
+ },
"node_modules/performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
@@ -16538,11 +18739,6 @@
"resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz",
"integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ=="
},
- "node_modules/predicate": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/predicate/-/predicate-1.2.0.tgz",
- "integrity": "sha512-ivO0nhCPIXzTQryc8ieiVPf4ZCMGPIFLKn7a72jv8qsLwazTXqqkHJAM/JAfBKkkXURUcSzNJfE9AyizD6eJeg=="
- },
"node_modules/prelude-ls": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
@@ -16811,6 +19007,11 @@
"node": ">=8"
}
},
+ "node_modules/print-js": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/print-js/-/print-js-1.6.0.tgz",
+ "integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg=="
+ },
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@@ -16944,6 +19145,14 @@
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
},
+ "node_modules/queue": {
+ "version": "6.0.2",
+ "resolved": "https://registry.npmjs.org/queue/-/queue-6.0.2.tgz",
+ "integrity": "sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==",
+ "dependencies": {
+ "inherits": "~2.0.3"
+ }
+ },
"node_modules/queue-microtask": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -16963,6 +19172,48 @@
}
]
},
+ "node_modules/radix-ui": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/radix-ui/-/radix-ui-1.0.1.tgz",
+ "integrity": "sha512-qfGibbqtbOlxP3b+1JjbLUc8Q7+e9DL8gFycLtkBkoAQyUkKuHAEBfFUcyG5MaQHjqRuML+YLtt/R1/dUYQafQ==",
+ "dependencies": {
+ "@radix-ui/react-accessible-icon": "latest",
+ "@radix-ui/react-accordion": "latest",
+ "@radix-ui/react-alert-dialog": "latest",
+ "@radix-ui/react-aspect-ratio": "latest",
+ "@radix-ui/react-avatar": "latest",
+ "@radix-ui/react-checkbox": "latest",
+ "@radix-ui/react-collapsible": "latest",
+ "@radix-ui/react-context-menu": "latest",
+ "@radix-ui/react-dialog": "latest",
+ "@radix-ui/react-direction": "latest",
+ "@radix-ui/react-dropdown-menu": "latest",
+ "@radix-ui/react-hover-card": "latest",
+ "@radix-ui/react-label": "latest",
+ "@radix-ui/react-navigation-menu": "latest",
+ "@radix-ui/react-popover": "latest",
+ "@radix-ui/react-portal": "latest",
+ "@radix-ui/react-progress": "latest",
+ "@radix-ui/react-radio-group": "latest",
+ "@radix-ui/react-scroll-area": "latest",
+ "@radix-ui/react-select": "latest",
+ "@radix-ui/react-separator": "latest",
+ "@radix-ui/react-slider": "latest",
+ "@radix-ui/react-slot": "latest",
+ "@radix-ui/react-switch": "latest",
+ "@radix-ui/react-tabs": "latest",
+ "@radix-ui/react-toast": "latest",
+ "@radix-ui/react-toggle": "latest",
+ "@radix-ui/react-toggle-group": "latest",
+ "@radix-ui/react-toolbar": "latest",
+ "@radix-ui/react-tooltip": "latest",
+ "@radix-ui/react-visually-hidden": "latest"
+ },
+ "peerDependencies": {
+ "react": "^16.8 || ^17.0 || ^18.0",
+ "react-dom": "^16.8 || ^17.0 || ^18.0"
+ }
+ },
"node_modules/raf": {
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz",
@@ -17042,6 +19293,18 @@
"node": ">=0.10.0"
}
},
+ "node_modules/re-resizable": {
+ "version": "6.9.6",
+ "resolved": "https://registry.npmjs.org/re-resizable/-/re-resizable-6.9.6.tgz",
+ "integrity": "sha512-0xYKS5+Z0zk+vICQlcZW+g54CcJTTmHluA7JUUgvERDxnKAnytylcyPsA+BSFi759s5hPlHmBRegFrwXs2FuBQ==",
+ "dependencies": {
+ "fast-memoize": "^2.5.1"
+ },
+ "peerDependencies": {
+ "react": "^16.13.1 || ^17.0.0 || ^18.0.0",
+ "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0"
+ }
+ },
"node_modules/react": {
"version": "18.2.0",
"resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
@@ -17085,9 +19348,9 @@
"integrity": "sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg=="
},
"node_modules/react-bootstrap": {
- "version": "2.9.0",
- "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.9.0.tgz",
- "integrity": "sha512-dGh6fGjqR9MBzPOp2KbXJznt1Zy6SWepXYUdxMT18Zu/wJ73HCU8JNZe9dfzjmVssZYsJH9N3HHE4wAtQvNz7g==",
+ "version": "2.10.1",
+ "resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-2.10.1.tgz",
+ "integrity": "sha512-J3OpRZIvCTQK+Tg/jOkRUvpYLHMdGeU9KqFUBQrV0d/Qr/3nsINpiOJyZMWnM5SJ3ctZdhPA6eCIKpEJR3Ellg==",
"dependencies": {
"@babel/runtime": "^7.22.5",
"@restart/hooks": "^0.4.9",
@@ -17129,6 +19392,22 @@
"react": "^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
}
},
+ "node_modules/react-datepicker": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-6.2.0.tgz",
+ "integrity": "sha512-GzEOiE6yLfp9P6XNkOhXuYtZHzoAx3tirbi7/dj2WHlGM+NGE1lefceqGR0ZrYsYaqsNJhIJFTgwUpzVzA+mjw==",
+ "dependencies": {
+ "@floating-ui/react": "^0.26.2",
+ "classnames": "^2.2.6",
+ "date-fns": "^3.3.1",
+ "prop-types": "^15.7.2",
+ "react-onclickoutside": "^6.13.0"
+ },
+ "peerDependencies": {
+ "react": "^16.9.0 || ^17 || ^18",
+ "react-dom": "^16.9.0 || ^17 || ^18"
+ }
+ },
"node_modules/react-dev-utils": {
"version": "12.0.1",
"resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-12.0.1.tgz",
@@ -17345,6 +19624,27 @@
"prop-types": "^15.5.8"
}
},
+ "node_modules/react-draggable": {
+ "version": "4.4.6",
+ "resolved": "https://registry.npmjs.org/react-draggable/-/react-draggable-4.4.6.tgz",
+ "integrity": "sha512-LtY5Xw1zTPqHkVmtM3X8MUOxNDOUhv/khTgBgrUvwaS064bwVvxT+q5El0uUFNx5IEPKXuRejr7UqLwBIg5pdw==",
+ "dependencies": {
+ "clsx": "^1.1.1",
+ "prop-types": "^15.8.1"
+ },
+ "peerDependencies": {
+ "react": ">= 16.3.0",
+ "react-dom": ">= 16.3.0"
+ }
+ },
+ "node_modules/react-draggable/node_modules/clsx": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",
+ "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/react-error-overlay": {
"version": "6.0.11",
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.11.tgz",
@@ -17379,6 +19679,36 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="
},
+ "node_modules/react-konva": {
+ "version": "18.2.10",
+ "resolved": "https://registry.npmjs.org/react-konva/-/react-konva-18.2.10.tgz",
+ "integrity": "sha512-ohcX1BJINL43m4ynjZ24MxFI1syjBdrXhqVxYVDw2rKgr3yuS0x/6m1Y2Z4sl4T/gKhfreBx8KHisd0XC6OT1g==",
+ "funding": [
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/lavrton"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/konva"
+ },
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/lavrton"
+ }
+ ],
+ "dependencies": {
+ "@types/react-reconciler": "^0.28.2",
+ "its-fine": "^1.1.1",
+ "react-reconciler": "~0.29.0",
+ "scheduler": "^0.23.0"
+ },
+ "peerDependencies": {
+ "konva": "^8.0.1 || ^7.2.5 || ^9.0.0",
+ "react": ">=18.0.0",
+ "react-dom": ">=18.0.0"
+ }
+ },
"node_modules/react-lifecycles-compat": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
@@ -17407,11 +19737,68 @@
"resolved": "https://registry.npmjs.org/react-native-crypto-js/-/react-native-crypto-js-1.0.0.tgz",
"integrity": "sha512-FNbLuG/HAdapQoybeZSoes1PWdOj0w242gb+e1R0hicf3Gyj/Mf8M9NaED2AnXVOX01b2FXomwUiw1xP1K+8sA=="
},
+ "node_modules/react-onclickoutside": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.13.0.tgz",
+ "integrity": "sha512-ty8So6tcUpIb+ZE+1HAhbLROvAIJYyJe/1vRrrcmW+jLsaM+/powDRqxzo6hSh9CuRZGSL1Q8mvcF5WRD93a0A==",
+ "funding": {
+ "type": "individual",
+ "url": "https://github.com/Pomax/react-onclickoutside/blob/master/FUNDING.md"
+ },
+ "peerDependencies": {
+ "react": "^15.5.x || ^16.x || ^17.x || ^18.x",
+ "react-dom": "^15.5.x || ^16.x || ^17.x || ^18.x"
+ }
+ },
+ "node_modules/react-pdf": {
+ "version": "7.7.1",
+ "resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-7.7.1.tgz",
+ "integrity": "sha512-cbbf/PuRtGcPPw+HLhMI1f6NSka8OJgg+j/yPWTe95Owf0fK6gmVY7OXpTxMeh92O3T3K3EzfE0ML0eXPGwR5g==",
+ "dependencies": {
+ "clsx": "^2.0.0",
+ "dequal": "^2.0.3",
+ "make-cancellable-promise": "^1.3.1",
+ "make-event-props": "^1.6.0",
+ "merge-refs": "^1.2.1",
+ "pdfjs-dist": "3.11.174",
+ "prop-types": "^15.6.2",
+ "tiny-invariant": "^1.0.0",
+ "warning": "^4.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/wojtekmaj/react-pdf?sponsor=1"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
"node_modules/react-property": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/react-property/-/react-property-2.0.0.tgz",
"integrity": "sha512-kzmNjIgU32mO4mmH5+iUyrqlpFQhF8K2k7eZ4fdLSOPFrD1XgEuSBv9LDEgxRXTMBqMd8ppT0x6TIzqE5pdGdw=="
},
+ "node_modules/react-reconciler": {
+ "version": "0.29.0",
+ "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.29.0.tgz",
+ "integrity": "sha512-wa0fGj7Zht1EYMRhKWwoo1H9GApxYLBuhoAuXN0TlltESAjDssB+Apf0T/DngVqaMyPypDmabL37vw/2aRM98Q==",
+ "dependencies": {
+ "loose-envify": "^1.1.0",
+ "scheduler": "^0.23.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "peerDependencies": {
+ "react": "^18.2.0"
+ }
+ },
"node_modules/react-redux": {
"version": "8.1.3",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-8.1.3.tgz",
@@ -17463,6 +19850,91 @@
"node": ">=0.10.0"
}
},
+ "node_modules/react-remove-scroll": {
+ "version": "2.5.5",
+ "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
+ "integrity": "sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==",
+ "dependencies": {
+ "react-remove-scroll-bar": "^2.3.3",
+ "react-style-singleton": "^2.2.1",
+ "tslib": "^2.1.0",
+ "use-callback-ref": "^1.3.0",
+ "use-sidecar": "^1.1.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-remove-scroll-bar": {
+ "version": "2.3.5",
+ "resolved": "https://registry.npmjs.org/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.5.tgz",
+ "integrity": "sha512-3cqjOqg6s0XbOjWvmasmqHch+RLxIEk2r/70rzGXuz3iIGQsQheEQyqYCBb5EECoD01Vo2SIbDqW4paLeLTASw==",
+ "dependencies": {
+ "react-style-singleton": "^2.2.1",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/react-rnd": {
+ "version": "10.4.1",
+ "resolved": "https://registry.npmjs.org/react-rnd/-/react-rnd-10.4.1.tgz",
+ "integrity": "sha512-0m887AjQZr6p2ADLNnipquqsDq4XJu/uqVqI3zuoGD19tRm6uB83HmZWydtkilNp5EWsOHbLGF4IjWMdd5du8Q==",
+ "dependencies": {
+ "re-resizable": "6.9.6",
+ "react-draggable": "4.4.5",
+ "tslib": "2.3.1"
+ },
+ "peerDependencies": {
+ "react": ">=16.3.0",
+ "react-dom": ">=16.3.0"
+ }
+ },
+ "node_modules/react-rnd/node_modules/clsx": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz",
+ "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/react-rnd/node_modules/react-draggable": {
+ "version": "4.4.5",
+ "resolved": "https://registry.npmjs.org/react-draggable/-/react-draggable-4.4.5.tgz",
+ "integrity": "sha512-OMHzJdyJbYTZo4uQE393fHcqqPYsEtkjfMgvCHr6rejT+Ezn4OZbNyGH50vv+SunC1RMvwOTSWkEODQLzw1M9g==",
+ "dependencies": {
+ "clsx": "^1.1.1",
+ "prop-types": "^15.8.1"
+ },
+ "peerDependencies": {
+ "react": ">= 16.3.0",
+ "react-dom": ">= 16.3.0"
+ }
+ },
+ "node_modules/react-rnd/node_modules/tslib": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
+ "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
+ },
"node_modules/react-router": {
"version": "6.16.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.16.0.tgz",
@@ -17565,6 +20037,23 @@
}
}
},
+ "node_modules/react-scrollbars-custom": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/react-scrollbars-custom/-/react-scrollbars-custom-4.1.1.tgz",
+ "integrity": "sha512-FOI1EMrdN5qziwvFAuH4saOo0+ggxeTuKLPpy6nezNdLUnDW1vCHGq0VSSfTSRstDgfXgwff5TMP9NeJ8NiFOQ==",
+ "dependencies": {
+ "cnbuilder": "^3.1.0",
+ "react-draggable": "^4.4.5",
+ "zoom-level": "^2.5.0"
+ },
+ "funding": {
+ "type": "patreon",
+ "url": "https://www.patreon.com/xobotyi"
+ },
+ "peerDependencies": {
+ "react": ">=16.0.0"
+ }
+ },
"node_modules/react-select": {
"version": "5.7.7",
"resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.7.tgz",
@@ -17598,6 +20087,42 @@
"react": "^16.3.0 || ^17.0.0 || ^18.0.0"
}
},
+ "node_modules/react-signature-canvas": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/react-signature-canvas/-/react-signature-canvas-1.0.6.tgz",
+ "integrity": "sha512-NoMHomYu9HxFeLjUGbIeV9abPdWSROfFxFNDekGdwmmaIx+w5ziOEiU2C34X0Ao4GxFnwqyUy/BpYlA4lCD1CA==",
+ "dependencies": {
+ "signature_pad": "^2.3.2",
+ "trim-canvas": "^0.1.0"
+ },
+ "peerDependencies": {
+ "prop-types": "^15.5.8",
+ "react": "0.14 - 18",
+ "react-dom": "0.14 - 18"
+ }
+ },
+ "node_modules/react-style-singleton": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/react-style-singleton/-/react-style-singleton-2.2.1.tgz",
+ "integrity": "sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==",
+ "dependencies": {
+ "get-nonce": "^1.0.0",
+ "invariant": "^2.2.4",
+ "tslib": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
"node_modules/react-transition-group": {
"version": "4.4.5",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz",
@@ -17774,9 +20299,9 @@
}
},
"node_modules/regex-parser": {
- "version": "2.2.11",
- "resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.2.11.tgz",
- "integrity": "sha512-jbD/FT0+9MBU2XAZluI7w2OBs1RBi6p9M83nkoZayQXXU9e8Robt69FcZc7wU4eJD/YFTjn1JdCk3rbMJajz8Q=="
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/regex-parser/-/regex-parser-2.3.0.tgz",
+ "integrity": "sha512-TVILVSz2jY5D47F4mA4MppkBrafEaiUWJO/TcZHEIuI13AqoZMkK1WMA4Om1YkYbTx+9Ki1/tSUXbceyr9saRg=="
},
"node_modules/regexp.prototype.flags": {
"version": "1.5.1",
@@ -18080,6 +20605,11 @@
"node": ">=8"
}
},
+ "node_modules/restructure": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/restructure/-/restructure-3.0.0.tgz",
+ "integrity": "sha512-Xj8/MEIhhfj9X2rmD9iJ4Gga9EFqVlpMj3vfLnV2r/Mh5jRMryNV+6lWh9GdJtDBcBSPIqzRdfBQ3wDtNFv/uw=="
+ },
"node_modules/retry": {
"version": "0.13.1",
"resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz",
@@ -18378,30 +20908,6 @@
"resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
"integrity": "sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg=="
},
- "node_modules/selectn": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/selectn/-/selectn-1.1.2.tgz",
- "integrity": "sha512-AaQlR5br4jWANaF5p5J1ctpsOKwFE5ljWK8ZUSrc4u4ZwcmFLyiowTMt7UjfzQN2/aXF3xnuSVnV4c3Q9tBDqQ==",
- "dependencies": {
- "brackets2dots": "^1.1.0",
- "curry2": "^1.0.0",
- "debug": "^2.5.2",
- "dotsplit.js": "^1.0.3"
- }
- },
- "node_modules/selectn/node_modules/debug": {
- "version": "2.6.9",
- "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
- "dependencies": {
- "ms": "2.0.0"
- }
- },
- "node_modules/selectn/node_modules/ms": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
- "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
- },
"node_modules/selfsigned": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz",
@@ -18686,6 +21192,12 @@
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="
},
+ "node_modules/set-blocking": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
+ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
+ "optional": true
+ },
"node_modules/set-function-name": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz",
@@ -18749,6 +21261,55 @@
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
"integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="
},
+ "node_modules/signature_pad": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/signature_pad/-/signature_pad-2.3.2.tgz",
+ "integrity": "sha512-peYXLxOsIY6MES2TrRLDiNg2T++8gGbpP2yaC+6Ohtxr+a2dzoaqWosWDY9sWqTAAk6E/TyQO+LJw9zQwyu5kA=="
+ },
+ "node_modules/simple-concat": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
+ "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "optional": true
+ },
+ "node_modules/simple-get": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.1.tgz",
+ "integrity": "sha512-CQ5LTKGfCpvE1K0n2us+kuMPbk/q0EKl82s4aheV9oXjFEz6W/Y7oQFVJuU6QG77hRT4Ghb5RURteF5vnWjupA==",
+ "optional": true,
+ "dependencies": {
+ "decompress-response": "^4.2.0",
+ "once": "^1.3.1",
+ "simple-concat": "^1.0.0"
+ }
+ },
+ "node_modules/simple-swizzle": {
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
+ "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
+ "dependencies": {
+ "is-arrayish": "^0.3.1"
+ }
+ },
+ "node_modules/simple-swizzle/node_modules/is-arrayish": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
+ "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
+ },
"node_modules/sisteransi": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
@@ -19402,6 +21963,11 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/svg-arc-to-cubic-bezier": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/svg-arc-to-cubic-bezier/-/svg-arc-to-cubic-bezier-3.2.0.tgz",
+ "integrity": "sha512-djbJ/vZKZO+gPoSDThGNpKDO+o+bAeA4XQKovvkNCqnIS2t+S4qnLAGQhyyrulhCFRl1WWzAp0wUDV8PpTVU3g=="
+ },
"node_modules/svg-parser": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz",
@@ -19492,6 +22058,11 @@
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
},
+ "node_modules/tabbable": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz",
+ "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew=="
+ },
"node_modules/tailwindcss": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz",
@@ -19536,6 +22107,41 @@
"node": ">=6"
}
},
+ "node_modules/tar": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz",
+ "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==",
+ "optional": true,
+ "dependencies": {
+ "chownr": "^2.0.0",
+ "fs-minipass": "^2.0.0",
+ "minipass": "^5.0.0",
+ "minizlib": "^2.1.1",
+ "mkdirp": "^1.0.3",
+ "yallist": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/tar/node_modules/mkdirp": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
+ "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==",
+ "optional": true,
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/tar/node_modules/yallist": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
+ "optional": true
+ },
"node_modules/temp-dir": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz",
@@ -19695,6 +22301,16 @@
"resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz",
"integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA=="
},
+ "node_modules/tiny-inflate": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz",
+ "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw=="
+ },
+ "node_modules/tiny-invariant": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz",
+ "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="
+ },
"node_modules/tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
@@ -19772,6 +22388,11 @@
"node": ">=8"
}
},
+ "node_modules/trim-canvas": {
+ "version": "0.1.2",
+ "resolved": "https://registry.npmjs.org/trim-canvas/-/trim-canvas-0.1.2.tgz",
+ "integrity": "sha512-nd4Ga3iLFV94mdhW9JFMLpQbHUyCQuhFOD71PEAt1NjtMD5wbZctzhX8c3agHNybMR5zXD1XTGoIEWk995E6pQ=="
+ },
"node_modules/tryer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz",
@@ -20083,6 +22704,15 @@
"node": ">=4"
}
},
+ "node_modules/unicode-properties": {
+ "version": "1.4.1",
+ "resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.4.1.tgz",
+ "integrity": "sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==",
+ "dependencies": {
+ "base64-js": "^1.3.0",
+ "unicode-trie": "^2.0.0"
+ }
+ },
"node_modules/unicode-property-aliases-ecmascript": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz",
@@ -20091,6 +22721,20 @@
"node": ">=4"
}
},
+ "node_modules/unicode-trie": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/unicode-trie/-/unicode-trie-2.0.0.tgz",
+ "integrity": "sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==",
+ "dependencies": {
+ "pako": "^0.2.5",
+ "tiny-inflate": "^1.0.0"
+ }
+ },
+ "node_modules/unicode-trie/node_modules/pako": {
+ "version": "0.2.9",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz",
+ "integrity": "sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA=="
+ },
"node_modules/unique-string": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz",
@@ -20321,6 +22965,19 @@
"node": ">= 0.8"
}
},
+ "node_modules/vite-compatible-readable-stream": {
+ "version": "3.6.1",
+ "resolved": "https://registry.npmjs.org/vite-compatible-readable-stream/-/vite-compatible-readable-stream-3.6.1.tgz",
+ "integrity": "sha512-t20zYkrSf868+j/p31cRIGN28Phrjm3nRSLR2fyc2tiWi4cZGVdv68yNlwnIINTkMTmPoMiSlc0OadaO7DXZaQ==",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
"node_modules/w3c-hr-time": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",
@@ -20855,6 +23512,15 @@
"url": "https://github.com/sponsors/ljharb"
}
},
+ "node_modules/wide-align": {
+ "version": "1.1.5",
+ "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",
+ "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",
+ "optional": true,
+ "dependencies": {
+ "string-width": "^1.0.2 || 2 || 3 || 4"
+ }
+ },
"node_modules/widest-line": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/widest-line/-/widest-line-4.0.1.tgz",
@@ -21378,6 +24044,20 @@
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
+ },
+ "node_modules/yoga-layout": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/yoga-layout/-/yoga-layout-2.0.1.tgz",
+ "integrity": "sha512-tT/oChyDXelLo2A+UVnlW9GU7CsvFMaEnd9kVFsaiCQonFAXd3xrHhkLYu+suwwosrAEQ746xBU+HvYtm1Zs2Q=="
+ },
+ "node_modules/zoom-level": {
+ "version": "2.5.0",
+ "resolved": "https://registry.npmjs.org/zoom-level/-/zoom-level-2.5.0.tgz",
+ "integrity": "sha512-7UlRWU4Q3uCMCeDVMOm7eBrIu145OqsIJ3p6zq58l8UsSYwKWxc6zEapC5YA9tIeh0oheb4cT9Kk2Wq353loFg==",
+ "funding": {
+ "type": "patreon",
+ "url": "https://www.patreon.com/xobotyi"
+ }
}
}
}
diff --git a/apps/OpenSign/package.json b/apps/OpenSign/package.json
index 12d538ae8..5879c21b3 100644
--- a/apps/OpenSign/package.json
+++ b/apps/OpenSign/package.json
@@ -3,46 +3,56 @@
"version": "0.1.0",
"private": true,
"dependencies": {
+ "@radix-ui/themes": "^2.0.3",
+ "@react-pdf/renderer": "^3.3.8",
"@reduxjs/toolkit": "^1.9.7",
"axios": "^1.6.0",
"daisyui": "^3.9.2",
"file-saver": "^2.0.5",
"html-react-parser": "^4.2.2",
- "json-rules-engine-simplified": "^0.1.17",
"jwt-decode": "^4.0.0",
- "mf-cra": "^0.0.5",
"moment": "^2.29.4",
"parse": "^4.3.1",
+ "pdf-lib": "^1.17.1",
+ "print-js": "^1.6.0",
+ "radix-ui": "^1.0.1",
"react": "^18.2.0",
- "react-bootstrap": "^2.9.0",
+ "react-bootstrap": "^2.10.1",
+ "react-datepicker": "^6.2.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-dnd-multi-backend": "^8.0.3",
"react-dnd-touch-backend": "^16.0.1",
"react-dom": "^18.2.0",
"react-drag-listview": "^2.0.0",
+ "react-draggable": "^4.4.6",
"react-gtm-module": "^2.0.11",
"react-helmet": "^6.1.0",
+ "react-konva": "^18.2.10",
"react-modal": "^3.16.1",
+ "react-pdf": "^7.7.1",
"react-redux": "^8.1.3",
+ "react-rnd": "^10.4.1",
"react-router-dom": "^6.16.0",
"react-scripts": "5.0.1",
+ "react-scrollbars-custom": "^4.1.1",
"react-select": "^5.7.7",
+ "react-signature-canvas": "^1.0.6",
"reactour": "^1.19.2",
"redux": "^4.2.1",
"redux-thunk": "^2.4.2",
+ "regex-parser": "^2.3.0",
"serve": "^14.2.1",
"styled-components": "^4.4.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "serve -s build",
- "start-dev": "mf-cra start",
+ "start-dev" :"react-scripts start",
"version": "curl -s https://api.github.com/repos/opensignlabs/opensign/releases/latest | grep '\"tag_name\":' | awk -F '\"' '{print $4}' > ./public/version.txt",
- "build": "npm run version && rm -rf public/mfbuild && npm run micro && CI=false && mf-cra build",
- "micro": "cd ../../microfrontends/SignDocuments && npm install && npm run build",
- "docker-build": "npm run version && rm -rf public/mfbuild && npm run docker-micro && CI=false && mf-cra build",
- "docker-micro": "cd ./SignDocuments && npm install && npm run docker-build",
+ "version-win": "powershell -Command \"Invoke-RestMethod -Uri 'https://api.github.com/repos/opensignlabs/opensign/releases/latest' | Select-Object -ExpandProperty tag_name | Out-File -FilePath ./public/version.txt\"",
+ "build": "npm run version && react-scripts build",
+ "build-win": "npm run version-win && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"release": "standard-version",
diff --git a/apps/OpenSign/public/version.txt b/apps/OpenSign/public/version.txt
index 3c61df3f2..652405d34 100644
Binary files a/apps/OpenSign/public/version.txt and b/apps/OpenSign/public/version.txt differ
diff --git a/apps/OpenSign/src/App.js b/apps/OpenSign/src/App.js
index c0920e2d7..3423b43fd 100644
--- a/apps/OpenSign/src/App.js
+++ b/apps/OpenSign/src/App.js
@@ -2,7 +2,6 @@ import React, { useState, useEffect } from "react";
import { Routes, Route, BrowserRouter } from "react-router-dom";
import Pgsignup from "./routes/Pgsignup";
import Login from "./routes/Login";
-import Microapp from "./routes/RemoteApp";
import Signup from "./routes/Signup";
import Form from "./routes/Form";
import Report from "./routes/Report";
@@ -13,12 +12,21 @@ import UserProfile from "./routes/UserProfile";
import PageNotFound from "./routes/PageNotFound";
import ForgetPassword from "./routes/ForgetPassword";
import ChangePassword from "./routes/ChangePassword";
-import ReportMicroapp from "./components/ReportMicroapp";
-import LoadMf from "./routes/LoadMf";
import GenerateToken from "./routes/GenerateToken";
import ValidateRoute from "./primitives/ValidateRoute";
import Webhook from "./routes/Webhook";
import Validate from "./primitives/Validate";
+import DebugPdf from "./routes/DebugPdf";
+import ManageSign from "./routes/Managesign";
+import Opensigndrive from "./routes/Opensigndrive";
+import TemplatePlaceholder from "./routes/TemplatePlaceholder";
+import { pdfjs } from "react-pdf";
+import SignYourSelf from "./routes/SignyourselfPdf";
+import DraftDocument from "./components/pdf/DraftDocument";
+import PlaceHolderSign from "./routes/PlaceHolderSign";
+import PdfRequestFiles from "./routes/PdfRequestFiles";
+import GuestLogin from "./routes/GuestLogin";
+pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
function App() {
const [isloading, setIsLoading] = useState(true);
@@ -27,8 +35,10 @@ function App() {
}, []);
const handleCredentials = () => {
- const appId = process.env.REACT_APP_APPID;
- const baseurl = process.env.REACT_APP_SERVERURL;
+ const appId = "opensign";
+ const baseurl = process.env.REACT_APP_SERVERURL
+ ? process.env.REACT_APP_SERVERURL
+ : window.location.origin + "/api/app";
const appName = "contracts";
try {
localStorage.setItem("BaseUrl12", `${baseurl}/`);
@@ -67,9 +77,30 @@ function App() {
<Route exact path="/signup" element={<Signup />} />
</Route>
<Route element={<Validate />}>
- <Route exact path="/load/:remoteApp/*" element={<LoadMf />} />
+ <Route
+ exact
+ path="/load/template/:templateId"
+ element={<TemplatePlaceholder />}
+ />
+ <Route
+ exact
+ path="/load/placeholdersign/:docId"
+ element={<PlaceHolderSign />}
+ />
+ <Route
+ exact
+ path="/load/recipientSignPdf/:docId/:contactBookId"
+ element={<PdfRequestFiles />}
+ />
</Route>
- <Route exact path="/loadmf/:remoteApp/*" element={<LoadMf />} />
+ <Route path="/loadmf/signmicroapp/login" element={<GuestLogin />} />
+ {/* login page route */}
+ <Route
+ path="/login/:id/:userMail/:contactBookId/:serverUrl"
+ element={<GuestLogin />}
+ />
+
+ <Route path="/debugpdf" element={<DebugPdf />} />
<Route exact path="/forgetpassword" element={<ForgetPassword />} />
{process.env.REACT_APP_ENABLE_SUBSCRIPTION && (
<>
@@ -79,15 +110,39 @@ function App() {
)}
<Route element={<HomeLayout />}>
<Route path="/changepassword" element={<ChangePassword />} />
- <Route path="/mf/:remoteApp/*" element={<Microapp />} />
- <Route path="/asmf/:remoteApp/*" element={<Microapp />} />
- <Route path="/rpmf/:remoteApp/*" element={<ReportMicroapp />} />
<Route path="/form/:id" element={<Form />} />
<Route path="/report/:id" element={<Report />} />
<Route path="/dashboard/:id" element={<Dashboard />} />
<Route path="/profile" element={<UserProfile />} />
<Route path="/generatetoken" element={<GenerateToken />} />
<Route path="/webhook" element={<Webhook />} />
+ <Route path="/managesign" element={<ManageSign />} />
+ <Route path="/opensigndrive" element={<Opensigndrive />} />
+ <Route
+ path="/template/:templateId"
+ element={<TemplatePlaceholder />}
+ />
+ {/* signyouself route with no rowlevel data using docId from url */}
+ <Route path="/signaturePdf/:docId" element={<SignYourSelf />} />
+ {/* draft document route to handle and navigate route page accordiing to document status */}
+ <Route path="/draftDocument" element={<DraftDocument />} />
+ {/* recipient placeholder set route with no rowlevel data using docId from url*/}
+ <Route
+ path="/placeHolderSign/:docId"
+ element={<PlaceHolderSign />}
+ />
+ {/* for user signature (need your sign route) with row level data */}
+ <Route path="/pdfRequestFiles" element={<PdfRequestFiles />} />
+ {/* for user signature (need your sign route) with no row level data */}
+ <Route
+ path="/pdfRequestFiles/:docId"
+ element={<PdfRequestFiles />}
+ />
+ {/* recipient signature route with no rowlevel data using docId from url */}
+ <Route
+ path="/recipientSignPdf/:docId/:contactBookId"
+ element={<PdfRequestFiles />}
+ />
</Route>
<Route path="*" element={<PageNotFound />} />
</Routes>
diff --git a/apps/OpenSign/src/Bootstrap.js b/apps/OpenSign/src/Bootstrap.js
deleted file mode 100644
index 3ec10295d..000000000
--- a/apps/OpenSign/src/Bootstrap.js
+++ /dev/null
@@ -1,62 +0,0 @@
-import React from "react";
-import ReactDOM from "react-dom/client";
-import "./index.css";
-import App from "./App";
-import { Provider } from "react-redux";
-import { store } from "./redux/store";
-import { HTML5Backend } from "react-dnd-html5-backend";
-import { TouchBackend } from "react-dnd-touch-backend";
-import {
- DndProvider,
- TouchTransition,
- MouseTransition,
- Preview
-} from "react-dnd-multi-backend";
-import DragElement from "./microappComponent/DragElement";
-import TagManager from "react-gtm-module";
-
-const HTML5toTouch = {
- backends: [
- {
- id: "html5",
- backend: HTML5Backend,
- transition: MouseTransition
- },
- {
- id: "touch",
- backend: TouchBackend,
- options: { enableMouseEvents: true },
- preview: true,
- transition: TouchTransition
- }
- ]
-};
-const generatePreview = (props) => {
- const { item, style } = props;
- const newStyle = {
- ...style
- };
-
- return (
- <div style={newStyle}>
- <DragElement {...item} />
- </div>
- );
-};
-
-if (process.env.REACT_APP_GTM) {
- const tagManagerArgs = {
- gtmId: process.env.REACT_APP_GTM
- };
- TagManager.initialize(tagManagerArgs);
-}
-
-const root = ReactDOM.createRoot(document.getElementById("root"));
-root.render(
- <Provider store={store}>
- <DndProvider options={HTML5toTouch}>
- <Preview>{generatePreview}</Preview>
- <App />
- </DndProvider>
- </Provider>
-);
diff --git a/apps/OpenSign/src/assets/images/blackPen.png b/apps/OpenSign/src/assets/images/blackPen.png
new file mode 100644
index 000000000..2d72bcaca
Binary files /dev/null and b/apps/OpenSign/src/assets/images/blackPen.png differ
diff --git a/apps/OpenSign/src/assets/images/bluePen.png b/apps/OpenSign/src/assets/images/bluePen.png
new file mode 100644
index 000000000..a08e74078
Binary files /dev/null and b/apps/OpenSign/src/assets/images/bluePen.png differ
diff --git a/apps/OpenSign/src/assets/images/certificate.png b/apps/OpenSign/src/assets/images/certificate.png
new file mode 100644
index 000000000..177ee5b0b
Binary files /dev/null and b/apps/OpenSign/src/assets/images/certificate.png differ
diff --git a/apps/OpenSign/src/assets/images/draftDoc1.png b/apps/OpenSign/src/assets/images/draftDoc1.png
new file mode 100644
index 000000000..2a2b8f60f
Binary files /dev/null and b/apps/OpenSign/src/assets/images/draftDoc1.png differ
diff --git a/apps/OpenSign/src/assets/images/folder.png b/apps/OpenSign/src/assets/images/folder.png
new file mode 100644
index 000000000..1520d8092
Binary files /dev/null and b/apps/OpenSign/src/assets/images/folder.png differ
diff --git a/apps/OpenSign/src/assets/images/loader2.gif b/apps/OpenSign/src/assets/images/loader2.gif
new file mode 100644
index 000000000..a32521144
Binary files /dev/null and b/apps/OpenSign/src/assets/images/loader2.gif differ
diff --git a/apps/OpenSign/src/assets/images/newCeleb.gif b/apps/OpenSign/src/assets/images/newCeleb.gif
new file mode 100644
index 000000000..c0b0d9555
Binary files /dev/null and b/apps/OpenSign/src/assets/images/newCeleb.gif differ
diff --git a/apps/OpenSign/src/assets/images/open-sign-logo.png b/apps/OpenSign/src/assets/images/open-sign-logo.png
new file mode 100644
index 000000000..8db538124
Binary files /dev/null and b/apps/OpenSign/src/assets/images/open-sign-logo.png differ
diff --git a/apps/OpenSign/src/assets/images/pdf3.png b/apps/OpenSign/src/assets/images/pdf3.png
new file mode 100644
index 000000000..54868d5e8
Binary files /dev/null and b/apps/OpenSign/src/assets/images/pdf3.png differ
diff --git a/apps/OpenSign/src/assets/images/redPen.png b/apps/OpenSign/src/assets/images/redPen.png
new file mode 100644
index 000000000..87d05fdaf
Binary files /dev/null and b/apps/OpenSign/src/assets/images/redPen.png differ
diff --git a/apps/OpenSign/src/components/RenderDebugPdf.js b/apps/OpenSign/src/components/RenderDebugPdf.js
new file mode 100644
index 000000000..21dd8ee48
--- /dev/null
+++ b/apps/OpenSign/src/components/RenderDebugPdf.js
@@ -0,0 +1,84 @@
+import React from "react";
+import { Document, Page } from "react-pdf";
+import { Stage, Layer, Rect } from "react-konva";
+const RenderDebugPdf = (props) => {
+ return (
+ <div>
+ <div
+ style={{
+ position: "sticky",
+ top: 0,
+ padding: 10,
+ zIndex: 1,
+ backgroundColor: "white",
+ border: "1px solid grey",
+ margin: "5px 0"
+ }}
+ >
+ {`Co-ordinates: X - ${props.hoverCoordinates.x}, Y - ${props.hoverCoordinates.y}`}
+ </div>
+ <div
+ style={{
+ flex: 1,
+ position: "relative",
+ border: "1px solid grey",
+ overflow: "auto"
+ }}
+ onMouseMove={props.handleMouseMoveDiv}
+ >
+ <Document
+ onLoadError={() => {
+ const load = {
+ status: false,
+ type: "failed"
+ };
+ props.setPdfLoadFail(load);
+ }}
+ loading={"Loading Document.."}
+ onLoadSuccess={props.pageDetails}
+ ref={props.pdfRef}
+ file={props.pdfUrl}
+ >
+ <Page
+ onLoadSuccess={props.handlePageLoadSuccess}
+ pageNumber={props.pageNumber}
+ renderAnnotationLayer={false}
+ renderTextLayer={false}
+ onGetAnnotationsError={(error) => {
+ console.log("annotation error", error);
+ }}
+ />
+ </Document>
+
+ <Stage
+ onMouseMove={props.handleMouseMove}
+ onMouseDown={props.handleMouseDown}
+ onMouseUp={props.handleMouseUp}
+ width={props.pdfDimension.width}
+ height={props.pdfDimension.height}
+ style={{ position: "absolute", top: 0, left: 0 }}
+ >
+ <Layer>
+ {props.annotations
+ .filter((value) => value.page === props.pageNumber)
+ .map((value) => {
+ return (
+ <Rect
+ key={value.key}
+ x={value.x}
+ y={value.y}
+ width={value.width}
+ height={value.height}
+ fill="transparent"
+ stroke="black"
+ />
+ );
+ })}
+ </Layer>
+ </Stage>
+ </div>
+ </div>
+ );
+};
+
+export default RenderDebugPdf;
diff --git a/apps/OpenSign/src/components/ReportMicroapp.js b/apps/OpenSign/src/components/ReportMicroapp.js
deleted file mode 100644
index f995068ae..000000000
--- a/apps/OpenSign/src/components/ReportMicroapp.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import useFederatedComponent from "mf-cra";
-import React, { Suspense, useEffect } from "react";
-import { useParams } from "react-router-dom";
-
-const MicroappModal = () => {
- const { remoteApp } = useParams();
-
- useEffect(() => {
- return () => localStorage.removeItem("rowlevel");
- }, []);
- let paramString = remoteApp;
- let queryString = new URLSearchParams(paramString);
- let obj = {};
- for (const [key, value] of queryString.entries()) {
- // console.log("value ", key + ":" + value);
-
- if (key === "remoteUrl") {
- const url = window.location.origin + "/mfbuild/remoteEntry.js";
- // console.log("atob(value) ", atob(value))
- obj = { ...obj, [key]: url };
- } else {
- if (key === "moduleToLoad") {
- obj = { ...obj, [key]: "./" + value };
- } else {
- obj = { ...obj, [key]: value };
- }
- }
- }
- // console.log("app ", remoteApp);
- const { Component: RemoteComponent } = useFederatedComponent(obj);
- // console.log("RemoteComponent ", RemoteComponent);
- return (
- <div className="w-full h-full flex items-center justify-center ">
- <div className="w-full">
- <Suspense
- fallback={
- <div style={{ height: "300px" }}>
- <div
- style={{
- marginLeft: "45%",
- marginTop: "150px",
- fontSize: "45px",
- color: "#3dd3e0"
- }}
- className="loader-37"
- ></div>
- </div>
- }
- >
- <div
- style={{
- backgroundColor: "#ffffff",
- width: "100%",
- overflow: "hidden",
- minHeight: "50vh"
- }}
- >
- {RemoteComponent && <RemoteComponent />}
- </div>
- </Suspense>
- </div>
- </div>
- );
-};
-
-export default MicroappModal;
diff --git a/apps/OpenSign/src/components/Title.js b/apps/OpenSign/src/components/Title.js
index 1fd108f55..6781b61b4 100644
--- a/apps/OpenSign/src/components/Title.js
+++ b/apps/OpenSign/src/components/Title.js
@@ -1,21 +1,11 @@
import React from "react";
import { Helmet } from "react-helmet";
-function Title(props) {
+function Title({ title, drive }) {
return (
<Helmet>
- <title>{`${props.title} - OpenSignâ„¢`}</title>
- {/* <title>
- {`${localStorage.getItem("appTitle") ? localStorage.getItem("appTitle") : ""} - ${props.title}`}
- </title> */}
- <meta
- name="description"
- content={`${props.title} - OpenSignâ„¢`}
- />
- {/* <meta
- name="description"
- content={`${localStorage.getItem("appTitle")} - ${props.title}`}
- /> */}
+ <title>{drive ? title : `${title} - OpenSignâ„¢`}</title>
+ <meta name="description" content={`${title} - OpenSignâ„¢`} />
<link
rel="icon"
type="image/png"
diff --git a/apps/OpenSign/src/components/opensigndrive/DriveBody.js b/apps/OpenSign/src/components/opensigndrive/DriveBody.js
new file mode 100644
index 000000000..089020646
--- /dev/null
+++ b/apps/OpenSign/src/components/opensigndrive/DriveBody.js
@@ -0,0 +1,768 @@
+import React, { useState, useEffect, useRef } from "react";
+import folder from "../../assets/images/folder.png";
+import "../../styles/opensigndrive.css";
+import draftDoc from "../../assets/images/draftDoc1.png";
+import pdfLogo from "../../assets/images/pdf3.png";
+import axios from "axios";
+import * as ContextMenu from "@radix-ui/react-context-menu";
+import { saveAs } from "file-saver";
+import { useNavigate } from "react-router-dom";
+import Table from "react-bootstrap/Table";
+import * as HoverCard from "@radix-ui/react-hover-card";
+import SelectFolder from "../fields/SelectFolder"; //check this one
+import ModalUi from "../../primitives/ModalUi";
+import { themeColor } from "../../constant/const";
+
+function DriveBody({
+ pdfData,
+ setFolderName,
+ setDocId,
+ setIsLoading,
+ setPdfData,
+ isList,
+ setIsAlert
+}) {
+ const [rename, setRename] = useState("");
+ const [renameValue, setRenameValue] = useState("");
+ const inputRef = useRef(null);
+ const [isOpenMoveModal, setIsOpenMoveModal] = useState(false);
+ const [selectDoc, setSelectDoc] = useState();
+ const [isDeleteDoc, setIsDeleteDoc] = useState(false);
+ const contextMenu = [
+ { type: "Download", icon: "fa-solid fa-arrow-down" },
+ { type: "Rename", icon: "fa-solid fa-font" },
+ { type: "Move", icon: "fa-solid fa-file-export" },
+ { type: "Delete", icon: "fa-solid fa-trash" }
+ ];
+ const navigate = useNavigate();
+
+ //to focus input box on press rename to change doc name
+ useEffect(() => {
+ if (rename && inputRef.current) {
+ setTimeout(() => {
+ inputRef.current.focus();
+ }, 10);
+ }
+ }, [rename]);
+
+ //function to handle folder component
+ const handleOnclikFolder = (data) => {
+ const folderData = {
+ name: data.Name,
+ objectId: data.objectId
+ };
+ setFolderName((prev) => [...prev, folderData]);
+ const loadObj = {
+ isLoad: true,
+ message: "This might take some time"
+ };
+
+ setIsLoading(loadObj);
+ setDocId(data.objectId);
+ };
+ //function for change doc name and update doc name in _document class
+ const handledRenameDoc = async (data) => {
+ setRename("");
+ const trimmedValue = renameValue.trim();
+
+ if (trimmedValue.length > 0) {
+ const updateName = {
+ Name: renameValue
+ };
+ const docId = data.objectId;
+
+ const docData = pdfData;
+
+ const updatedData = docData.map((item) => {
+ if (item.objectId === docId) {
+ // If the item's ID matches the target ID, update the name
+ return { ...item, Name: renameValue };
+ }
+ // If the item's ID doesn't match, keep it unchanged
+ return item;
+ });
+
+ setPdfData(updatedData);
+ await axios
+ .put(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Document/${docId}`,
+ updateName,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then(() => {
+ // const res = result.data;
+ // console.log("res", res);
+ })
+ .catch((err) => {
+ console.log("Err ", err);
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong"
+ });
+ });
+ }
+ };
+
+ //function for navigate user to microapp-signature component
+ const checkPdfStatus = async (data) => {
+ const signerExist = data.Signers && data.Signers;
+ const isDecline = data.IsDeclined && data.IsDeclined;
+ const isPlaceholder = data.Placeholders && data.Placeholders;
+ const signedUrl = data.SignedUrl;
+ //checking if document has completed and request signature flow
+ if (data?.IsCompleted && signerExist?.length > 0) {
+ navigate(`/pdfRequestFiles/${data.objectId}`);
+ }
+ //checking if document has completed and signyour-self flow
+ else if (!signerExist && !isPlaceholder) {
+ navigate(`/signaturePdf/${data.objectId}`);
+ }
+ //checking if document has declined by someone
+ else if (isDecline) {
+ navigate(`/pdfRequestFiles/${data.objectId}`);
+ //checking draft type document
+ } else if (
+ signerExist?.length > 0 &&
+ isPlaceholder?.length > 0 &&
+ !signedUrl
+ ) {
+ navigate(`/placeHolderSign/${data.objectId}`);
+ }
+ //Inprogress document
+ else if (isPlaceholder?.length > 0 && signerExist?.length > 0) {
+ navigate(`/pdfRequestFiles/${data.objectId}`);
+ } //placeholder draft document
+ else if (
+ (signerExist?.length > 0 &&
+ (!isPlaceholder || isPlaceholder?.length === 0)) ||
+ ((!signerExist || signerExist?.length === 0) && isPlaceholder?.length > 0)
+ ) {
+ navigate(`/placeHolderSign/${data.objectId}`);
+ }
+ };
+
+ const handleMenuItemClick = (selectType, data) => {
+ switch (selectType) {
+ case "Download": {
+ const pdfName = data && data.Name;
+ const pdfUrl = data && data.SignedUrl ? data.SignedUrl : data.URL;
+ saveAs(pdfUrl, `${sanitizeFileName(pdfName)}_signed_by_OpenSignâ„¢.pdf`);
+ break;
+ }
+ case "Rename": {
+ setRenameValue(data.Name);
+ setRename(data.objectId);
+ break;
+ }
+ case "Delete": {
+ setIsDeleteDoc(true);
+ setSelectDoc(data);
+ break;
+ }
+ case "Move": {
+ handleMoveDocument(data);
+ break;
+ }
+ default:
+ null;
+ }
+ };
+ //function for delete document
+ const handleDeleteDocument = async (docData) => {
+ setIsDeleteDoc(false);
+ const docId = docData.objectId;
+ const data = {
+ IsArchive: true
+ };
+
+ await axios
+ .put(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Document/${docId}`,
+ data,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then((result) => {
+ const res = result.data;
+ if (res) {
+ const updatedData = pdfData.filter((x) => x.objectId !== docId);
+ setPdfData(updatedData);
+ }
+ })
+ .catch((err) => {
+ console.log("Err ", err);
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong"
+ });
+ });
+ };
+ const handleMoveDocument = async (docData) => {
+ setIsOpenMoveModal(true);
+ setSelectDoc(docData);
+ };
+ //function for move document from one folder to another folder
+ const handleMoveFolder = async (selectFolderData) => {
+ const selecFolderId = selectDoc?.Folder?.objectId;
+ const moveFolderId = selectFolderData?.ObjectId;
+ let updateDocId = selectDoc?.objectId;
+ let updateData;
+ const checkExist = moveFolderId
+ ? selecFolderId === moveFolderId
+ ? true
+ : false
+ : selecFolderId
+ ? false
+ : true;
+ if (!checkExist) {
+ if (moveFolderId) {
+ updateData = {
+ Folder: {
+ __type: "Pointer",
+ className: `${localStorage.getItem("_appName")}_Document`,
+ objectId: moveFolderId
+ }
+ };
+ } else {
+ updateData = {
+ Folder: { __op: "Delete" }
+ };
+ }
+
+ await axios
+ .put(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Document/${updateDocId}`,
+ updateData,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ )
+
+ .then((Listdata) => {
+ // console.log("Listdata ", Listdata);
+ const res = Listdata.data;
+ if (res) {
+ const updatedData = pdfData.filter(
+ (x) => x.objectId !== updateDocId
+ );
+ setPdfData(updatedData);
+ }
+ })
+ .catch((err) => {
+ console.log("err", err);
+ });
+
+ setIsOpenMoveModal(false);
+ } else {
+ alert("folder already exist!");
+ setIsOpenMoveModal(false);
+ }
+ };
+
+ const sanitizeFileName = (pdfName) => {
+ // Replace spaces with underscore
+ return pdfName.replace(/ /g, "_");
+ };
+
+ const handleEnterPress = (e, data) => {
+ if (e.key === "Enter") {
+ handledRenameDoc(data);
+ }
+ };
+
+ const handleDraftDoc = (data) => {
+ navigate(`/legagenie?${data.objectId}`);
+ };
+
+ //component to handle type of document and render according to type
+ const handleFolderData = (data, ind, listType) => {
+ let createddate, status, isDecline, signerExist, isComplete, isPlaceholder;
+ if (data.Type !== "Folder") {
+ const expireDate = data.ExpiryDate && data.ExpiryDate.iso;
+ const createdDate = data.createdAt && data.createdAt;
+ createddate = new Date(createdDate).toLocaleDateString();
+ isComplete = data.IsCompleted && data.IsCompleted ? true : false;
+ isDecline = data.IsDeclined && data.IsDeclined;
+ isPlaceholder = data.Placeholders && data.Placeholders;
+ signerExist = data.Signers && data.Signers;
+ const signedUrl = data.SignedUrl;
+
+ const expireUpdateDate = new Date(expireDate).getTime();
+ const currDate = new Date().getTime();
+ let isExpire = false;
+ if (currDate > expireUpdateDate) {
+ isExpire = true;
+ }
+
+ if (isComplete) {
+ status = "Completed";
+ } else if (isDecline) {
+ status = "Declined";
+ } else if (!signerExist || signerExist?.length === 0) {
+ status = "Draft";
+ } else if (
+ signerExist?.length > 0 &&
+ (!isPlaceholder || isPlaceholder?.length === 0)
+ ) {
+ status = "Draft";
+ } else if (
+ signerExist?.length > 0 &&
+ isPlaceholder?.length > 0 &&
+ !signedUrl
+ ) {
+ status = "Draft";
+ } else if (isExpire) {
+ status = "Expired";
+ } else {
+ status = "In Progress";
+ }
+ }
+
+ const signersName = () => {
+ const getSignersName = signerExist.map((data) => data.Name);
+ const signerName = getSignersName.join(",");
+
+ return (
+ <span
+ className="statusSpan"
+ style={{ width: "90%", wordWrap: "break-word" }}
+ >
+ {signerName}{" "}
+ </span>
+ );
+ };
+ return listType === "table" ? (
+ data.Type === "Folder" ? (
+ <tr onClick={() => handleOnclikFolder(data)}>
+ <td
+ style={{ cursor: "pointer", display: "flex", alignItems: "center" }}
+ >
+ <i
+ className="fa fa-folder"
+ aria-hidden="true"
+ style={{ color: "#f0ad26", marginRight: "8px", fontSize: "26px" }}
+ ></i>
+
+ <span style={{ fontSize: "12px", fontWeight: "500" }}>
+ {data.Name}
+ </span>
+ </td>
+ <td>_</td>
+ <td>Folder</td>
+ <td>_</td>
+ <td>_</td>
+ </tr>
+ ) : data.Type === "AIDoc" ? (
+ <tr onClick={() => handleDraftDoc(data)}>
+ <td
+ style={{ cursor: "pointer", display: "flex", alignItems: "center" }}
+ >
+ <i
+ className="fa fa-file-text"
+ style={{ color: "#0ea3ed", marginRight: "8px", fontSize: "26px" }}
+ ></i>
+
+ <span style={{ fontSize: "12px", fontWeight: "500" }}>
+ {data.Name}
+ </span>
+ </td>
+ <td>{createddate}</td>
+ <td>LegaGenie Draft</td>
+ <td>_</td>
+ <td>_</td>
+ </tr>
+ ) : (
+ <tr onClick={() => checkPdfStatus(data)}>
+ <td
+ style={{ cursor: "pointer", display: "flex", alignItems: "center" }}
+ >
+ <i
+ className="fa fa-file-pdf"
+ style={{ color: "#ed4d0e", marginRight: "8px", fontSize: "26px" }}
+ ></i>
+
+ <span style={{ fontSize: "12px", fontWeight: "500" }}>
+ {data.Name}
+ </span>
+ </td>
+ <td>{createddate}</td>
+ <td>Pdf</td>
+ <td>{status}</td>
+ <td>
+ <i
+ onClick={(e) => {
+ e.stopPropagation();
+ handleMenuItemClick("Download", data);
+ }}
+ className="fa fa-download"
+ aria-hidden="true"
+ style={{ color: "#ed280e", marginRight: "8px" }}
+ ></i>
+ </td>
+ </tr>
+ )
+ ) : listType === "list" && data.Type === "Folder" ? (
+ <div key={ind} className="folderBox">
+ <ContextMenu.Root>
+ <ContextMenu.Trigger className="ContextMenuTrigger">
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column",
+ cursor: "pointer"
+ }}
+ >
+ <img
+ alt="no img"
+ onClick={() => handleOnclikFolder(data)}
+ src={folder}
+ width={100}
+ height={103}
+ />
+ {rename === data.objectId ? (
+ <input
+ onFocus={() => {
+ inputRef.current.setSelectionRange(0, 0);
+ const input = inputRef.current;
+ if (input) {
+ input.select();
+ }
+ }}
+ autoFocus={true}
+ type="text"
+ onBlur={() => handledRenameDoc(data)}
+ onKeyDown={(e) => handleEnterPress(e, data)}
+ ref={inputRef}
+ defaultValue={renameValue}
+ // value={renameValue}
+ onChange={(e) => setRenameValue(e.target.value)}
+ style={{
+ width: "100px",
+ border: "1.5px solid black",
+ borderRadius: "2px",
+ fontSize: "10px"
+ }}
+ />
+ ) : (
+ <span className="foldName">{data.Name}</span>
+ )}
+ </div>
+ </ContextMenu.Trigger>
+
+ <ContextMenu.Portal>
+ <ContextMenu.Content
+ className="ContextMenuContent"
+ sideOffset={5}
+ align="end"
+ >
+ <ContextMenu.Item
+ onClick={() => handleMenuItemClick("Rename", data)}
+ className="ContextMenuItem"
+ >
+ <i className="fa-solid fa-font"></i>
+ <span style={{ marginLeft: "8px" }}>Rename</span>
+ </ContextMenu.Item>
+ </ContextMenu.Content>
+ </ContextMenu.Portal>
+ </ContextMenu.Root>
+ </div>
+ ) : data.Type === "AIDoc" ? (
+ <div key={ind} className="folderBox">
+ <ContextMenu.Root>
+ <ContextMenu.Trigger className="ContextMenuTrigger">
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column",
+ cursor: "pointer"
+ }}
+ >
+ <img
+ alt="no img"
+ onClick={() => handleDraftDoc(data)}
+ src={draftDoc}
+ width={100}
+ height={103}
+ />
+ {rename === data.objectId ? (
+ <input
+ onFocus={() => {
+ inputRef.current.setSelectionRange(0, 0);
+ const input = inputRef.current;
+ if (input) {
+ input.select();
+ }
+ }}
+ autoFocus={true}
+ type="text"
+ onBlur={() => handledRenameDoc(data)}
+ onKeyDown={(e) => handleEnterPress(e, data)}
+ ref={inputRef}
+ defaultValue={renameValue}
+ // value={renameValue}
+ onChange={(e) => setRenameValue(e.target.value)}
+ style={{
+ width: "100px",
+ border: "1.5px solid black",
+ borderRadius: "2px",
+ fontSize: "10px"
+ }}
+ />
+ ) : (
+ <span className="foldName">{data.Name}</span>
+ )}
+ </div>
+ </ContextMenu.Trigger>
+
+ <ContextMenu.Portal>
+ <ContextMenu.Content
+ className="ContextMenuContent"
+ sideOffset={5}
+ align="end"
+ >
+ <ContextMenu.Item
+ onClick={() => handleMenuItemClick("Rename", data)}
+ className="ContextMenuItem"
+ >
+ <i className="fa-solid fa-font"></i>
+ <span style={{ marginLeft: "8px" }}>Rename</span>
+ </ContextMenu.Item>
+ </ContextMenu.Content>
+ </ContextMenu.Portal>
+ </ContextMenu.Root>
+ </div>
+ ) : (
+ <HoverCard.Root openDelay={0} closeDelay={100}>
+ <HoverCard.Trigger asChild>
+ <div>
+ <ContextMenu.Root>
+ <div className="icon-container">
+ <ContextMenu.Trigger className="ContextMenuTrigger">
+ <img
+ alt="PDF"
+ className="pdf-icon"
+ src={pdfLogo}
+ onClick={() => checkPdfStatus(data)}
+ />
+ {rename === data.objectId ? (
+ <input
+ autoFocus={true}
+ type="text"
+ onFocus={() => {
+ inputRef.current.setSelectionRange(0, 0);
+ const input = inputRef.current;
+ if (input) {
+ input.select();
+ }
+ }}
+ onBlur={() => handledRenameDoc(data)}
+ onKeyDown={(e) => handleEnterPress(e, data)}
+ ref={inputRef}
+ defaultValue={renameValue}
+ // value={renameValue}
+ onChange={(e) => setRenameValue(e.target.value)}
+ style={{
+ width: "100px",
+ border: "1.5px solid black",
+ borderRadius: "2px",
+ fontSize: "10px"
+ }}
+ />
+ ) : (
+ <span className="fileName">{data.Name}</span>
+ )}
+ </ContextMenu.Trigger>
+ {status === "Completed" ? (
+ <div className="status-badge completed">
+ <i className="fas fa-check-circle"></i>
+ </div>
+ ) : status === "Declined" ? (
+ <div className="status-badge declined">
+ <i className="fa fa-thumbs-down"></i>
+ </div>
+ ) : status === "Expired" ? (
+ <div className="status-badge expired">
+ <i className="fa fa-hourglass-end"></i>
+ </div>
+ ) : status === "Draft" ? (
+ <div className="status-badge draft">
+ <i className="fa fa-file"></i>
+ </div>
+ ) : (
+ status === "In Progress" && (
+ <div className="status-badge in-progress">
+ <i className="fa fa-paper-plane"></i>
+ </div>
+ )
+ )}
+ </div>
+
+ <ContextMenu.Portal>
+ <ContextMenu.Content
+ className="ContextMenuContent"
+ sideOffset={5}
+ align="end"
+ >
+ {contextMenu.map((menu, ind) => {
+ return (
+ <ContextMenu.Item
+ key={ind}
+ onClick={() => handleMenuItemClick(menu.type, data)}
+ className="ContextMenuItem"
+ >
+ <i className={menu.icon}></i>
+ <span style={{ marginLeft: "8px" }}>{menu.type}</span>
+ </ContextMenu.Item>
+ );
+ })}
+ </ContextMenu.Content>
+ </ContextMenu.Portal>
+ </ContextMenu.Root>
+ </div>
+ </HoverCard.Trigger>
+ <HoverCard.Portal>
+ <HoverCard.Content className="HoverCardContent" sideOffset={5}>
+ <strong style={{ fontSize: "13px" }}>Title: </strong>
+ <span className="statusSpan" style={{ marginBottom: "0px" }}>
+ {" "}
+ {data.Name}
+ </span>
+ <br />
+ <strong style={{ fontSize: "13px" }}>Status: </strong>
+ <span className="statusSpan"> {status}</span>
+ <br />
+ <strong style={{ fontSize: "13px" }}>Created Date: </strong>
+ <span className="statusSpan">{createddate}</span>
+ <br />
+ {signerExist && (
+ <>
+ <strong style={{ fontSize: "13px" }}>Signers: </strong>
+ {/* <span className="statusSpan">kjefjjnejkfnkbjs bbfjkdsbjbfjkbjk kscbjkbjkb</span> */}
+ {signersName()}
+ </>
+ )}
+
+ <HoverCard.Arrow className="HoverCardArrow" />
+ </HoverCard.Content>
+ </HoverCard.Portal>
+ </HoverCard.Root>
+ );
+ };
+
+ //component to handle type of document and render according to type
+ return (
+ <>
+ {isList ? (
+ <div className="container" style={{ overflowX: "auto" }}>
+ <Table striped bordered hover>
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Created Date</th>
+ <th>Type</th>
+ <th>Status</th>
+ <th>Action</th>
+ </tr>
+ </thead>
+ <tbody>
+ {pdfData.map((data, ind) => {
+ return (
+ <React.Fragment key={ind}>
+ {handleFolderData(data, ind, "table")}
+ </React.Fragment>
+ );
+ })}
+ </tbody>
+ </Table>
+ </div>
+ ) : (
+ <div className="pdfContainer">
+ {pdfData.map((data, ind) => {
+ return (
+ <div className="box" key={ind}>
+ {handleFolderData(data, ind, "list")}
+ </div>
+ );
+ })}
+ </div>
+ )}
+ {isOpenMoveModal && (
+ <SelectFolder
+ onSuccess={handleMoveFolder}
+ isOpenModal={isOpenMoveModal}
+ folderCls={"contracts_Document"}
+ setIsOpenMoveModal={setIsOpenMoveModal}
+ setPdfData={setPdfData}
+ />
+ )}
+ <ModalUi
+ isOpen={isDeleteDoc}
+ headerColor={themeColor}
+ title={"Delete Document"}
+ handleClose={() => {
+ setIsDeleteDoc(false);
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>Are you sure you want to delete this document?</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+
+ <button
+ onClick={() => {
+ handleDeleteDocument(selectDoc);
+ }}
+ style={{
+ background: themeColor,
+ color: "white"
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Yes
+ </button>
+ <button
+ onClick={() => {
+ setIsDeleteDoc(false);
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ No
+ </button>
+ </div>
+ </ModalUi>
+ </>
+ );
+}
+
+export default DriveBody;
diff --git a/apps/OpenSign/src/components/pdf/BorderResize.js b/apps/OpenSign/src/components/pdf/BorderResize.js
new file mode 100644
index 000000000..505c68d30
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/BorderResize.js
@@ -0,0 +1,17 @@
+import React from "react";
+
+function BorderResize({ right, top }) {
+ return (
+ <div
+ className="borderResize"
+ style={{
+ right: right ? right + "px" : "-1px",
+ bottom: top ? top + "px" : "-1px",
+ borderRight: "3px solid #188ae2",
+ borderBottom: "3px solid #188ae2"
+ }}
+ ></div>
+ );
+}
+
+export default BorderResize;
diff --git a/apps/OpenSign/src/components/pdf/Certificate.js b/apps/OpenSign/src/components/pdf/Certificate.js
new file mode 100644
index 000000000..1885bdd58
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/Certificate.js
@@ -0,0 +1,277 @@
+import React, { useEffect, useState } from "react";
+import "../../styles/certificate.css";
+import opensignLogo from "../../assets/images/open-sign-logo.png";
+import {
+ Page,
+ Text,
+ View,
+ Document,
+ StyleSheet,
+ Image
+} from "@react-pdf/renderer";
+
+function Certificate({ pdfData }) {
+ const [isMultiSigners, setIsMultiSigners] = useState();
+ const [multiSigner, setMultiSigners] = useState([]);
+ const [isLoad, setIsLoad] = useState(false);
+
+ useEffect(() => {
+ handleSignerData();
+ // eslint-disable-next-line
+ }, []);
+
+ const handleSignerData = () => {
+ const checkSigners = pdfData.filter((data) => data.Signers);
+ if (checkSigners && checkSigners.length > 0) {
+ setIsMultiSigners(true);
+
+ const checkSignSigners =
+ pdfData[0].AuditTrail &&
+ pdfData[0].AuditTrail.length > 0 &&
+ pdfData[0].AuditTrail.filter((data) => data.Activity === "Signed");
+
+ setMultiSigners(checkSignSigners);
+ } else {
+ setIsMultiSigners(false);
+ }
+ setIsLoad(true);
+ };
+
+ const styles = StyleSheet.create({
+ page: {
+ borderRadius: "5px",
+ padding: "10px",
+ backgroundColor: "white"
+ },
+ section1: {
+ border: "1px solid rgb(177, 174, 174)",
+ padding: "20px"
+ },
+ textStyle: {
+ fontWeight: "bold",
+ fontSize: "11px",
+ marginBottom: "10px"
+ },
+ textStyle2: {
+ fontWeight: "600",
+ fontSize: "11px",
+ marginBottom: "10px",
+ color: "gray"
+ },
+ image: {
+ width: "71px",
+ height: "17px"
+ }
+ });
+
+ const generatedDate = () => {
+ const newDate = new Date();
+ const utcTime = newDate.toUTCString();
+
+ return (
+ <Text
+ style={{
+ color: "gray",
+ fontSize: "10px"
+ }}
+ >
+ Generated On {utcTime}
+ </Text>
+ );
+ };
+ const changeCompletedDate = () => {
+ const completedOn = pdfData[0].updatedAt;
+ const newDate = new Date(completedOn);
+ const utcTime = newDate.toUTCString();
+
+ return <Text style={styles.textStyle2}>{utcTime}</Text>;
+ };
+
+ const signerName = (data) => {
+ const getSignerName = pdfData[0].Signers.filter(
+ (sign) => sign.objectId === data.UserPtr.objectId
+ );
+
+ return (
+ getSignerName[0] &&
+ getSignerName.length > 0 && (
+ <>
+ <Text style={styles.textStyle}>
+ Name : &nbsp;
+ <Text style={styles.textStyle2}>{getSignerName[0].Name}</Text>
+ </Text>
+ <Text style={styles.textStyle}>
+ Email : &nbsp;
+ <Text style={styles.textStyle2}>{getSignerName[0].Email}</Text>
+ </Text>
+ </>
+ )
+ );
+ };
+
+ return (
+ isLoad && (
+ <Document>
+ {/** Page defines a single page of content. */}
+ <Page size="A4" style={styles.page}>
+ <View style={styles.section1}>
+ <View
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ alignItems: "center",
+ marginBottom: "30px"
+ }}
+ >
+ <Image src={opensignLogo} style={styles.image} />
+ {generatedDate()}
+ </View>
+
+ <View style={{ justifyContent: "center" }}>
+ <Text
+ style={{
+ textAlign: "center",
+ fontSize: "20px",
+ fontWeight: "bold",
+ color: "#31bceb",
+ marginBottom: "10px"
+ }}
+ >
+ {" "}
+ Certificate of Completion
+ </Text>
+ <View style={{ border: "1px solid #bdbbbb" }}></View>
+ <View>
+ <View>
+ <Text
+ style={{
+ fontSize: "16px",
+ fontWeight: "bold",
+ color: "#31bceb",
+ margin: "10px 0px 10px 0px"
+ }}
+ >
+ Summary
+ </Text>
+ </View>
+ <View style={{ display: "flex", flexDirection: "column" }}>
+ <Text style={styles.textStyle}>
+ Document ID : &nbsp;
+ <Text style={styles.textStyle2}>{pdfData[0].objectId}</Text>
+ </Text>
+ <Text style={styles.textStyle}>
+ Document Name : &nbsp;
+ <Text style={styles.textStyle2}>{pdfData[0].Name}</Text>
+ </Text>
+ <Text style={styles.textStyle}>
+ Organization : &nbsp;
+ <Text style={styles.textStyle2}>
+ {pdfData[0].ExtUserPtr.Company}
+ </Text>
+ </Text>
+ <Text style={styles.textStyle}>
+ Completed on : &nbsp;{changeCompletedDate()}
+ </Text>
+ {multiSigner && multiSigner.length > 0 && (
+ <Text style={styles.textStyle}>
+ Signers : &nbsp;
+ <Text style={styles.textStyle2}>
+ {multiSigner.length}
+ </Text>
+ </Text>
+ )}
+ </View>
+ {isMultiSigners ? (
+ <View style={{ display: "flex", flexDirection: "column" }}>
+ <Text
+ style={{
+ fontSize: "16px",
+ fontWeight: "bold",
+ color: "#31bceb",
+ margin: "10px 0px 10px 0px"
+ }}
+ >
+ Recipients
+ </Text>
+
+ <View>
+ {multiSigner &&
+ multiSigner.map((data, ind) => {
+ return (
+ <View
+ key={ind}
+ style={{
+ display: "flex",
+ flexDirection: "column"
+ }}
+ >
+ <View
+ style={{
+ border: "0.4px solid #bdbbbb",
+ marginBottom: "10px"
+ }}
+ ></View>
+ {signerName(data)}
+
+ <Text style={styles.textStyle}>
+ Accessed from : &nbsp;
+ <Text style={styles.textStyle2}>
+ {data.ipAddress}
+ </Text>
+ </Text>
+ </View>
+ );
+ })}
+ </View>
+ </View>
+ ) : (
+ <View style={{ display: "flex", flexDirection: "column" }}>
+ <Text
+ style={{
+ fontSize: "16px",
+ fontWeight: "bold",
+ color: "#31bceb",
+ margin: "10px 0px 10px 0px"
+ }}
+ >
+ Recipients
+ </Text>
+ <Text style={styles.textStyle}>
+ Signers : &nbsp;<Text style={styles.textStyle2}>1</Text>
+ </Text>
+ <Text style={styles.textStyle}>
+ Name : &nbsp;
+ <Text style={styles.textStyle2}>
+ {pdfData[0].ExtUserPtr.Name}
+ </Text>
+ </Text>
+ <Text style={styles.textStyle}>
+ Email : &nbsp;
+ <Text style={styles.textStyle2}>
+ {pdfData[0].ExtUserPtr.Email}
+ </Text>
+ </Text>
+ <Text style={styles.textStyle}>
+ Accessed from : &nbsp;
+ <Text style={styles.textStyle2}>
+ {pdfData[0].AuditTrail &&
+ pdfData[0].AuditTrail[0].ipAddress}
+ </Text>
+ </Text>
+
+ <Text style={styles.textStyle}>
+ Signed on : &nbsp;{changeCompletedDate()}
+ </Text>
+ </View>
+ )}
+ </View>
+ </View>
+ </View>
+ </Page>
+ </Document>
+ )
+ );
+}
+
+export default Certificate;
diff --git a/apps/OpenSign/src/components/pdf/DefaultSignature.js b/apps/OpenSign/src/components/pdf/DefaultSignature.js
new file mode 100644
index 000000000..a440e807e
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/DefaultSignature.js
@@ -0,0 +1,74 @@
+import React from "react";
+import { themeColor } from "../../constant/const";
+function DefaultSignature({ defaultSignImg, xyPostion, setDefaultSignAlert }) {
+ const confirmToaddDefaultSign = () => {
+ if (xyPostion.length > 0) {
+ setDefaultSignAlert({
+ isShow: true,
+ alertMessage:
+ "Are you sure you want to auto sign at requested all locations?"
+ });
+ } else {
+ setDefaultSignAlert({
+ isShow: true,
+ alertMessage: "please select position!"
+ });
+ }
+ };
+
+ return (
+ <div>
+ <div
+ style={{
+ background: themeColor,
+ color: "white",
+ padding: "5px",
+ fontFamily: "sans-serif",
+ marginTop: "5px"
+ }}
+ >
+ Signature
+ </div>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column",
+ alignItems: "center",
+ marginTop: "10px",
+ fontWeight: "600"
+ }}
+ >
+ <>
+ <p>Your Signature</p>
+ <div className="defaultSignBox">
+ <img
+ alt="default img"
+ style={{
+ width: "100%",
+ height: "100%",
+ objectFit: "contain"
+ }}
+ src={defaultSignImg}
+ />
+ </div>
+ <button
+ style={{
+ background: themeColor,
+ color: "white",
+ marginTop: "20px",
+ cursor: "pointer",
+ marginBottom: "10px"
+ }}
+ type="button"
+ className="finishBtn finishnHover"
+ onClick={() => confirmToaddDefaultSign()}
+ >
+ Auto Sign All
+ </button>
+ </>
+ </div>
+ </div>
+ );
+}
+
+export default DefaultSignature;
diff --git a/apps/OpenSign/src/components/pdf/DraftDocument.js b/apps/OpenSign/src/components/pdf/DraftDocument.js
new file mode 100644
index 000000000..6decadf5b
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/DraftDocument.js
@@ -0,0 +1,97 @@
+import React, { useEffect, useState } from "react";
+import { useNavigate } from "react-router-dom";
+import Loader from "./Loader";
+import { contractDocument } from "../../constant/Utils";
+import HandleError from "../../primitives/HandleError";
+function DraftDocument() {
+ const navigate = useNavigate();
+ const [isLoading, setIsLoading] = useState({
+ isLoader: true,
+ message: "This might take some time"
+ });
+
+ const rowLevel =
+ localStorage.getItem("rowlevel") &&
+ JSON.parse(localStorage.getItem("rowlevel"));
+ const docId =
+ rowLevel && rowLevel?.id
+ ? rowLevel.id
+ : rowLevel?.objectId && rowLevel.objectId;
+
+ useEffect(() => {
+ getDocumentDetails();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+ //get document details
+ const getDocumentDetails = async () => {
+ //getting document details
+ const documentData = await contractDocument(docId);
+ if (documentData && documentData.length > 0) {
+ handleDraftDoc(documentData);
+ } else if (
+ documentData === "Error: Something went wrong!" ||
+ (documentData.result && documentData.result.error)
+ ) {
+ setIsLoading({
+ isLoader: false,
+ message: "Error: Something went wrong!"
+ });
+ } else {
+ setIsLoading({
+ isLoader: false,
+ message: "No data found!"
+ });
+ }
+ };
+
+ //check document type and render on signyour self and placeholder route
+ const handleDraftDoc = (documentData) => {
+ const data = documentData[0];
+ const signerExist = data.Signers && data.Signers;
+ const isDecline = data.IsDeclined && data.IsDeclined;
+ const isPlaceholder = data.Placeholders && data.Placeholders;
+ const signedUrl = data.SignedUrl;
+ //checking if document has completed and request signature flow
+ if (data?.IsCompleted && signerExist?.length > 0) {
+ navigate(`/pdfRequestFiles/${data.objectId}`);
+ }
+ //checking if document has completed and signyour-self flow
+ else if (!signerExist && !isPlaceholder) {
+ navigate(`/signaturePdf/${data.objectId}`);
+ }
+ //checking if document has declined by someone
+ else if (isDecline) {
+ navigate(`/pdfRequestFiles/${data.objectId}`);
+ //checking draft type document
+ } else if (
+ signerExist?.length > 0 &&
+ isPlaceholder?.length > 0 &&
+ !signedUrl
+ ) {
+ navigate(`/placeHolderSign/${data.objectId}`);
+ }
+ //Inprogress document
+ else if (isPlaceholder?.length > 0 && signerExist?.length > 0) {
+ navigate(`/pdfRequestFiles/${data.objectId}`);
+ } //placeholder draft document
+ else if (
+ (signerExist?.length > 0 &&
+ (!isPlaceholder || isPlaceholder?.length === 0)) ||
+ ((!signerExist || signerExist?.length === 0) && isPlaceholder?.length > 0)
+ ) {
+ navigate(`/placeHolderSign/${data.objectId}`);
+ }
+ };
+
+ return (
+ <div>
+ {isLoading.isLoader ? (
+ <Loader isLoading={isLoading} />
+ ) : (
+ <HandleError handleError={isLoading.message} />
+ )}
+ </div>
+ );
+}
+
+export default DraftDocument;
diff --git a/apps/OpenSign/src/components/pdf/DragElement.js b/apps/OpenSign/src/components/pdf/DragElement.js
new file mode 100644
index 000000000..e8bcfed52
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/DragElement.js
@@ -0,0 +1,13 @@
+import React from "react";
+import { getWidgetType, widgets } from "../../constant/Utils";
+
+function DragElement(item) {
+ const getWidgets = widgets;
+ const filterWidgetPreview = getWidgets.filter(
+ (data) => data.type === item?.text
+ );
+
+ return <div>{getWidgetType(filterWidgetPreview[0])}</div>;
+}
+
+export default DragElement;
diff --git a/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js
new file mode 100644
index 000000000..d9d7a7a6b
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/DropdownWidgetOption.js
@@ -0,0 +1,374 @@
+import React, { useEffect, useState } from "react";
+import { themeColor } from "../../constant/const";
+import ModalUi from "../../primitives/ModalUi";
+function DropdownWidgetOption(props) {
+ const [dropdownOptionList, setDropdownOptionList] = useState([
+ "option-1",
+ "option-2"
+ ]);
+ const [minCount, setMinCount] = useState(0);
+ const [maxCount, setMaxCount] = useState(0);
+ const [dropdownName, setDropdownName] = useState(props.type);
+ const [isReadOnly, setIsReadOnly] = useState(false);
+ const [status, setStatus] = useState("required");
+ const [defaultValue, setDefaultValue] = useState("");
+ const statusArr = ["required", "optional"];
+ const [defaultCheckbox, setDefaultCheckbox] = useState([]);
+
+ useEffect(() => {
+ if (
+ props.currWidgetsDetails?.options?.name &&
+ props.currWidgetsDetails?.options?.values
+ ) {
+ setDropdownName(props.currWidgetsDetails?.options?.name);
+ setDropdownOptionList(props.currWidgetsDetails?.options?.values);
+ setMinCount(
+ props.currWidgetsDetails?.options?.validation?.minRequiredCount
+ );
+ setMaxCount(
+ props.currWidgetsDetails?.options?.validation?.maxRequiredCount
+ );
+ setIsReadOnly(props.currWidgetsDetails?.options?.isReadOnly);
+ setStatus(props.currWidgetsDetails?.options?.status || "required");
+ setDefaultValue(props.currWidgetsDetails?.options?.defaultValue || "");
+ setDefaultCheckbox(props.currWidgetsDetails?.options?.defaultValue || []);
+ } else {
+ setStatus("required");
+ }
+ }, [props.currWidgetsDetails]);
+ const handleInputChange = (index, value) => {
+ setDropdownOptionList((prevInputs) => {
+ const newInputs = [...prevInputs];
+ newInputs[index] = value;
+ return newInputs;
+ });
+ };
+
+ const handleAddInput = () => {
+ const flage = true;
+ setDropdownOptionList((prevInputs) => [...prevInputs, ""]);
+ props.handleSaveWidgetsOptions(null, null, null, null, null, flage, false);
+ };
+
+ const handleDeleteInput = (ind) => {
+ const flage = true;
+ const getUpdatedOptions = dropdownOptionList.filter(
+ (data, index) => index !== ind
+ );
+ setDropdownOptionList(getUpdatedOptions);
+ props.handleSaveWidgetsOptions(null, null, null, null, null, false, flage);
+ };
+
+ const handleSaveOption = () => {
+ const defaultData =
+ defaultCheckbox && defaultCheckbox.length > 0
+ ? defaultCheckbox
+ : defaultValue;
+
+ props.handleSaveWidgetsOptions(
+ dropdownName,
+ dropdownOptionList,
+ minCount,
+ maxCount,
+ isReadOnly,
+ null,
+ null,
+ status,
+ defaultData
+ );
+ props.setShowDropdown(false);
+ setDropdownOptionList(["option-1", "option-2"]);
+ setDropdownName(props.type);
+ props.setCurrWidgetsDetails({});
+ setIsReadOnly(false);
+ setMinCount(0);
+ setMaxCount(0);
+ setDefaultCheckbox([]);
+ setDefaultValue("");
+ };
+
+ const handleSetMinMax = (e) => {
+ const minValue = e.target.value;
+ if (minValue > dropdownOptionList.length) {
+ return "";
+ } else {
+ return minValue;
+ }
+ };
+
+ const handleDefaultCheck = (index) => {
+ const getDefaultCheck = defaultCheckbox.includes(index);
+ if (getDefaultCheck) {
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ return (
+ //props.showDropdown
+ <ModalUi
+ // styleClass={"dropdownModal"}
+ isOpen={props.showDropdown}
+ title={props.title}
+ closeOff={true}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <form
+ onSubmit={(e) => {
+ e.preventDefault();
+ handleSaveOption();
+ }}
+ >
+ <div className="dropdownContainer">
+ {["checkbox", "radio"].includes(props.type) &&
+ !props.isSignYourself && (
+ <div>
+ <input
+ type="checkbox"
+ checked={isReadOnly}
+ onChange={(e) => {
+ setIsReadOnly(e.target.checked);
+ }}
+ />
+
+ <label style={{ marginLeft: "10px" }}>Is read only</label>
+ </div>
+ )}
+ <label style={{ fontSize: "13px", fontWeight: "600" }}>
+ Name<span style={{ color: "red", fontSize: 13 }}> *</span>
+ </label>
+ <input
+ required
+ defaultValue={dropdownName}
+ value={dropdownName}
+ onChange={(e) => setDropdownName(e.target.value)}
+ className="drodown-input"
+ />
+
+ {props.type === "checkbox" && !props.isSignYourself && (
+ <>
+ <label style={{ fontSize: "13px", fontWeight: "600" }}>
+ Minimun check
+ </label>
+ <input
+ required
+ defaultValue={0}
+ value={minCount}
+ onChange={(e) => {
+ const count = handleSetMinMax(e);
+ setMinCount(count);
+ }}
+ className="drodown-input"
+ />
+ <label style={{ fontSize: "13px", fontWeight: "600" }}>
+ Maximum check
+ </label>
+ <input
+ required
+ defaultValue={0}
+ value={maxCount}
+ onChange={(e) => {
+ const count = handleSetMinMax(e);
+ setMaxCount(count);
+ }}
+ className="drodown-input"
+ />
+ </>
+ )}
+ <label
+ style={{ fontSize: "13px", fontWeight: "600", marginTop: "5px" }}
+ >
+ Options
+ </label>
+
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column"
+ }}
+ >
+ {dropdownOptionList.map((option, index) => (
+ <div
+ key={index}
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ marginBottom: "5px",
+ alignItems: "center"
+ }}
+ >
+ {props.type === "checkbox" && !props.isSignYourself && (
+ <input
+ type="checkbox"
+ checked={handleDefaultCheck(index)}
+ onChange={(e) => {
+ if (e.target.checked) {
+ const getDefaultCheck =
+ defaultCheckbox?.includes(index);
+ if (!getDefaultCheck) {
+ setDefaultCheckbox((prev) => [...prev, index]);
+ }
+ } else {
+ const removeOption = defaultCheckbox.filter(
+ (data) => data !== index
+ );
+ setDefaultCheckbox(removeOption);
+ }
+ }}
+ style={{
+ width: "23px",
+ height: "19px",
+ marginRight: "5px"
+ }}
+ />
+ )}
+ <input
+ required
+ className="drodown-input"
+ type="text"
+ value={option}
+ onChange={(e) => handleInputChange(index, e.target.value)}
+ />
+
+ <i
+ className="fa-solid fa-rectangle-xmark"
+ onClick={() => handleDeleteInput(index)}
+ style={{
+ color: "red",
+ fontSize: "25px",
+ marginLeft: "10px"
+ }}
+ ></i>
+ </div>
+ ))}
+
+ <i
+ onClick={handleAddInput}
+ style={{
+ cursor: "pointer",
+ color: themeColor,
+ fontSize: "25px",
+ marginLeft: "10px"
+ }}
+ className="fa-solid fa-square-plus"
+ ></i>
+ </div>
+ {["dropdown", "radio"].includes(props.type) && (
+ <>
+ <label
+ style={{
+ fontSize: "13px",
+ fontWeight: "600",
+ marginTop: "5px"
+ }}
+ >
+ Default value
+ </label>
+ <select
+ onChange={(e) => setDefaultValue(e.target.value)}
+ className="drodown-input"
+ name="defaultvalue"
+ value={defaultValue}
+ placeholder="select default value"
+ >
+ <option value="" disabled hidden style={{ fontSize: "13px" }}>
+ Select...
+ </option>
+ {dropdownOptionList.map((data, ind) => {
+ return (
+ <option
+ style={{ fontSize: "13px" }}
+ key={ind}
+ value={data}
+ >
+ {data}
+ </option>
+ );
+ })}
+ </select>
+ </>
+ )}
+ {props.type !== "checkbox" && props.type !== "radio" && (
+ <>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ gap: 10,
+ marginTop: "0.5rem"
+ }}
+ >
+ {statusArr.map((data, ind) => {
+ return (
+ <div
+ key={ind}
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ gap: 5,
+ alignItems: "center"
+ }}
+ >
+ <input
+ style={{ accentColor: "red" }}
+ type="radio"
+ name="status"
+ onChange={() => setStatus(data.toLowerCase())}
+ checked={status.toLowerCase() === data.toLowerCase()}
+ />
+ <div style={{ fontSize: "13px", fontWeight: "500" }}>
+ {data}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ </>
+ )}
+ </div>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ // onClick={() => handleSaveOption()}
+ disabled={dropdownOptionList.length === 0 && true}
+ style={{
+ background: themeColor,
+ color: "white"
+ }}
+ type="submit"
+ className={"finishBtn"}
+ >
+ Save
+ </button>
+ {props.currWidgetsDetails?.options?.values?.length > 0 && (
+ <button
+ type="submit"
+ className="finishBtn cancelBtn"
+ onClick={() => {
+ setDropdownOptionList(["option-1", "option-2"]);
+ setDropdownName(props.type);
+ props.setCurrWidgetsDetails([]);
+ props.setShowDropdown(false);
+ setDefaultCheckbox([]);
+ setDefaultValue("");
+ }}
+ >
+ Cancel
+ </button>
+ )}
+ </form>
+ </div>
+ </ModalUi>
+ );
+}
+
+export default DropdownWidgetOption;
diff --git a/apps/OpenSign/src/components/pdf/EditTemplate.js b/apps/OpenSign/src/components/pdf/EditTemplate.js
new file mode 100644
index 000000000..5c0688bda
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/EditTemplate.js
@@ -0,0 +1,142 @@
+import React, { useState } from "react";
+import "../../styles/AddUser.css";
+// import SelectFolder from "../../premitives/SelectFolder";
+
+const EditTemplate = ({ template, onSuccess }) => {
+ // const [folder, setFolder] = useState({ ObjectId: "", Name: "" });
+ const [formData, setFormData] = useState({
+ Name: template?.Name || "",
+ Note: template?.Note || "",
+ Description: template?.Description || "",
+ SendinOrder: template?.SendinOrder ? `${template?.SendinOrder}` : "false"
+ });
+
+ const handleStrInput = (e) => {
+ setFormData({ ...formData, [e.target.name]: e.target.value });
+ };
+ // const handleFolder = (data) => {
+ // console.log("handleFolder ", data)
+ // setFolder(data);
+ // };
+
+ // Define a function to handle form submission
+ const handleSubmit = async (e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ const isChecked = formData.SendinOrder === "true" ? true : false;
+ const data = { ...formData, SendinOrder: isChecked };
+ onSuccess(data);
+ };
+
+ return (
+ <div className="addusercontainer">
+ <div className="form-wrapper">
+ <form onSubmit={handleSubmit}>
+ <div>
+ <label htmlFor="name" style={{ fontSize: 13 }}>
+ File
+ </label>
+ <div
+ style={{
+ padding: "0.5rem 0.75rem",
+ border: "1px solid #d1d5db",
+ borderRadius: "0.375rem",
+ fontSize: "0.75rem",
+ fontWeight: "700"
+ }}
+ >
+ {template.URL?.split("/")?.pop()?.split("_")[1]}
+ </div>
+ </div>
+ <div className="form-section">
+ <label htmlFor="name" style={{ fontSize: 13 }}>
+ Name
+ <span style={{ color: "red", fontSize: 13 }}> *</span>
+ </label>
+ <input
+ type="text"
+ name="Name"
+ value={formData.Name}
+ onChange={(e) => handleStrInput(e)}
+ required
+ className="addUserInput"
+ />
+ </div>
+ <div className="form-section">
+ <label htmlFor="Note" style={{ fontSize: 13 }}>
+ Note
+ </label>
+ <input
+ type="text"
+ name="Note"
+ id="Note"
+ value={formData.Note}
+ onChange={(e) => handleStrInput(e)}
+ className="addUserInput"
+ />
+ </div>
+ <div className="form-section">
+ <label htmlFor="Description" style={{ fontSize: 13 }}>
+ Description
+ </label>
+ <input
+ type="text"
+ name="Description"
+ id="Description"
+ value={formData.Description}
+ onChange={(e) => handleStrInput(e)}
+ className="addUserInput"
+ />
+ </div>
+ <div className="form-section">
+ <label style={{ fontSize: 13 }}>Send In Order</label>
+ <div
+ style={{
+ display: "flex",
+ alignItems: "center",
+ gap: 8,
+ marginLeft: 8,
+ marginBottom: 5
+ }}
+ >
+ <input
+ type="radio"
+ value={"true"}
+ name="SendinOrder"
+ checked={formData.SendinOrder === "true"}
+ onChange={handleStrInput}
+ />
+ <div style={{ fontSize: 12 }}>Yes</div>
+ </div>
+ <div
+ style={{
+ display: "flex",
+ alignItems: "center",
+ gap: 8,
+ marginLeft: 8,
+ marginBottom: 5
+ }}
+ >
+ <input
+ type="radio"
+ value={"false"}
+ name="SendinOrder"
+ checked={formData.SendinOrder === "false"}
+ onChange={handleStrInput}
+ />
+ <div style={{ fontSize: 12 }}>No</div>
+ </div>
+ </div>
+ {/* <SelectFolder onSuccess={handleFolder} folderCls={"contracts_Template"} /> */}
+ <div className="buttoncontainer">
+ <button type="submit" className="submitbutton">
+ Submit
+ </button>
+ </div>
+ </form>
+ </div>
+ </div>
+ );
+};
+
+export default EditTemplate;
diff --git a/apps/OpenSign/src/components/pdf/EmailComponent.js b/apps/OpenSign/src/components/pdf/EmailComponent.js
new file mode 100644
index 000000000..c9e5983b6
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/EmailComponent.js
@@ -0,0 +1,430 @@
+import React, { useState } from "react";
+import { saveAs } from "file-saver";
+import celebration from "../../assets/images/newCeleb.gif";
+import axios from "axios";
+import { getBase64FromUrl } from "../../constant/Utils";
+import { themeColor } from "../../constant/const";
+import printModule from "print-js";
+import loader from "../../assets/images/loader2.gif";
+
+function EmailComponent({
+ isEmail,
+ pdfUrl,
+ isCeleb,
+ setIsEmail,
+ setSuccessEmail,
+ pdfName,
+ sender,
+ setIsAlert
+}) {
+ const [emailList, setEmailList] = useState([]);
+ const [emailValue, setEmailValue] = useState();
+ const [isLoading, setIsLoading] = useState(false);
+ //function for send email
+ const sendEmail = async () => {
+ setIsLoading(true);
+ let sendMail;
+ for (let i = 0; i < emailList.length; i++) {
+ try {
+ const imgPng =
+ "https://qikinnovation.ams3.digitaloceanspaces.com/logo.png";
+ // "https://qikinnovation.ams3.digitaloceanspaces.com/mailLogo_2023-08-18T12%3A51%3A31.573Z.png";
+
+ let url = `${localStorage.getItem("baseUrl")}functions/sendmailv3/`;
+ const headers = {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessionToken: localStorage.getItem("accesstoken")
+ };
+ const openSignUrl = "https://www.opensignlabs.com/contact-us";
+ const themeBGcolor = themeColor;
+ let params = {
+ pdfName: pdfName,
+ url: pdfUrl,
+ recipient: emailList[i],
+ subject: `${sender.name} has signed the doc - ${pdfName}`,
+ from: sender.email,
+ html:
+ "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /></head><body> <div style='background-color:#f5f5f5;padding:20px'> <div style='box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;background-color:white;'> <div><img src=" +
+ imgPng +
+ " height='50' style='padding:20px,width:170px,height:40px'/> </div><div style='padding:2px;font-family:system-ui; background-color:" +
+ themeBGcolor +
+ ";'> <p style='font-size:20px;font-weight:400;color:white;padding-left:20px',> Document Copy</p></div><div><p style='padding:20px;font-family:system-ui;font-size:14px'>A copy of the document <strong>" +
+ pdfName +
+ " </strong>is attached to this email. Kindly download the document from the attachment.</p></div> </div><div><p>This is an automated email from OpenSignâ„¢. For any queries regarding this email, please contact the sender " +
+ sender.email +
+ " directly. If you think this email is inappropriate or spam, you may file a complaint with OpenSignâ„¢ <a href= " +
+ openSignUrl +
+ " target=_blank>here</a> </p></div></div></body></html>"
+ };
+ sendMail = await axios.post(url, params, { headers: headers });
+ } catch (error) {
+ console.log("error", error);
+ setIsLoading(false);
+ setIsEmail(false);
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong"
+ });
+ }
+ }
+
+ if (sendMail && sendMail.data.result.status === "success") {
+ setSuccessEmail(true);
+ setTimeout(() => {
+ setSuccessEmail(false);
+ setIsEmail(false);
+ setEmailValue("");
+ setEmailList([]);
+ }, 1500);
+
+ setIsLoading(false);
+ } else if (sendMail && sendMail.data.result.status === "error") {
+ setIsLoading(false);
+ setIsEmail(false);
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong"
+ });
+ setEmailValue("");
+ setEmailList([]);
+ } else {
+ setIsLoading(false);
+ setIsEmail(false);
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong"
+ });
+ setEmailValue("");
+ setEmailList([]);
+ }
+ };
+
+ //function for remove email
+ const removeChip = (index) => {
+ const updateEmailCount = emailList.filter((data, key) => key !== index);
+ setEmailList(updateEmailCount);
+ };
+ //function for get email value
+ const handleEmailValue = (e) => {
+ const value = e.target.value;
+ setEmailValue(value);
+ };
+
+ //function for save email in array after press enter
+ const handleEnterPress = (e) => {
+ if (e.key === "Enter" && emailValue) {
+ setEmailList((prev) => [...prev, emailValue]);
+ setEmailValue("");
+ } else if (e === "add" && emailValue) {
+ setEmailList((prev) => [...prev, emailValue]);
+ setEmailValue("");
+ }
+ };
+
+ // function for print signed pdf
+ const handleToPrint = async (event) => {
+ event.preventDefault();
+
+ const pdf = await getBase64FromUrl(pdfUrl);
+ const isAndroidDevice = navigator.userAgent.match(/Android/i);
+ const isAppleDevice =
+ (/iPad|iPhone|iPod/.test(navigator.platform) ||
+ (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1)) &&
+ !window.MSStream;
+ if (isAndroidDevice || isAppleDevice) {
+ const byteArray = Uint8Array.from(
+ atob(pdf)
+ .split("")
+ .map((char) => char.charCodeAt(0))
+ );
+ const blob = new Blob([byteArray], { type: "application/pdf" });
+ const blobUrl = URL.createObjectURL(blob);
+ window.open(blobUrl, "_blank");
+ } else {
+ printModule({ printable: pdf, type: "pdf", base64: true });
+ }
+ };
+
+ //handle download signed pdf
+ const handleDownloadPdf = () => {
+ saveAs(pdfUrl, `${sanitizeFileName(pdfName)}_signed_by_OpenSignâ„¢.pdf`);
+ };
+
+ const sanitizeFileName = (pdfName) => {
+ // Replace spaces with underscore
+ return pdfName.replace(/ /g, "_");
+ };
+
+ const isAndroid = /Android/i.test(navigator.userAgent);
+
+ return (
+ <div>
+ {/* isEmail */}
+ {isEmail && (
+ <div className="modaloverlay">
+ <div className="modalcontainer">
+ {isLoading && (
+ <div
+ style={{
+ position: "absolute",
+ height: "100%",
+ width: "100%",
+ display: "flex",
+ justifyContent: "center",
+ flexDirection: "column",
+ alignItems: "center",
+ zIndex: "20",
+ backgroundColor: "#e6f2f2",
+ opacity: 0.8
+ }}
+ >
+ <img
+ alt="no img"
+ src={loader}
+ style={{ width: "70px", height: "70px" }}
+ />
+ <span style={{ fontSize: "12px", fontWeight: "bold" }}>
+ This might take some time
+ </span>
+ </div>
+ )}
+ <div style={{ background: "#32a3ac" }} className="modalheader">
+ <span style={{ color: "white" }}>Successfully signed!</span>
+
+ <div style={{ display: "flex", flexDirection: "row" }}>
+ <div></div>
+ {!isAndroid && (
+ <button
+ onClick={handleToPrint}
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center"
+ }}
+ className="btn btn-primary btn-sm"
+ >
+ <i
+ className="fa fa-print"
+ style={{
+ fontSize: "15px",
+ marginRight: "3px",
+ color: "white"
+ }}
+ aria-hidden="true"
+ ></i>
+ Print
+ </button>
+ )}
+
+ <button
+ className="btn btn-danger btn-sm"
+ onClick={() => handleDownloadPdf()}
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center",
+ marginLeft: "10px"
+ }}
+ >
+ <i
+ className="fa fa-download"
+ style={{
+ color: "white",
+ fontSize: "15px",
+ marginRight: "3px"
+ }}
+ aria-hidden="true"
+ ></i>
+ Download
+ </button>
+ </div>
+ </div>
+ <div style={{ height: "100%", padding: 20 }}>
+ {isCeleb && (
+ <div
+ style={{
+ position: "absolute",
+ marginLeft: "50px"
+ }}
+ >
+ <img
+ alt="print img"
+ width={300}
+ height={250}
+ // style={styles.gifCeleb}
+ src={celebration}
+ />
+ </div>
+ )}
+ <p
+ style={{
+ fontFamily: "system-ui",
+ verticalAlign: "baseline",
+ fontWeight: "500",
+ color: "#403f3e",
+ fontSize: "15px",
+ marginBottom: "5px"
+ }}
+ >
+ Recipients added here will get a copy of the signed document.
+ </p>
+ {emailList.length > 0 ? (
+ <>
+ <div className="addEmail">
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+
+ flexWrap: "wrap"
+ }}
+ >
+ {emailList.map((data, ind) => {
+ return (
+ <div
+ className="emailChip"
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center"
+ }}
+ key={ind}
+ >
+ <span
+ style={{
+ color: "white",
+ fontSize: "13px"
+ }}
+ >
+ {data}
+ </span>
+ <span
+ style={{
+ color: "white",
+ fontSize: 13,
+ fontWeight: 600,
+ marginLeft: 7,
+ cursor: "pointer"
+ }}
+ onClick={() => removeChip(ind)}
+ >
+ <i className="fa-solid fa-xmark"></i>
+ </span>
+ </div>
+ );
+ })}
+ </div>
+ {emailList.length <= 9 && (
+ <input
+ type="text"
+ value={emailValue}
+ className="addEmailInput"
+ onChange={handleEmailValue}
+ onKeyDown={handleEnterPress}
+ onBlur={() => {
+ if (emailValue) {
+ handleEnterPress("add");
+ }
+ }}
+ required
+ />
+ )}
+ </div>
+ </>
+ ) : (
+ <div>
+ <input
+ type="text"
+ value={emailValue}
+ className="emailInput"
+ onChange={handleEmailValue}
+ onKeyDown={handleEnterPress}
+ placeholder="Add the email addresses"
+ onBlur={() => {
+ if (emailValue) {
+ handleEnterPress("add");
+ }
+ }}
+ required
+ />
+ </div>
+ )}
+ <span
+ style={{
+ cursor: emailValue && "pointer"
+ }}
+ onClick={() => {
+ if (emailValue) {
+ handleEnterPress("add");
+ }
+ }}
+ >
+ <i
+ style={{
+ backgroundColor: themeColor,
+ padding: "5px 7px",
+ marginTop: "10px",
+ color: "white",
+ borderRadius: "2px"
+ }}
+ className="fa fa-plus"
+ aria-hidden="true"
+ ></i>
+ </span>
+
+ <div
+ style={{
+ background: "#e3e2e1",
+ marginTop: "10px",
+ padding: "5px",
+ borderRadius: "3px"
+ }}
+ >
+ <span style={{ fontWeight: "700" }}>Note:</span>
+ <span style={{ fontSize: "15px" }}>
+ {" "}
+ You can only send to ten recipients at a time.
+ </span>
+ </div>
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ disabled={emailList.length === 0 && true}
+ style={{
+ background: themeColor,
+ color: "white"
+ }}
+ type="button"
+ className={emailList.length === 0 ? "defaultBtn" : "finishBtn"}
+ onClick={() => sendEmail()}
+ >
+ Send
+ </button>
+ <button
+ type="button"
+ className="finishBtn cancelBtn"
+ onClick={() => {
+ setIsEmail(false);
+ setEmailValue("");
+ setEmailList([]);
+ }}
+ >
+ Close
+ </button>
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ );
+}
+
+export default EmailComponent;
diff --git a/apps/OpenSign/src/components/pdf/Header.js b/apps/OpenSign/src/components/pdf/Header.js
new file mode 100644
index 000000000..626671581
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/Header.js
@@ -0,0 +1,762 @@
+import React from "react";
+import PrevNext from "./PrevNext";
+import { PDFDownloadLink } from "@react-pdf/renderer";
+import Certificate from "./Certificate";
+import printModule from "print-js";
+import { getBase64FromUrl } from "../../constant/Utils";
+import { saveAs } from "file-saver";
+import "../../styles/signature.css";
+import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
+import { useNavigate } from "react-router-dom";
+import { themeColor } from "../../constant/const";
+
+function Header({
+ isPdfRequestFiles,
+ isPlaceholder,
+ recipient,
+ setIsDecline,
+ pageNumber,
+ isAlreadySign,
+ allPages,
+ changePage,
+ pdfUrl,
+ documentStatus,
+ embedWidgetsData,
+ pdfDetails,
+ signerPos,
+ signersdata,
+ isMailSend,
+ alertSendEmail,
+ isCompleted,
+ isShowHeader,
+ decline,
+ currentSigner,
+ dataTut4,
+ alreadySign,
+ isSignYourself,
+ setIsEmail,
+ completeBtnTitle,
+ setIsEditTemplate
+}) {
+ const filterPrefill =
+ signerPos && signerPos?.filter((data) => data.Role !== "prefill");
+ const isMobile = window.innerWidth < 767;
+ const navigate = useNavigate();
+ const isGuestSigner = localStorage.getItem("isGuestSigner");
+ //for go to previous page
+ function previousPage() {
+ changePage(-1);
+ }
+ //for go to next page
+ function nextPage() {
+ changePage(1);
+ }
+ //function for show decline alert
+ const handleDeclinePdfAlert = async () => {
+ const currentDecline = {
+ currnt: "Sure",
+ isDeclined: true
+ };
+ setIsDecline(currentDecline);
+ };
+
+ //function for print digital sign pdf
+ const handleToPrint = async (event) => {
+ event.preventDefault();
+
+ const pdf = await getBase64FromUrl(pdfUrl);
+ const isAndroidDevice = navigator.userAgent.match(/Android/i);
+ const isAppleDevice =
+ (/iPad|iPhone|iPod/.test(navigator.platform) ||
+ (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1)) &&
+ !window.MSStream;
+ if (isAndroidDevice || isAppleDevice) {
+ const byteArray = Uint8Array.from(
+ atob(pdf)
+ .split("")
+ .map((char) => char.charCodeAt(0))
+ );
+ const blob = new Blob([byteArray], { type: "application/pdf" });
+ const blobUrl = URL.createObjectURL(blob);
+ window.open(blobUrl, "_blank");
+ } else {
+ printModule({ printable: pdf, type: "pdf", base64: true });
+ }
+ };
+
+ //handle download signed pdf
+ const handleDownloadPdf = () => {
+ const pdfName = pdfDetails[0] && pdfDetails[0].Name;
+ saveAs(pdfUrl, `${sanitizeFileName(pdfName)}_signed_by_OpenSignâ„¢.pdf`);
+ };
+
+ const sanitizeFileName = (pdfName) => {
+ // Replace spaces with underscore
+ return pdfName.replace(/ /g, "_");
+ };
+ //certificate generate and download component in mobile view
+ const CertificateDropDown = () => {
+ //after generate download certifcate pdf
+ const handleDownload = (pdfBlob, fileName) => {
+ if (pdfBlob) {
+ const url = window.URL.createObjectURL(pdfBlob);
+ // Create a temporary anchor element
+ const link = document.createElement("a");
+ link.href = url;
+ link.download = fileName;
+ // Append the anchor to the body
+ document.body.appendChild(link);
+ // Programmatically click the anchor to trigger the download
+ link.click();
+ // Remove the anchor from the body
+ document.body.removeChild(link);
+ // Release the object URL to free up resources
+ window.URL.revokeObjectURL(url);
+ }
+ };
+
+ return (
+ <PDFDownloadLink
+ onClick={(e) => e.preventDefault()}
+ style={{ textDecoration: "none", zIndex: "35" }}
+ document={<Certificate pdfData={pdfDetails} />}
+ >
+ {({ blob, loading }) => (
+ <>
+ {loading ? (
+ <div
+ style={{
+ border: "none",
+ backgroundColor: "#fff"
+ }}
+ >
+ <i
+ className="fa fa-certificate"
+ style={{
+ marginRight: "2px"
+ }}
+ aria-hidden="true"
+ ></i>
+ Certificate
+ </div>
+ ) : (
+ <div
+ style={{
+ border: "none",
+ backgroundColor: "#fff"
+ }}
+ onClick={() =>
+ handleDownload(
+ blob,
+ `completion certificate-${
+ pdfDetails[0] && pdfDetails[0].Name
+ }.pdf`
+ )
+ }
+ >
+ <i
+ className="fa fa-certificate"
+ style={{
+ marginRight: "2px"
+ }}
+ aria-hidden="true"
+ ></i>
+ Certificate
+ </div>
+ )}
+ </>
+ )}
+ </PDFDownloadLink>
+ );
+ };
+ const CertificateComponent = () => {
+ return (
+ <PDFDownloadLink
+ style={{ textDecoration: "none" }}
+ document={<Certificate pdfData={pdfDetails} />}
+ fileName={`completion certificate-${
+ pdfDetails[0] && pdfDetails[0].Name
+ }.pdf`}
+ >
+ {({ loading }) => (
+ <button
+ type="button"
+ className="defaultBtn certificateBtn"
+ disabled={loading}
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center"
+ }}
+ >
+ <i
+ className="fa fa-certificate"
+ style={{
+ color: "white",
+ fontSize: "15px",
+ marginRight: "3px"
+ }}
+ aria-hidden="true"
+ ></i>
+ Certificate
+ </button>
+ )}
+ </PDFDownloadLink>
+ );
+ };
+ return (
+ <div style={{ padding: "5px 0px 5px 0px" }} className="mobileHead">
+ {isMobile && isShowHeader ? (
+ <div
+ id="navbar"
+ className={isGuestSigner ? "stickySignerHead" : "stickyHead"}
+ style={{
+ width: isGuestSigner
+ ? window.innerWidth
+ : window.innerWidth - 30 + "px"
+ }}
+ >
+ <div className="preBtn2">
+ <div
+ onClick={() => {
+ navigate(-1);
+ }}
+ >
+ <i
+ className="fa fa-arrow-left"
+ aria-hidden="true"
+ style={{ color: themeColor, cursor: "pointer" }}
+ ></i>
+ </div>
+ <div>
+ <i
+ onClick={() => {
+ if (pageNumber > 1) {
+ previousPage();
+ }
+ }}
+ className="fa fa-backward"
+ style={{ color: "gray", cursor: "pointer" }}
+ ></i>
+ <span
+ style={{
+ fontSize: "13px",
+ fontWeight: "600",
+ marginLeft: "10px",
+ marginRight: "10px"
+ }}
+ >
+ {pageNumber || (allPages ? 1 : "--")} of {allPages || "--"}
+ </span>
+ <i
+ onClick={() => {
+ if (pageNumber < allPages) {
+ nextPage();
+ }
+ }}
+ className="fa fa-forward"
+ style={{ color: "gray", cursor: "pointer" }}
+ ></i>
+ </div>
+ {pdfUrl && alreadySign ? (
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger asChild>
+ <div
+ style={{
+ color: themeColor,
+ border: "none",
+ fontWeight: "650",
+ fontSize: "16px",
+ padding: "0px 3px 0px 5px"
+ }}
+ >
+ <i className="fa fa-ellipsis-v" aria-hidden="true"></i>
+ </div>
+ </DropdownMenu.Trigger>
+
+ <DropdownMenu.Portal>
+ <DropdownMenu.Content
+ className="DropdownMenuContent"
+ sideOffset={5}
+ >
+ <DropdownMenu.Item
+ className="DropdownMenuItem"
+ onClick={() => handleDownloadPdf()}
+ >
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row"
+ }}
+ >
+ <i
+ className="fa fa-arrow-down"
+ aria-hidden="true"
+ style={{ marginRight: "2px" }}
+ ></i>
+ Download
+ </div>
+ </DropdownMenu.Item>
+ {recipient && pdfDetails[0] && pdfDetails.length > 0 ? (
+ <DropdownMenu.Item className="DropdownMenuItem">
+ <CertificateDropDown />
+ </DropdownMenu.Item>
+ ) : isPdfRequestFiles &&
+ alreadySign &&
+ isCompleted.isCertificate ? (
+ <DropdownMenu.Item className="DropdownMenuItem">
+ <CertificateDropDown />
+ </DropdownMenu.Item>
+ ) : (
+ isSignYourself && (
+ <>
+ <DropdownMenu.Item className="DropdownMenuItem">
+ <CertificateDropDown />
+ </DropdownMenu.Item>
+ <DropdownMenu.Item
+ className="DropdownMenuItem"
+ onClick={() => setIsEmail(true)}
+ >
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row"
+ }}
+ >
+ <i
+ className="fa fa-envelope"
+ style={{ marginRight: "2px" }}
+ aria-hidden="true"
+ ></i>
+ Mail
+ </div>
+ </DropdownMenu.Item>
+ </>
+ )
+ )}
+ <DropdownMenu.Item
+ className="DropdownMenuItem"
+ onClick={handleToPrint}
+ >
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row"
+ }}
+ >
+ {" "}
+ <i
+ className="fa fa-print"
+ aria-hidden="true"
+ style={{ marginRight: "2px" }}
+ ></i>
+ Print
+ </div>
+ </DropdownMenu.Item>
+ </DropdownMenu.Content>
+ </DropdownMenu.Portal>
+ </DropdownMenu.Root>
+ ) : (
+ <div style={{ display: "flex", justifyContent: "space-around" }}>
+ {/* current signer is checking user send request and check status of pdf sign than if current
+ user exist than show finish button else no
+ */}
+ {currentSigner && (
+ <>
+ {decline && (
+ <div
+ onClick={() => {
+ handleDeclinePdfAlert();
+ }}
+ style={{
+ color: "red",
+ border: "none",
+ fontWeight: "650",
+ fontSize: "16px",
+ marginRight: "10px"
+ }}
+ >
+ Decline
+ </div>
+ )}
+ {isPlaceholder ? (
+ <div
+ onClick={() => {
+ if (!isMailSend) {
+ alertSendEmail();
+ }
+ }}
+ style={{
+ color: isMailSend ? "gray" : themeColor,
+ border: "none",
+ fontWeight: "650",
+ fontSize: "16px"
+ }}
+ data-tut={dataTut4}
+ >
+ {completeBtnTitle ? completeBtnTitle : "Send"}
+ </div>
+ ) : (
+ <div
+ data-tut="reactourThird"
+ onClick={() => {
+ if (!pdfUrl) {
+ embedWidgetsData();
+ } else if (isPdfRequestFiles) {
+ embedWidgetsData();
+ }
+ }}
+ style={{
+ color: themeColor,
+ border: "none",
+ fontWeight: "650",
+ fontSize: "16px"
+ }}
+ >
+ Finish
+ </div>
+ )}
+ </>
+ )}
+ </div>
+ )}
+ </div>
+ </div>
+ ) : (
+ <div className="signatureHeader headerBtn">
+ <PrevNext
+ pageNumber={pageNumber}
+ allPages={allPages}
+ changePage={changePage}
+ />
+
+ {recipient ? (
+ pdfUrl || isAlreadySign.mssg ? (
+ <div style={{ display: "flex", flexDirection: "row" }}>
+ {pdfDetails[0] && pdfDetails.length > 0 && (
+ <CertificateComponent />
+ )}
+ <button
+ onClick={handleToPrint}
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center"
+ }}
+ className="defaultBtn printBtn"
+ >
+ <i
+ className="fa fa-print"
+ style={{
+ fontSize: "15px",
+ marginRight: "3px",
+ color: "white"
+ }}
+ aria-hidden="true"
+ ></i>
+ Print
+ </button>
+
+ <button
+ type="button"
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center"
+ }}
+ className="defaultBtn downloadBtn"
+ onClick={() => handleDownloadPdf()}
+ >
+ <i
+ className="fa fa-download"
+ style={{
+ color: "white",
+ fontSize: "15px",
+ marginRight: "3px"
+ }}
+ aria-hidden="true"
+ ></i>
+ Download
+ </button>
+ </div>
+ ) : (
+ <div style={{ display: "flex", flexDirection: "row" }}>
+ <button
+ style={{
+ background: "#de4337"
+ }}
+ className="finishBtn hoverCss"
+ onClick={() => {
+ handleDeclinePdfAlert();
+ }}
+ >
+ Decline
+ </button>
+
+ <button
+ data-tut="reactourThird"
+ style={{
+ background: !pdfUrl ? "#188ae2" : "#d3edeb"
+ }}
+ className="finishBtn sendHover"
+ onClick={() => {
+ if (!pdfUrl) {
+ embedWidgetsData();
+ }
+ }}
+ >
+ Finish
+ </button>
+ </div>
+ )
+ ) : isPlaceholder ? (
+ <>
+ {!isMailSend &&
+ signersdata.length > 0 &&
+ signersdata.length !== filterPrefill.length && (
+ <div>
+ {filterPrefill.length === 0 ? (
+ <span style={{ fontSize: "13px", color: "#f5405e" }}>
+ Add {signersdata.length - filterPrefill.length}{" "}
+ recipients signature
+ </span>
+ ) : (
+ <span style={{ fontSize: "13px", color: "#f5405e" }}>
+ Add {signersdata.length - filterPrefill.length} more
+ recipients signature
+ </span>
+ )}
+ </div>
+ )}
+
+ <div>
+ {setIsEditTemplate && (
+ <button
+ onClick={() => setIsEditTemplate(true)}
+ style={{
+ border: "none",
+ outline: "none",
+ textAlign: "center"
+ }}
+ >
+ <i className="fa-solid fa-gear fa-lg"></i>
+ </button>
+ )}
+ <button
+ onClick={() => {
+ navigate(-1);
+ }}
+ type="button"
+ className="defaultBtn backBtn"
+ >
+ Back
+ </button>
+
+ <button
+ disabled={isMailSend && true}
+ data-tut="reactourFour"
+ style={{
+ background: isMailSend ? "rgb(203, 203, 203)" : "#188ae2",
+ color: isMailSend && "rgb(77, 75, 75)"
+ }}
+ onClick={() => {
+ alertSendEmail();
+ }}
+ className={isMailSend ? "sendMail" : "sendMail sendHover"}
+ >
+ {completeBtnTitle ? completeBtnTitle : "Send"}
+ </button>
+ </div>
+ </>
+ ) : isPdfRequestFiles ? (
+ alreadySign ? (
+ <div style={{ display: "flex", flexDirection: "row" }}>
+ {isCompleted.isCertificate && <CertificateComponent />}
+ <button
+ onClick={handleToPrint}
+ type="button"
+ className="defaultBtn printBtn"
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center"
+ }}
+ >
+ <i
+ className="fa fa-print"
+ style={{
+ fontSize: "15px",
+ marginRight: "3px",
+ color: "white"
+ }}
+ aria-hidden="true"
+ ></i>
+ Print
+ </button>
+
+ <button
+ type="button"
+ className="defaultBtn downloadBtn"
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center"
+ }}
+ onClick={() => handleDownloadPdf()}
+ >
+ <i
+ className="fa fa-download"
+ style={{
+ color: "white",
+ fontSize: "15px",
+ marginRight: "3px"
+ }}
+ aria-hidden="true"
+ ></i>
+ Download
+ </button>
+ </div>
+ ) : (
+ <div>
+ <button
+ onClick={() => {
+ navigate(-1);
+ }}
+ type="button"
+ className="defaultBtn backBtn"
+ >
+ Back
+ </button>
+ {currentSigner && (
+ <>
+ <button
+ style={{
+ background: "#de4337"
+ }}
+ className="finishBtn hoverCss"
+ onClick={() => {
+ handleDeclinePdfAlert();
+ }}
+ >
+ Decline
+ </button>
+ <button
+ style={{
+ background: "#188ae2"
+ }}
+ type="button"
+ className="finishBtn sendHover"
+ onClick={() => {
+ embedWidgetsData();
+ }}
+ >
+ Finish
+ </button>
+ </>
+ )}
+ </div>
+ )
+ ) : pdfUrl || (documentStatus && documentStatus.isCompleted) ? (
+ <div style={{ display: "flex", flexDirection: "row" }}>
+ <CertificateComponent />
+ <button
+ onClick={handleToPrint}
+ type="button"
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center"
+ }}
+ className="defaultBtn printBtn"
+ >
+ <i
+ className="fa fa-print"
+ style={{
+ fontSize: "15px",
+ marginRight: "3px",
+ color: "white"
+ }}
+ aria-hidden="true"
+ ></i>
+ Print
+ </button>
+ <button
+ type="button"
+ className="defaultBtn downloadBtn"
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center",
+ marginLeft: "10px"
+ }}
+ onClick={() => handleDownloadPdf()}
+ >
+ <i
+ className="fa fa-download"
+ style={{
+ color: "white",
+ fontSize: "15px",
+ marginRight: "3px"
+ }}
+ aria-hidden="true"
+ ></i>
+ Download
+ </button>
+ <button
+ type="button"
+ className="defaultBtn mailBtn"
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center",
+ marginLeft: "10px"
+ }}
+ onClick={() => setIsEmail(true)}
+ >
+ <i
+ className="fa fa-envelope"
+ style={{
+ color: "white",
+ fontSize: "15px",
+ marginRight: "3px"
+ }}
+ aria-hidden="true"
+ ></i>
+ Mail
+ </button>
+ </div>
+ ) : (
+ <div>
+ <button
+ onClick={() => {
+ navigate(-1);
+ }}
+ type="button"
+ className="defaultBtn backBtn"
+ >
+ Back
+ </button>
+
+ <button
+ style={{
+ background: "#188ae2"
+ }}
+ type="button"
+ className="finishBtn sendHover"
+ onClick={() => {
+ if (!pdfUrl) {
+ embedWidgetsData();
+ }
+ }}
+ >
+ Finish
+ </button>
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+ );
+}
+
+export default Header;
diff --git a/apps/OpenSign/src/components/pdf/Loader.js b/apps/OpenSign/src/components/pdf/Loader.js
new file mode 100644
index 000000000..a1c3bed1e
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/Loader.js
@@ -0,0 +1,27 @@
+import React from "react";
+import loader from "../../assets/images/loader2.gif";
+
+function Loader({ isLoading }) {
+ return (
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100vh",
+ flexDirection: "column"
+ }}
+ >
+ <img
+ alt="no img"
+ src={loader}
+ style={{ width: "80px", height: "80px" }}
+ />
+ <span style={{ fontSize: "13px", color: "gray" }}>
+ {isLoading.message}
+ </span>
+ </div>
+ );
+}
+
+export default Loader;
diff --git a/apps/OpenSign/src/components/pdf/Placeholder.js b/apps/OpenSign/src/components/pdf/Placeholder.js
new file mode 100644
index 000000000..cae1c79f3
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/Placeholder.js
@@ -0,0 +1,624 @@
+import React, { useState, useEffect } from "react";
+import BorderResize from "./BorderResize";
+import PlaceholderBorder from "./PlaceholderBorder";
+import { Rnd } from "react-rnd";
+import { defaultWidthHeight, isMobile } from "../../constant/Utils";
+import PlaceholderType from "./PlaceholderType";
+import moment from "moment";
+import "../../styles/opensigndrive.css";
+
+function Placeholder(props) {
+ const [isDraggingEnabled, setDraggingEnabled] = useState(true);
+ const [isShowDateFormat, setIsShowDateFormat] = useState(false);
+ const [selectDate, setSelectDate] = useState({
+ date: moment(new Date().getTime()).format("MM/DD/YYYY"),
+ format: "MM/dd/YYYY"
+ });
+ const [dateFormat, setDateFormat] = useState([]);
+ const [saveDateFormat, setSaveDateFormat] = useState("");
+ const dateFormatArr = [
+ "L",
+ "DD-MM-YYYY",
+ "YYYY-MM-DD",
+ "MM.DD.YYYY",
+ "MM-DD-YYYY",
+ "MMM DD, YYYY",
+ "LL",
+ "DD MMM, YYYY",
+ "DD MMMM, YYYY"
+ ];
+
+ const selectFormat = (data) => {
+ switch (data) {
+ case "L":
+ return "MM/dd/yyyy";
+ case "DD-MM-YYYY":
+ return "dd-MM-yyyy";
+ case "DD/MM/YYYY":
+ return "dd/MM/yyyy";
+ case "LL":
+ return "MMMM dd, yyyy";
+ case "DD MMM, YYYY":
+ return "dd MMM, YYYY";
+ case "YYYY-MM-DD":
+ return "YYYY-MM-dd";
+ case "MM-DD-YYYY":
+ return "MM-dd-YYYY";
+ case "MM.DD.YYYY":
+ return "MM.dd.YYYY";
+ case "MMM DD, YYYY":
+ return "MMM dd, YYYY";
+ case "DD MMMM, YYYY":
+ return "dd MMMM, YYYY";
+ default:
+ return "dd/MM/yyyy";
+ }
+ };
+
+ //function for add selected date and format in selectFormat
+ const changeDateFormat = () => {
+ const updateDate = [];
+ dateFormatArr.map((data) => {
+ let date;
+ if (selectDate.format === "dd-MM-yyyy") {
+ const [day, month, year] = selectDate.date.split("-");
+ date = new Date(`${year}-${month}-${day}`);
+ } else {
+ date = new Date(selectDate?.date);
+ }
+ const milliseconds = date.getTime();
+ const newDate = moment(milliseconds).format(data);
+ const dateObj = {
+ date: newDate,
+ format: selectFormat(data)
+ };
+ updateDate.push(dateObj);
+ });
+ setDateFormat(updateDate);
+ };
+ useEffect(() => {
+ if (props.isPlaceholder || props.isSignYourself) {
+ selectDate && changeDateFormat();
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [selectDate]);
+ //handle to close drop down menu onclick screen
+ useEffect(() => {
+ const closeMenuOnOutsideClick = (e) => {
+ if (isShowDateFormat && !e.target.closest("#menu-container")) {
+ setIsShowDateFormat(!isShowDateFormat);
+ }
+ };
+ document.addEventListener("click", closeMenuOnOutsideClick);
+ return () => {
+ // Cleanup the event listener when the component unmounts
+ document.removeEventListener("click", closeMenuOnOutsideClick);
+ };
+ }, [isShowDateFormat]);
+
+ //onclick placeholder function to open signature pad
+ const handlePlaceholderClick = () => {
+ if (props.setSelectWidgetId) {
+ props.setSelectWidgetId(props.pos.key);
+ }
+
+ const widgetTypeExist = [
+ "text",
+ "checkbox",
+ "name",
+ "company",
+ "job title",
+ "date",
+ "email"
+ ].includes(props.pos.type);
+
+ if (widgetTypeExist) {
+ setDraggingEnabled(false);
+ }
+ if ((props.isNeedSign || props.isSignYourself) && !props.isDragging) {
+ if (props.pos.type) {
+ if (
+ props.pos.type === "signature" ||
+ props.pos.type === "stamp" ||
+ props.pos.type === "image"
+ ) {
+ props.setIsSignPad(true);
+ props.setSignKey(props.pos.key);
+ props.setIsStamp(props.pos.isStamp);
+ } else if (props.pos.type === "initials") {
+ props.setIsSignPad(true);
+ props.setSignKey(props.pos.key);
+ props.setIsStamp(props.pos.isStamp);
+ props.setIsInitial(true);
+ }
+ } else {
+ props.setIsSignPad(true);
+ props.setSignKey(props.pos.key);
+ props.setIsStamp(props.pos?.isStamp ? props.pos.isStamp : false);
+ }
+ } else if (
+ props.isPlaceholder &&
+ !props.isDragging &&
+ props.pos.type !== "label"
+ ) {
+ if (props.pos.key === props.selectWidgetId) {
+ props.handleLinkUser(props.data.Id);
+ props.setUniqueId(props.data.Id);
+ }
+ } else if (!props.pos.type) {
+ if (
+ !props.pos.type &&
+ props.isNeedSign &&
+ props.data.signerObjId === props.signerObjId
+ ) {
+ props.setIsSignPad(true);
+ props.setSignKey(props.pos.key);
+ props.setIsStamp(props.pos.isStamp);
+ } else if (
+ (props.isNeedSign && props.pos.type === "signature") ||
+ props.pos.type === "stamp"
+ ) {
+ props.setIsSignPad(true);
+ props.setSignKey(props.pos.key);
+ props.setIsStamp(props.pos.isStamp);
+ } else if (props.isNeedSign && props.pos.type === "dropdown") {
+ props.setSignKey(props.pos.key);
+ }
+ }
+ };
+
+ const handleWidgetsOnclick = () => {
+ if (props.pos.type === "radio") {
+ props.setIsRadio(true);
+ } else if (props.pos.type === "dropdown") {
+ props?.setShowDropdown(true);
+ } else if (props.pos.type === "checkbox") {
+ props?.setIsCheckbox(true);
+ } else {
+ props?.handleNameModal(true);
+ }
+
+ if (props.isPlaceholder) {
+ props.setUniqueId(props.data.Id);
+ }
+ props.setSignKey(props.pos.key);
+ props.setWidgetType(props.pos.type);
+ props.setCurrWidgetsDetails(props.pos);
+ };
+ const PlaceholderIcon = () => {
+ return (
+ props.isShowBorder && (
+ <>
+ {(props.isPlaceholder || props.isSignYourself) && (
+ <>
+ {props.pos.type === "checkbox" && props.isSignYourself ? (
+ <i
+ onClick={(e) => {
+ e.stopPropagation();
+ handleWidgetsOnclick();
+ }}
+ onTouchEnd={(e) => {
+ e.stopPropagation();
+ handleWidgetsOnclick();
+ }}
+ className="fa-solid fa-gear settingIcon"
+ style={{
+ color: "#188ae2",
+ right: "9px",
+ top: "-28px"
+ }}
+ ></i>
+ ) : (
+ props.pos.type !== "date" &&
+ props.pos.type !== "label" &&
+ props.pos.type !== "signature" &&
+ !props.isSignYourself && (
+ <i
+ onClick={(e) => {
+ e.stopPropagation();
+ handleWidgetsOnclick();
+ }}
+ onTouchEnd={(e) => {
+ e.stopPropagation();
+ handleWidgetsOnclick();
+ }}
+ className="fa-solid fa-gear settingIcon"
+ style={{
+ color: "#188ae2",
+ right: ["checkbox", "radio"].includes(props.pos.type)
+ ? "24px"
+ : "47px",
+ top: ["checkbox", "radio"].includes(props.pos.type)
+ ? "-28px"
+ : "-19px"
+ }}
+ ></i>
+ )
+ )}
+
+ {props.pos.type !== "label" && !props.isSignYourself && (
+ <i
+ data-tut="reactourLinkUser"
+ className="fa-regular fa-user signUserIcon"
+ onClick={(e) => {
+ e.stopPropagation();
+ props.handleLinkUser(props.data.Id);
+ props.setUniqueId(props.data.Id);
+ }}
+ onTouchEnd={(e) => {
+ e.stopPropagation();
+ props.handleLinkUser(props.data.Id);
+ props.setUniqueId(props.data.Id);
+ }}
+ style={{
+ color: "#188ae2",
+ right:
+ props.pos.type === "checkbox" ||
+ props.pos.type === "radio"
+ ? "8px"
+ : "32px",
+ top:
+ props.pos.type === "checkbox" ||
+ props.pos.type === "radio"
+ ? "-28px"
+ : "-18px"
+ }}
+ ></i>
+ )}
+ </>
+ )}
+ {props.pos.type === "date" && selectDate && (
+ <div
+ id="menu-container"
+ style={{
+ zIndex: "99",
+ top: "-19px",
+ right: props.isPlaceholder ? "60px" : "44px"
+ }}
+ className={
+ isShowDateFormat
+ ? "dropdown signUserIcon show"
+ : "dropdown signUserIcon"
+ }
+ onClick={(e) => {
+ setIsShowDateFormat(!isShowDateFormat);
+ e.stopPropagation();
+ if (props.data) {
+ props.setSignKey(props.pos.key);
+ props.setUniqueId(props.data.Id);
+ }
+ }}
+ onTouchEnd={(e) => {
+ e.stopPropagation();
+ setIsShowDateFormat(!isShowDateFormat);
+ if (props.data) {
+ props.setSignKey(props.pos.key);
+ props.setUniqueId(props.data.Id);
+ }
+ }}
+ >
+ <i
+ className="fa-solid fa-gear settingIcon"
+ style={{
+ color: "#188ae2",
+ fontSize: "14px"
+ }}
+ ></i>
+ <div
+ className={
+ isShowDateFormat ? "dropdown-menu show" : "dropdown-menu"
+ }
+ aria-labelledby="dropdownMenuButton"
+ aria-expanded={isShowDateFormat ? "true" : "false"}
+ >
+ {dateFormat.map((data, ind) => {
+ return (
+ <span
+ key={ind}
+ onTouchEnd={(e) => {
+ e.stopPropagation();
+ setIsShowDateFormat(!isShowDateFormat);
+ setSelectDate(data);
+ }}
+ onClick={() => {
+ setIsShowDateFormat(!isShowDateFormat);
+ setSelectDate(data);
+ }}
+ className="dropdown-item itemColor"
+ style={{ fontSize: "12px" }}
+ >
+ {data?.date ? data?.date : "nodata"}
+ </span>
+ );
+ })}
+ </div>
+ </div>
+ )}
+ <i
+ className="fa-regular fa-copy signCopy"
+ onClick={(e) => {
+ if (props.data) {
+ props.setSignerObjId(props.data.signerObjId);
+ props.setUniqueId(props.data.Id);
+ }
+ e.stopPropagation();
+ props.setIsPageCopy(true);
+ props.setSignKey(props.pos.key);
+ }}
+ onTouchEnd={(e) => {
+ if (props.data) {
+ props.setSignerObjId(props.data.signerObjId);
+ props.setUniqueId(props.data.Id);
+ }
+ e.stopPropagation();
+ props.setIsPageCopy(true);
+ props.setSignKey(props.pos.key);
+ }}
+ style={{
+ color: "#188ae2",
+ right:
+ props.pos.type === "checkbox" || props.pos.type === "radio"
+ ? "-9px"
+ : "12px",
+ top:
+ props.pos.type === "checkbox" || props.pos.type === "radio"
+ ? "-28px"
+ : "-18px"
+ }}
+ ></i>
+ <i
+ className="fa-regular fa-circle-xmark signCloseBtn"
+ onClick={(e) => {
+ e.stopPropagation();
+
+ if (props.data) {
+ props.handleDeleteSign(props.pos.key, props.data.Id);
+ } else {
+ props.handleDeleteSign(props.pos.key);
+ props.setIsStamp(false);
+ }
+ }}
+ onTouchEnd={(e) => {
+ e.stopPropagation();
+ if (props.data) {
+ props.handleDeleteSign(props.pos.key, props.data?.Id);
+ } else {
+ props.handleDeleteSign(props.pos.key);
+ props.setIsStamp(false);
+ }
+ }}
+ style={{
+ color: "#188ae2",
+ right:
+ props.pos.type === "checkbox" || props.pos.type === "radio"
+ ? "-27px"
+ : "-8px",
+ top:
+ props.pos.type === "checkbox" || props.pos.type === "radio"
+ ? "-28px"
+ : "-18px"
+ }}
+ ></i>
+ </>
+ )
+ );
+ };
+
+ return (
+ <Rnd
+ data-tut={props.pos.key === props.unSignedWidgetId ? "IsSigned" : ""}
+ //ref={nodeRef}
+ key={props.pos.key}
+ lockAspectRatio={
+ props.pos.Width
+ ? props.pos.Width / props.pos.Height
+ : defaultWidthHeight(props.pos.type).width /
+ defaultWidthHeight(props.pos.type).height
+ }
+ enableResizing={{
+ top: false,
+ right: false,
+ bottom: false,
+ left: false,
+ topRight: false,
+ bottomRight:
+ props.data && props.isNeedSign
+ ? props.data?.signerObjId === props.signerObjId &&
+ props.pos.type !== "checkbox" &&
+ props.pos.type !== "radio"
+ ? true
+ : false
+ : props.pos.type !== "radio" &&
+ props.pos.type !== "checkbox" &&
+ props.pos.key === props.selectWidgetId &&
+ true,
+ bottomLeft: false,
+ topLeft: false
+ }}
+ bounds="parent"
+ className="signYourselfBlock"
+ style={{
+ border: props.pos.type !== "checkbox" && "1px solid #007bff",
+ borderRadius: props.pos.type !== "checkbox" && "2px",
+ textAlign:
+ props.pos.type !== "name" &&
+ props.pos.type !== "company" &&
+ props.pos.type !== "job title" &&
+ "center",
+ cursor:
+ props.data && props.isNeedSign
+ ? props.data?.signerObjId === props.signerObjId
+ ? "pointer"
+ : "not-allowed"
+ : "all-scroll",
+ zIndex:
+ props.pos.type === "date"
+ ? "99"
+ : props?.pos?.zIndex
+ ? props.pos.zIndex
+ : "5",
+ background: props.data
+ ? props.pos.type !== "checkbox" && props.data.blockColor
+ : props.pos.type !== "checkbox" && "rgb(203 233 237)"
+ }}
+ onDrag={() => {
+ setDraggingEnabled(true);
+ props.handleTabDrag && props.handleTabDrag(props.pos.key);
+ }}
+ size={{
+ width: props.posWidth(props.pos, props.isSignYourself),
+ height: props.posHeight(props.pos, props.isSignYourself)
+ }}
+ onResizeStart={() => {
+ setDraggingEnabled(true);
+ props.setIsResize && props.setIsResize(true);
+ }}
+ onResizeStop={() => {
+ props.setIsResize && props.setIsResize(false);
+ }}
+ disableDragging={
+ props.isNeedSign
+ ? true
+ : props.isPlaceholder && props.pos.type !== "date"
+ ? false
+ : !isDraggingEnabled
+ }
+ onDragStop={(event, dragElement) =>
+ props.handleStop &&
+ props.handleStop(event, dragElement, props.data?.Id, props.pos?.key)
+ }
+ default={{
+ x: props.xPos(props.pos, props.isSignYourself),
+ y: props.yPos(props.pos, props.isSignYourself)
+ }}
+ onResize={(e, direction, ref) => {
+ props.handleSignYourselfImageResize &&
+ props.handleSignYourselfImageResize(
+ ref,
+ props.pos.key,
+ props.xyPostion,
+ props.setXyPostion,
+ props.index,
+ props.data && props.data.Id,
+ false
+ );
+ }}
+ onClick={() => {
+ !props.isNeedSign && props.setWidgetType(props.pos.type);
+ props.isNeedSign && props.data?.signerObjId === props.signerObjId
+ ? handlePlaceholderClick()
+ : props.isPlaceholder
+ ? handlePlaceholderClick()
+ : props.isSignYourself && handlePlaceholderClick();
+ }}
+ >
+ {props.isShowBorder &&
+ props.pos.type !== "radio" &&
+ props.pos.type !== "checkbox" &&
+ props.pos.key === props.selectWidgetId ? (
+ <BorderResize
+ right={
+ props.pos.type === "checkbox" || props.pos.type === "radio"
+ ? -21
+ : -12
+ }
+ top={
+ props.pos.type === "checkbox" || props.pos.type === "radio"
+ ? -21
+ : -11
+ }
+ />
+ ) : props.data && props.isNeedSign && props.pos.type !== "checkbox" ? (
+ props.data?.signerObjId === props.signerObjId &&
+ props.pos.type !== "radio" &&
+ props.pos.type !== "checkbox" ? (
+ <BorderResize />
+ ) : (
+ <></>
+ )
+ ) : (
+ props.pos.type !== "radio" &&
+ props.pos.type !== "checkbox" &&
+ props.pos.key === props.selectWidgetId && <BorderResize />
+ )}
+
+ {props.isShowBorder && props.pos.key === props.selectWidgetId && (
+ <PlaceholderBorder
+ setDraggingEnabled={setDraggingEnabled}
+ pos={props.pos}
+ isPlaceholder={props.isPlaceholder}
+ />
+ )}
+ {isMobile ? (
+ <div
+ style={{
+ left: props.xPos(props.pos, props.isSignYourself),
+ top: props.yPos(props.pos, props.isSignYourself),
+ width: props.posWidth(props.pos, props.isSignYourself),
+ // height: props.posHeight(props.pos, props.isSignYourself),
+ zIndex: "10"
+ }}
+ onTouchEnd={() => {
+ !props.isNeedSign && props.setWidgetType(props.pos.type);
+ props.isNeedSign && props.data?.signerObjId === props.signerObjId
+ ? handlePlaceholderClick()
+ : props.isPlaceholder
+ ? handlePlaceholderClick()
+ : props.isSignYourself && handlePlaceholderClick();
+ }}
+ >
+ {props.pos.key === props.selectWidgetId && <PlaceholderIcon />}
+
+ <PlaceholderType
+ pos={props.pos}
+ xyPostion={props.xyPostion}
+ index={props.index}
+ setXyPostion={props.setXyPostion}
+ data={props.data}
+ setSignKey={props.setSignKey}
+ isShowDropdown={props?.isShowDropdown}
+ isPlaceholder={props.isPlaceholder}
+ isSignYourself={props.isSignYourself}
+ signerObjId={props.signerObjId}
+ handleUserName={props.handleUserName}
+ setDraggingEnabled={setDraggingEnabled}
+ pdfDetails={props?.pdfDetails && props?.pdfDetails[0]}
+ isNeedSign={props.isNeedSign}
+ setSelectDate={setSelectDate}
+ selectDate={selectDate}
+ setSaveDateFormat={setSaveDateFormat}
+ saveDateFormat={saveDateFormat}
+ setValidateAlert={props.setValidateAlert}
+ />
+ </div>
+ ) : (
+ <>
+ {props.pos.key === props.selectWidgetId && <PlaceholderIcon />}
+ <PlaceholderType
+ pos={props.pos}
+ xyPostion={props.xyPostion}
+ index={props.index}
+ setXyPostion={props.setXyPostion}
+ data={props.data}
+ setSignKey={props.setSignKey}
+ isShowDropdown={props?.isShowDropdown}
+ isPlaceholder={props.isPlaceholder}
+ isSignYourself={props.isSignYourself}
+ signerObjId={props.signerObjId}
+ handleUserName={props.handleUserName}
+ setDraggingEnabled={setDraggingEnabled}
+ pdfDetails={props?.pdfDetails && props?.pdfDetails[0]}
+ isNeedSign={props.isNeedSign}
+ setSelectDate={setSelectDate}
+ selectDate={selectDate}
+ setSaveDateFormat={setSaveDateFormat}
+ saveDateFormat={saveDateFormat}
+ setValidateAlert={props.setValidateAlert}
+ />
+ </>
+ )}
+ </Rnd>
+ );
+}
+
+export default Placeholder;
diff --git a/apps/OpenSign/src/components/pdf/PlaceholderBorder.js b/apps/OpenSign/src/components/pdf/PlaceholderBorder.js
new file mode 100644
index 000000000..10cec89aa
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/PlaceholderBorder.js
@@ -0,0 +1,35 @@
+import React from "react";
+import { themeColor } from "../../constant/const";
+import {
+ defaultWidthHeight,
+ resizeBorderExtraWidth
+} from "../../constant/Utils";
+function PlaceholderBorder(props) {
+ const getResizeBorderExtraWidth =
+ props.pos.type === "checkbox" || props.pos.type === "radio"
+ ? 38
+ : resizeBorderExtraWidth();
+ const defaultWidth = defaultWidthHeight(props.pos.type).width;
+ const defaultHeight = defaultWidthHeight(props.pos.type).height;
+
+ return (
+ <div
+ className="borderResize"
+ style={{
+ borderColor: themeColor,
+ borderStyle: "dashed",
+
+ width: props.pos.Width
+ ? props.pos.Width + getResizeBorderExtraWidth
+ : defaultWidth + getResizeBorderExtraWidth,
+ height: props.pos.Height
+ ? props.pos.Height + getResizeBorderExtraWidth
+ : defaultHeight + getResizeBorderExtraWidth,
+ borderWidth: "0.2px",
+ overflow: "hidden"
+ }}
+ ></div>
+ );
+}
+
+export default PlaceholderBorder;
diff --git a/apps/OpenSign/src/components/pdf/PlaceholderCopy.js b/apps/OpenSign/src/components/pdf/PlaceholderCopy.js
new file mode 100644
index 000000000..be1646d08
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/PlaceholderCopy.js
@@ -0,0 +1,249 @@
+import React, { useState } from "react";
+import { themeColor } from "../../constant/const";
+import ModalUi from "../../primitives/ModalUi";
+
+function PlaceholderCopy(props) {
+ const copyType = ["All pages", "All pages but last", "All pages but first"];
+ const [selectCopyType, setSelectCopyType] = useState("");
+
+ //get RandomKey Id
+ const randomKey = () => {
+ const randomId = Math.floor(1000 + Math.random() * 9000);
+ return randomId;
+ };
+
+ //function for get copy placeholder position
+ const getCopyPlaceholderPosition = (
+ type,
+ currentPlaceholder,
+ newPageNumber,
+ existPlaceholderPosition
+ ) => {
+ const filterPosition =
+ existPlaceholderPosition &&
+ existPlaceholderPosition.filter(
+ (data) => data.xPosition !== currentPlaceholder.xPosition
+ );
+ //copy all page placeholder at requested position except first page
+ if (newPageNumber === 1 && type === "first") {
+ if (filterPosition && filterPosition.length > 0) {
+ return {
+ pageNumber: newPageNumber,
+ pos: [...filterPosition]
+ };
+ }
+ }
+ //copy all page placeholder at requested position except last page
+ else if (newPageNumber === props.allPages && type === "last") {
+ if (existPlaceholderPosition) {
+ return {
+ pageNumber: newPageNumber,
+ pos: [...filterPosition]
+ };
+ }
+ }
+ //copy all page placeholder at requested position with existing placeholder position
+ else if (existPlaceholderPosition) {
+ return {
+ pageNumber: newPageNumber,
+ pos: [...filterPosition, currentPlaceholder]
+ };
+ }
+ //copy all page placeholder at requested position
+ else {
+ return {
+ pageNumber: newPageNumber,
+ pos: [currentPlaceholder]
+ };
+ }
+ };
+
+ //function for copy placeholder as per select copy type
+ const copyPlaceholder = (type) => {
+ let newPlaceholderPosition = [];
+ let newPageNumber = 1;
+ const signerPosition = props.xyPostion;
+ const signerId = props.signerObjId ? props.signerObjId : props.Id;
+
+ //handle placeholder array and copy for multiple signers placeholder at requested location
+ if (signerId) {
+ //get current signers data
+ let filterSignerPosition;
+ if (props?.signerObjId) {
+ filterSignerPosition = signerPosition.filter(
+ (data) => data.signerObjId === signerId
+ );
+ } else {
+ filterSignerPosition = signerPosition.filter(
+ (item) => item.Id === signerId
+ );
+ }
+ //get current pagenumber's all placeholder position data
+ const placeholderPosition = filterSignerPosition[0].placeHolder.filter(
+ (data) => data.pageNumber === props.pageNumber
+ );
+ //get current placeholder position data which user want to copy
+ const currentPlaceholder = placeholderPosition[0].pos.find(
+ (position) => position.key === props.signKey
+ );
+
+ for (let i = 0; i < props.allPages; i++) {
+ const newId = randomKey();
+ currentPlaceholder.key = newId;
+ //get exist placeholder position for particular page
+ const existPlaceholder = filterSignerPosition[0].placeHolder.filter(
+ (data) => data.pageNumber === newPageNumber
+ );
+ const existPlaceholderPosition =
+ existPlaceholder[0] && existPlaceholder[0].pos;
+
+ //function for get copy to requested location of placeholder position
+ const getPlaceholderObj = getCopyPlaceholderPosition(
+ type,
+ currentPlaceholder,
+ newPageNumber,
+ existPlaceholderPosition
+ );
+ if (getPlaceholderObj) {
+ newPlaceholderPosition.push(getPlaceholderObj);
+ }
+ newPageNumber++;
+ }
+ let updatedSignerPlaceholder;
+ if (props?.signerObjId) {
+ updatedSignerPlaceholder = signerPosition.map((signersData) => {
+ if (signersData.signerObjId === props.signerObjId) {
+ return {
+ ...signersData,
+ placeHolder: newPlaceholderPosition
+ };
+ }
+ return signersData;
+ });
+ } else {
+ updatedSignerPlaceholder = signerPosition.map((signersData) => {
+ if (signersData.Id === props.Id) {
+ return {
+ ...signersData,
+ placeHolder: newPlaceholderPosition
+ };
+ }
+ return signersData;
+ });
+ }
+
+ const signersData = signerPosition;
+ signersData.splice(0, signerPosition.length, ...updatedSignerPlaceholder);
+ props.setXyPostion(signersData);
+ }
+ //handle signyourself array and copy for single signers placeholder at requested location
+ else {
+ const xyPostion = props.xyPostion;
+
+ const placeholderPosition = xyPostion.filter(
+ (data) => data.pageNumber === props.pageNumber
+ );
+ //get current placeholder position data which user want to copy
+ const currentPlaceholder = placeholderPosition[0].pos.find(
+ (pos) => pos.key === props.signKey
+ );
+
+ for (let i = 0; i < props.allPages; i++) {
+ //get exist placeholder position for particular page
+ const existPlaceholder = xyPostion.filter(
+ (data) => data.pageNumber === newPageNumber
+ );
+ const existPlaceholderPosition =
+ existPlaceholder[0] && existPlaceholder[0].pos;
+
+ const newId = randomKey();
+ currentPlaceholder.key = newId;
+ //function for get copy to requested location of placeholder position
+ const getPlaceholderObj = getCopyPlaceholderPosition(
+ type,
+ currentPlaceholder,
+ newPageNumber,
+ existPlaceholderPosition
+ );
+ if (getPlaceholderObj) {
+ newPlaceholderPosition.push(getPlaceholderObj);
+ }
+
+ newPageNumber++;
+ }
+ props.setXyPostion(newPlaceholderPosition);
+ }
+ };
+
+ //function for getting selected type placeholder copy
+ const handleApplyCopy = () => {
+ if (selectCopyType === "All pages") {
+ copyPlaceholder("all");
+ } else if (selectCopyType === "All pages but last") {
+ copyPlaceholder("last");
+ } else if (selectCopyType === "All pages but first") {
+ copyPlaceholder("first");
+ }
+ };
+
+ return (
+ <ModalUi
+ isOpen={props.isPageCopy}
+ title={"Copy to all pages"}
+ handleClose={() => {
+ props.setIsPageCopy(false);
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ {copyType.map((data, key) => {
+ return (
+ <div key={key} style={{ display: "flex", flexDirection: "column" }}>
+ <label key={key} style={{ fontSize: "16px", fontWeight: "500" }}>
+ <input
+ style={{ accentColor: "red", marginRight: "10px" }}
+ type="radio"
+ value={data}
+ onChange={() => setSelectCopyType(data)}
+ checked={selectCopyType === data}
+ />
+
+ {data}
+ </label>
+ </div>
+ );
+ })}
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ onClick={() => {
+ handleApplyCopy();
+ props.setIsPageCopy(false);
+ }}
+ style={{ background: themeColor }}
+ type="button"
+ disabled={!selectCopyType}
+ className="finishBtn"
+ >
+ Apply
+ </button>
+ <button
+ type="button"
+ className="finishBtn cancelBtn"
+ onClick={() => props.setIsPageCopy(false)}
+ >
+ Cancel
+ </button>
+ </div>
+ </ModalUi>
+ );
+}
+
+export default PlaceholderCopy;
diff --git a/apps/OpenSign/src/components/pdf/PlaceholderType.js b/apps/OpenSign/src/components/pdf/PlaceholderType.js
new file mode 100644
index 000000000..16bec9698
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/PlaceholderType.js
@@ -0,0 +1,741 @@
+import React, { useEffect, useState, forwardRef, useRef } from "react";
+import { onChangeInput } from "../../constant/Utils";
+import DatePicker from "react-datepicker";
+import "react-datepicker/dist/react-datepicker.css";
+import "../../styles/signature.css";
+import RegexParser from "regex-parser";
+
+function PlaceholderType(props) {
+ const type = props.pos.type;
+ const [selectOption, setSelectOption] = useState(
+ props.pos?.options?.defaultValue ? props.pos?.options?.defaultValue : ""
+ );
+ const [startDate, setStartDate] = useState(new Date());
+ const [validatePlaceholder, setValidatePlaceholder] = useState("");
+ const inputRef = useRef(null);
+ const [textValue, setTextValue] = useState();
+ const [selectedCheckbox, setSelectedCheckbox] = useState([]);
+
+ const validateExpression = (regexValidation) => {
+ let regexObject = regexValidation;
+ if (props.pos?.options.validation.type === "regex") {
+ regexObject = RegexParser(regexValidation);
+ }
+ // new RegExp(regexValidation);
+ let isValidate = regexObject.test(textValue);
+ if (!isValidate) {
+ props.setValidateAlert(true);
+ inputRef.current.focus();
+ }
+ };
+
+ const handleInputBlur = () => {
+ props.setDraggingEnabled(true);
+ const validateType = props.pos?.options?.validation?.type;
+
+ let regexValidation;
+ if (validateType) {
+ switch (validateType) {
+ case "email":
+ regexValidation = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
+ validateExpression(regexValidation);
+ break;
+ case "number":
+ regexValidation = /^\d+$/;
+ validateExpression(regexValidation);
+ break;
+ case "text":
+ regexValidation = /^[a-zA-Z\s]+$/;
+ validateExpression(regexValidation);
+ break;
+ default:
+ regexValidation = props.pos?.options.validation.pattern;
+ validateExpression(regexValidation);
+ }
+ }
+ };
+
+ const handleTextValid = (e) => {
+ const textInput = e.target.value;
+ setTextValue(textInput);
+ };
+ function checkRegularExpress(validateType) {
+ switch (validateType) {
+ case "email":
+ setValidatePlaceholder("[email protected]");
+ break;
+ case "number":
+ setValidatePlaceholder("12345");
+ break;
+ case "text":
+ setValidatePlaceholder("enter text");
+ break;
+ default:
+ setValidatePlaceholder("enter text");
+ }
+ }
+ useEffect(() => {
+ setDefaultdata();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ function setDefaultdata() {
+ if (props.pos?.options?.hint) {
+ setValidatePlaceholder(props.pos?.options.hint);
+ } else if (props.pos?.options?.validation?.type) {
+ checkRegularExpress(props.pos?.options?.validation?.type);
+ }
+ if (props.isNeedSign && props.pos.type === "date") {
+ const updateDate = new Date();
+ setStartDate(updateDate);
+ }
+ setTextValue(
+ props.pos?.options?.defaultValue ? props.pos?.options?.defaultValue : ""
+ );
+ if (props.pos?.type && props.pos.type === "checkbox" && props.isNeedSign) {
+ const isDefaultValue = props.pos.options?.defaultValue;
+ setSelectedCheckbox(isDefaultValue);
+ }
+ }
+ useEffect(() => {
+ if (props.pos?.type && props.pos.type === "date") {
+ if (props.selectDate) {
+ let updateDate;
+ if (props.selectDate.format === "dd-MM-yyyy") {
+ const [day, month, year] = props.saveDateFormat.split("-");
+ updateDate = new Date(`${year}-${month}-${day}`);
+ } else {
+ updateDate = new Date();
+ }
+ // const updateDate = new Date(props.saveDateFormat);
+ setStartDate(updateDate);
+ const dateObj = {
+ date: props.saveDateFormat,
+ format: props.selectDate
+ ? props.selectDate?.format
+ : props.pos?.options?.validation?.format
+ ? props.pos?.options?.validation?.format
+ : "MM/dd/YYYY"
+ };
+ props.setSelectDate(dateObj);
+ }
+
+ onChangeInput(
+ props.saveDateFormat,
+ props.pos.key,
+ props.xyPostion,
+ props.index,
+ props.setXyPostion,
+ props.data && props.data.Id,
+ false,
+ props.selectDate?.format
+ ? props.selectDate.format
+ : props.pos?.options?.validation?.format
+ ? props.pos?.options?.validation?.format
+ : "MM/dd/YYYY"
+ );
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [props.saveDateFormat]);
+
+ const dateValue = (value) => {
+ props.setSaveDateFormat(value);
+ return <span>{value}</span>;
+ };
+ const ExampleCustomInput = forwardRef(({ value, onClick }, ref) => (
+ <div
+ className="inputPlaceholder"
+ style={{ overflow: "hidden", fontSize: calculateFontSize() }}
+ onClick={onClick}
+ ref={ref}
+ >
+ {dateValue(value)}
+ <i className="fa-regular fa-calendar" style={{ marginLeft: "5px" }}></i>
+ </div>
+ ));
+ ExampleCustomInput.displayName = "ExampleCustomInput";
+
+ useEffect(() => {
+ if (props.pos?.type) {
+ const senderUser = localStorage.getItem(`Extand_Class`);
+ const jsonSender = JSON.parse(senderUser);
+
+ if (props.isNeedSign && props.data?.signerObjId === props.signerObjId) {
+ onChangeInput(
+ jsonSender && jsonSender[0],
+ null,
+ props.xyPostion,
+ null,
+ props.setXyPostion,
+ props.data.Id,
+ true
+ );
+ }
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [type]);
+
+ const calculateFontSize = () => {
+ const fontSize = 10 + Math.min(props.pos.Width, props.pos.Height) * 0.1;
+ const size = fontSize ? fontSize : 12;
+ return size + "px";
+ };
+ //function for show checked checkbox
+ const selectCheckbox = (ind) => {
+ const res = props.pos.options?.response;
+ const defaultCheck = props.pos.options?.defaultValue;
+ if (res && res?.length > 0) {
+ const isSelectIndex = res.indexOf(ind);
+ if (isSelectIndex > -1) {
+ return true;
+ } else {
+ return false;
+ }
+ // }
+ } else if (defaultCheck) {
+ const isSelectIndex = defaultCheck.indexOf(ind);
+ if (isSelectIndex > -1) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ };
+
+ const handleRadioCheck = (data) => {
+ const defaultData = props.pos.options?.defaultValue;
+ if (textValue === data) {
+ return true;
+ } else if (defaultData === data) {
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ //function for set checked and unchecked value of checkbox
+ const handleCheckboxValue = (isChecked, ind) => {
+ let updateSelectedCheckbox = [],
+ checkedList;
+ let isDefaultValue, isDefaultEmpty;
+ if (props.pos?.type && ["checkbox", "radio"].includes(props.pos.type)) {
+ updateSelectedCheckbox = selectedCheckbox;
+ if (isChecked) {
+ updateSelectedCheckbox.push(ind);
+ setSelectedCheckbox(updateSelectedCheckbox);
+ } else {
+ checkedList = selectedCheckbox.filter((data) => data !== ind);
+ setSelectedCheckbox(checkedList);
+ }
+ if (props.isNeedSign) {
+ isDefaultValue = props.pos.options?.defaultValue;
+ }
+ if (isDefaultValue && isDefaultValue.length > 0) {
+ isDefaultEmpty = true;
+ }
+ onChangeInput(
+ checkedList ? checkedList : updateSelectedCheckbox,
+ props.pos.key,
+ props.xyPostion,
+ props.index,
+ props.setXyPostion,
+ props.data && props.data.Id,
+ false,
+ null,
+ null,
+ null,
+ isDefaultEmpty
+ );
+ }
+ };
+
+ //function to handle select radio widget and set value seletced by user
+ const handleCheckRadio = (isChecked, data) => {
+ let isDefaultValue, isDefaultEmpty;
+ if (props.isNeedSign) {
+ isDefaultValue = props.pos.options?.defaultValue;
+ }
+ if (isDefaultValue) {
+ isDefaultEmpty = true;
+ }
+ if (isChecked) {
+ setTextValue(data);
+ } else {
+ setTextValue("");
+ }
+ onChangeInput(
+ textValue,
+ props.pos.key,
+ props.xyPostion,
+ props.index,
+ props.setXyPostion,
+ props.data && props.data.Id,
+ false,
+ null,
+ null,
+ null,
+ isDefaultEmpty
+ );
+ };
+ switch (props.pos.type) {
+ case "signature":
+ return props.pos.SignUrl ? (
+ <img
+ alt="signimg"
+ src={props.pos.SignUrl}
+ style={{
+ width: "99%",
+ height: "100%",
+ objectFit: "contain"
+ }}
+ />
+ ) : (
+ <div style={{ fontSize: 11, color: "black", justifyContent: "center" }}>
+ {props?.handleUserName &&
+ props?.handleUserName(
+ props?.data?.Id,
+ props?.data?.Role,
+ props?.pos?.type
+ )}
+ </div>
+ );
+ case "stamp":
+ return props.pos.SignUrl ? (
+ <img
+ alt="signimg"
+ src={props.pos.SignUrl}
+ style={{
+ width: "99%",
+ height: "100%",
+ objectFit: "contain"
+ }}
+ />
+ ) : (
+ <div style={{ fontSize: 11, color: "black", justifyContent: "center" }}>
+ {props?.handleUserName &&
+ props?.handleUserName(
+ props?.data?.Id,
+ props?.data?.Role,
+ props?.pos?.type
+ )}
+ </div>
+ );
+ case "checkbox":
+ return (
+ <div style={{ zIndex: props.isSignYourself && "99" }}>
+ {props.pos.options?.values?.map((data, ind) => {
+ return (
+ <input
+ key={ind}
+ style={{
+ width: props.pos.Width,
+ display: "flex",
+ justifyContent: "center",
+ marginBottom: "6px",
+ marginTop: "5px"
+ }}
+ onBlur={handleInputBlur}
+ disabled={
+ props.isNeedSign &&
+ props.pos.options?.isReadOnly &&
+ props.pos.options?.isReadOnly
+ }
+ type="checkbox"
+ checked={selectCheckbox(ind)}
+ onChange={(e) => {
+ if (e.target.checked && !props.isPlaceholder) {
+ const maxRequired =
+ props.pos.options?.validation?.maxRequiredCount;
+ const maxCountInt = maxRequired && parseInt(maxRequired);
+ if (maxCountInt > 0) {
+ if (selectedCheckbox.length <= maxCountInt - 1) {
+ handleCheckboxValue(e.target.checked, ind);
+ }
+ } else {
+ handleCheckboxValue(e.target.checked, ind);
+ }
+ } else {
+ handleCheckboxValue(e.target.checked, ind);
+ }
+ }}
+ />
+ );
+ })}
+ </div>
+ );
+ case "text":
+ return props.isSignYourself ||
+ (props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
+ <input
+ className="inputPlaceholder"
+ ref={inputRef}
+ placeholder={validatePlaceholder}
+ style={{ fontSize: calculateFontSize() }}
+ value={textValue}
+ type="text"
+ tabIndex="0"
+ disabled={
+ props.isNeedSign && props.data?.signerObjId !== props.signerObjId
+ ? true
+ : props.isPlaceholder
+ }
+ onBlur={handleInputBlur}
+ onChange={(e) => {
+ setTextValue(e.target.value);
+ onChangeInput(
+ e.target.value,
+ props.pos.key,
+ props.xyPostion,
+ props.index,
+ props.setXyPostion,
+ props.data && props.data?.Id,
+ false
+ );
+ }}
+ />
+ ) : (
+ <div
+ style={{
+ color: "black",
+ fontSize: calculateFontSize()
+ }}
+ >
+ <span>{props.pos.type}</span>
+ </div>
+ );
+ case "dropdown":
+ return props.data?.signerObjId === props.signerObjId ? (
+ <select
+ className="inputPlaceholder"
+ id="myDropdown"
+ style={{ fontSize: "12px" }}
+ value={selectOption}
+ onChange={(e) => {
+ setSelectOption(e.target.value);
+ onChangeInput(
+ e.target.value,
+ props.pos.key,
+ props.xyPostion,
+ props.index,
+ props.setXyPostion,
+ props.data && props.data?.Id,
+ false
+ );
+ }}
+ >
+ {/* Default/Title option */}
+ <option value="" disabled hidden>
+ {props.pos.options.name}
+ </option>
+
+ {props.pos?.options?.values.map((data, ind) => {
+ return (
+ <option key={ind} value={data}>
+ {data}
+ </option>
+ );
+ })}
+ </select>
+ ) : (
+ <div
+ className="inputPlaceholder"
+ style={{ fontSize: calculateFontSize() }}
+ >
+ {props.pos?.options?.name ? props.pos.options.name : props.pos.type}
+ </div>
+ );
+ case "initials":
+ return props.pos.SignUrl ? (
+ <img
+ alt="signimg"
+ src={props.pos.SignUrl}
+ style={{
+ width: "99%",
+ height: "100%",
+ objectFit: "contain"
+ }}
+ />
+ ) : (
+ <div style={{ fontSize: 11, color: "black", justifyContent: "center" }}>
+ {props?.handleUserName &&
+ props?.handleUserName(
+ props?.data?.Id,
+ props?.data?.Role,
+ props?.pos?.type
+ )}
+ </div>
+ );
+ case "name":
+ return props.isSignYourself ||
+ (props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
+ <input
+ tabIndex="0"
+ ref={inputRef}
+ placeholder={"name"}
+ style={{ fontSize: calculateFontSize() }}
+ className="inputPlaceholder"
+ type="text"
+ value={textValue}
+ onBlur={handleInputBlur}
+ onChange={(e) => {
+ handleTextValid(e);
+ onChangeInput(
+ e.target.value,
+ props.pos.key,
+ props.xyPostion,
+ props.index,
+ props.setXyPostion,
+ props.data && props.data?.Id,
+ false
+ );
+ }}
+ />
+ ) : (
+ <div
+ style={{
+ color: "black",
+ fontSize: calculateFontSize()
+ }}
+ >
+ <span>{props.pos.type}</span>
+ </div>
+ );
+ case "company":
+ return props.isSignYourself ||
+ (props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
+ <input
+ className="inputPlaceholder"
+ type="text"
+ ref={inputRef}
+ placeholder={"company"}
+ style={{ fontSize: calculateFontSize() }}
+ value={textValue}
+ onBlur={handleInputBlur}
+ onChange={(e) => {
+ handleTextValid(e);
+ onChangeInput(
+ e.target.value,
+ props.pos.key,
+ props.xyPostion,
+ props.index,
+ props.setXyPostion,
+ props.data && props.data?.Id,
+ false
+ );
+ }}
+ />
+ ) : (
+ <div
+ style={{
+ color: "black",
+ fontSize: calculateFontSize()
+ }}
+ >
+ <span>{props.pos.type}</span>
+ </div>
+ );
+ case "job title":
+ return props.isSignYourself ||
+ (props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
+ <input
+ className="inputPlaceholder"
+ type="text"
+ ref={inputRef}
+ placeholder={"job title"}
+ style={{ fontSize: calculateFontSize() }}
+ value={textValue}
+ onBlur={handleInputBlur}
+ onChange={(e) => {
+ handleTextValid(e);
+ onChangeInput(
+ e.target.value,
+ props.pos.key,
+ props.xyPostion,
+ props.index,
+ props.setXyPostion,
+ props.data && props.data?.Id,
+ false
+ );
+ }}
+ />
+ ) : (
+ <div
+ style={{
+ color: "black",
+ fontSize: calculateFontSize()
+ }}
+ >
+ <span>{props.pos.type}</span>
+ </div>
+ );
+ case "date":
+ return (
+ <div>
+ <DatePicker
+ disabled={
+ props.isNeedSign && props.data?.signerObjId !== props.signerObjId
+ }
+ onBlur={handleInputBlur}
+ closeOnScroll={true}
+ className="inputPlaceholder"
+ style={{ outlineColor: "#007bff" }}
+ selected={
+ startDate
+ ? startDate
+ : props.pos.options?.response &&
+ new Date(props.pos.options.response)
+ }
+ onChange={(date) => {
+ setStartDate(date);
+ }}
+ popperPlacement="top-end"
+ customInput={<ExampleCustomInput />}
+ dateFormat={
+ props.selectDate
+ ? props.selectDate?.format
+ : props.pos?.options?.validation?.format
+ ? props.pos?.options?.validation?.format
+ : "dd MMMM, YYYY"
+ }
+ />
+ </div>
+ );
+ case "image":
+ return props.pos.SignUrl ? (
+ <img
+ alt="signimg"
+ src={props.pos.SignUrl}
+ style={{
+ width: "99%",
+ height: "100%",
+ objectFit: "contain"
+ }}
+ />
+ ) : (
+ <div style={{ fontSize: 11, color: "black", justifyContent: "center" }}>
+ {props?.handleUserName &&
+ props?.handleUserName(
+ props?.data?.Id,
+ props?.data?.Role,
+ props?.pos?.type
+ )}
+ </div>
+ );
+ case "email":
+ return props.isSignYourself ||
+ (props.isNeedSign && props.data?.signerObjId === props.signerObjId) ? (
+ <input
+ className="inputPlaceholder"
+ type="text"
+ ref={inputRef}
+ placeholder={"email"}
+ style={{ fontSize: calculateFontSize() }}
+ value={textValue}
+ onBlur={handleInputBlur}
+ onChange={(e) => {
+ handleTextValid(e);
+ onChangeInput(
+ e.target.value,
+ props.pos.key,
+ props.xyPostion,
+ props.index,
+ props.setXyPostion,
+ props.data && props.data?.Id,
+ false
+ );
+ }}
+ />
+ ) : (
+ <div
+ style={{
+ color: "black",
+ fontSize: calculateFontSize()
+ }}
+ >
+ <span>{props.pos.type}</span>
+ </div>
+ );
+ case "radio":
+ return (
+ <div>
+ {props.pos.options?.values.map((data, ind) => {
+ return (
+ <input
+ key={ind}
+ style={{
+ width: props.pos.Width,
+ display: "flex",
+ justifyContent: "center",
+ marginBottom: "6px",
+ marginTop: "5px"
+ }}
+ type="radio"
+ disabled={
+ props.isNeedSign &&
+ props.pos.options?.isReadOnly &&
+ props.pos.options?.isReadOnly
+ }
+ // disabled={props.isPlaceholder}
+ checked={handleRadioCheck(data)}
+ // checked={isCheckedRadio.isChecked}
+ onChange={(e) => {
+ if (!props.isPlaceholder) {
+ handleCheckRadio(e.target.checked, data);
+ }
+ }}
+ />
+ );
+ })}
+ </div>
+ );
+ case "label":
+ return (
+ <textarea
+ rows={1}
+ onChange={(e) => {
+ onChangeInput(
+ e.target.value,
+ props.pos.key,
+ props.xyPostion,
+ props.index,
+ props.setXyPostion,
+ props.data && props.data?.Id,
+ false
+ );
+ }}
+ className="labelTextArea"
+ cols="50"
+ />
+ );
+ default:
+ return props.pos.SignUrl ? (
+ <div style={{ pointerEvents: "none" }}>
+ <img
+ alt="signimg"
+ src={props.pos.SignUrl}
+ style={{
+ width: "99%",
+ height: "100%",
+ objectFit: "contain"
+ }}
+ />
+ </div>
+ ) : (
+ <div
+ style={{
+ fontSize: "10px",
+ color: "black",
+ justifyContent: "center"
+ }}
+ >
+ {props.pos.isStamp ? <div>stamp</div> : <div>signature</div>}
+ {props?.handleUserName &&
+ props?.handleUserName(props?.data?.Id, props?.data?.Role)}
+ </div>
+ );
+ }
+}
+
+export default PlaceholderType;
diff --git a/apps/OpenSign/src/components/pdf/PrevNext.js b/apps/OpenSign/src/components/pdf/PrevNext.js
new file mode 100644
index 000000000..363695042
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/PrevNext.js
@@ -0,0 +1,58 @@
+import React from "react";
+
+function PrevNext({ pageNumber, allPages, changePage }) {
+ //for go to previous page
+ function previousPage() {
+ changePage(-1);
+ }
+ //for go to next page
+ function nextPage() {
+ changePage(1);
+ }
+
+ return (
+ <div>
+ <div className="preBtn1">
+ <button
+ style={{
+ padding: "3px 20px ",
+ fontSize: "10px",
+ background: "#d3edeb",
+ fontWeight: "600",
+
+ border: "0px",
+ marginRight: "5px"
+ }}
+ disabled={pageNumber <= 1}
+ onClick={previousPage}
+ >
+ Prev
+ </button>
+ <span
+ style={{
+ fontSize: "13px",
+ fontWeight: "600"
+ }}
+ >
+ {pageNumber || (allPages ? 1 : "--")} of {allPages || "--"}
+ </span>
+ <button
+ style={{
+ padding: "3px 20px ",
+ fontSize: "10px",
+ background: "#d3edeb",
+ fontWeight: "600",
+ marginLeft: "5px",
+ border: "0px"
+ }}
+ disabled={pageNumber >= allPages}
+ onClick={nextPage}
+ >
+ Next
+ </button>
+ </div>
+ </div>
+ );
+}
+
+export default PrevNext;
diff --git a/apps/OpenSign/src/components/pdf/RecipientList.js b/apps/OpenSign/src/components/pdf/RecipientList.js
new file mode 100644
index 000000000..cf4edc665
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/RecipientList.js
@@ -0,0 +1,208 @@
+import React, { useRef, useState } from "react";
+import "../../styles/signerListPlace.css";
+import { darkenColor, getFirstLetter } from "../../constant/Utils";
+
+const RecipientList = (props) => {
+ const color = [
+ "#93a3db",
+ "#e6c3db",
+ "#c0e3bc",
+ "#bce3db",
+ "#b8ccdb",
+ "#ceb8db",
+ "#ffccff",
+ "#99ffcc",
+ "#cc99ff",
+ "#ffcc99",
+ "#66ccff",
+ "#ffffcc"
+ ];
+
+ const nameColor = [
+ "#304fbf",
+ "#7d5270",
+ "#5f825b",
+ "#578077",
+ "#576e80",
+ "#6d527d",
+ "#cc00cc",
+ "#006666",
+ "#cc00ff",
+ "#ff9900",
+ "#336699",
+ "#cc9900"
+ ];
+ const [isHover, setIsHover] = useState();
+ const [isEdit, setIsEdit] = useState(false);
+ //function for onhover signer name change background color
+ const inputRef = useRef(null);
+ const onHoverStyle = (ind, blockColor) => {
+ const style = {
+ background: blockColor ? blockColor : color[ind % color.length],
+ padding: "10px",
+ marginTop: "2px",
+ display: "flex",
+ flexDirection: "row",
+ borderBottom: "1px solid #e3e1e1",
+ alignItems: "center"
+ };
+ return style;
+ };
+ //function for onhover signer name remove background color
+ const nonHoverStyle = () => {
+ const style = {
+ padding: "10px",
+ marginTop: "2px",
+ display: "flex",
+ flexDirection: "row",
+ borderBottom: "1px solid #e3e1e1",
+ alignItems: "center"
+ };
+ return style;
+ };
+ const isWidgetExist = (Id) => {
+ return props.signerPos.some((x) => x.Id === Id);
+ };
+
+ return (
+ <>
+ {props.signersdata.length > 0 &&
+ props.signersdata.map((obj, ind) => {
+ return (
+ <div
+ data-tut="reactourFirst"
+ onMouseEnter={() => setIsHover(ind)}
+ onMouseLeave={() => setIsHover(null)}
+ key={ind}
+ style={
+ isHover === ind || props.isSelectListId === ind
+ ? onHoverStyle(ind, obj.blockColor)
+ : nonHoverStyle(ind)
+ }
+ onClick={() => {
+ props.setSignerObjId(obj?.objectId || "");
+ props.setIsSelectId(ind);
+ props.setContractName(obj?.className || "");
+ props.setUniqueId(obj.Id);
+ props.setRoleName(obj.Role);
+ if (props.handleModal) {
+ props.handleModal();
+ }
+ }}
+ >
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center",
+ width: "100%"
+ }}
+ >
+ <div
+ className="signerStyle"
+ style={{
+ background: obj.blockColor
+ ? darkenColor(obj.blockColor, 0.4)
+ : nameColor[ind % nameColor.length],
+ width: 30,
+ height: 30,
+ display: "flex",
+ borderRadius: 30 / 2,
+ justifyContent: "center",
+ alignItems: "center",
+ marginRight: "12px"
+ }}
+ >
+ <span
+ style={{
+ fontSize: "12px",
+ textAlign: "center",
+ fontWeight: "bold",
+ color: "white",
+ textTransform: "uppercase"
+ }}
+ >
+ {isWidgetExist(obj.Id) ? (
+ <i className="fa-solid fa-check"></i>
+ ) : (
+ <>
+ {obj.Name
+ ? getFirstLetter(obj.Name)
+ : getFirstLetter(obj.Role)}
+ </>
+ )}
+ </span>
+ </div>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: obj.Name ? "column" : "row",
+ alignItems: "center"
+ }}
+ >
+ {obj.Name ? (
+ <span className="userName" style={{ cursor: "default" }}>
+ {obj.Name}
+ </span>
+ ) : (
+ <>
+ <span
+ className="userName"
+ onClick={() => {
+ setIsEdit({ [obj.Id]: true });
+ props.setRoleName(obj.Role);
+ }}
+ >
+ {isEdit?.[obj.Id] && props.handleRoleChange ? (
+ <input
+ ref={inputRef}
+ style={{
+ backgroundColor: "transparent",
+ width: "inherit"
+ }}
+ value={obj.Role}
+ onChange={(e) => props.handleRoleChange(e, obj.Id)}
+ onBlur={() => {
+ setIsEdit({});
+ props.handleOnBlur(obj.Role, obj.Id);
+ }}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ e.preventDefault();
+ inputRef.current.blur();
+ }
+ }}
+ />
+ ) : (
+ obj.Role
+ )}
+ </span>
+ </>
+ )}
+ {obj.Name && (
+ <span className="useEmail" style={{ cursor: "default" }}>
+ {obj.Role}
+ </span>
+ )}
+ </div>
+ </div>
+ {props.handleDeleteUser && (
+ <div
+ onClick={(e) => {
+ e.stopPropagation();
+ props.handleDeleteUser(obj.Id);
+ }}
+ style={{ cursor: "pointer" }}
+ >
+ <i className="fa-regular fa-trash-can"></i>
+ </div>
+ )}
+ <hr />
+ </div>
+ );
+ })}
+ </>
+ );
+};
+
+export default RecipientList;
diff --git a/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js b/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js
new file mode 100644
index 000000000..7c045bbc4
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/RenderAllPdfPage.js
@@ -0,0 +1,101 @@
+import React from "react";
+import RSC from "react-scrollbars-custom";
+import { Document, Page } from "react-pdf";
+import { themeColor } from "../../constant/const";
+
+function RenderAllPdfPage({
+ pdfUrl,
+ signPdfUrl,
+ allPages,
+ setAllPages,
+ setPageNumber,
+ setSignBtnPosition,
+ pageNumber
+}) {
+ //set all number of pages after load pdf
+ function onDocumentLoad({ numPages }) {
+ setAllPages(numPages);
+ }
+
+ return (
+ <div className="showPages">
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ boxShadow: "rgba(17, 12, 46, 0.15) 0px 48px 100px 0px",
+ backgroundColor: "white",
+ height: "100%"
+ }}
+ >
+ <div style={{ width: "140px" }}>
+ <div
+ style={{
+ background: themeColor
+ // color:"white"
+ }}
+ className="signedStyle"
+ >
+ Pages
+ </div>
+
+ <div>
+ <RSC
+ id="RSC-Example"
+ style={{
+ width: "135px",
+ height: window.innerHeight - 130 + "px"
+ }}
+ >
+ <Document
+ loading={"Loading Document.."}
+ onLoadSuccess={onDocumentLoad}
+ file={pdfUrl ? pdfUrl : signPdfUrl}
+ // file="https://api.printnode.com/static/test/pdf/multipage.pdf"
+ >
+ {Array.from(new Array(allPages), (el, index) => (
+ <div
+ key={index}
+ style={{
+ width: "100px",
+ border:
+ pageNumber - 1 === index
+ ? "2px solid red"
+ : "2px solid #878787",
+ // padding: "5px",
+ margin: "10px",
+
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ contain: "content"
+ }}
+ onClick={() => {
+ setPageNumber(index + 1);
+ if (setSignBtnPosition) {
+ setSignBtnPosition([]);
+ }
+ }}
+ >
+ <Page
+ key={`page_${index + 1}`}
+ pageNumber={index + 1}
+ width={100}
+ height={100}
+ scale={1}
+ renderAnnotationLayer={false}
+ renderTextLayer={false}
+ />
+ </div>
+ ))}
+ </Document>
+ </RSC>
+ </div>
+ <hr />
+ </div>
+ </div>
+ </div>
+ );
+}
+
+export default RenderAllPdfPage;
diff --git a/apps/OpenSign/src/components/pdf/RenderPdf.js b/apps/OpenSign/src/components/pdf/RenderPdf.js
new file mode 100644
index 000000000..043f97845
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/RenderPdf.js
@@ -0,0 +1,684 @@
+import React from "react";
+import RSC from "react-scrollbars-custom";
+import { Document, Page } from "react-pdf";
+import {
+ defaultWidthHeight,
+ handleImageResize,
+ handleSignYourselfImageResize
+} from "../../constant/Utils";
+import EmailToast from "../../primitives/EmailToast";
+import Placeholder from "./Placeholder";
+
+function RenderPdf({
+ pageNumber,
+ pdfOriginalWidth,
+ pdfNewWidth,
+ drop,
+ signerPos,
+ successEmail,
+ handleTabDrag,
+ handleStop,
+ isDragging,
+ setIsSignPad,
+ setIsStamp,
+ handleDeleteSign,
+ setSignKey,
+ pdfDetails,
+ xyPostion,
+ pdfUrl,
+ numPages,
+ pageDetails,
+ pdfRequest,
+ setCurrentSigner,
+ signerObjectId,
+ signedSigners,
+ setPdfLoadFail,
+ placeholder,
+ pdfLoadFail,
+ setSignerPos,
+ setXyPostion,
+ index,
+ containerWH,
+ setIsResize,
+ handleLinkUser,
+ setUniqueId,
+ signersdata,
+ setIsPageCopy,
+ setSignerObjId,
+ setShowDropdown,
+ setIsInitial,
+ setIsValidate,
+ setWidgetType,
+ setValidateAlert,
+ setIsRadio,
+ setCurrWidgetsDetails,
+ setSelectWidgetId,
+ selectWidgetId,
+ unSignedWidgetId,
+ setIsCheckbox,
+ handleNameModal
+}) {
+ const isMobile = window.innerWidth < 767;
+ const newWidth = containerWH.width;
+ const scale = isMobile ? pdfOriginalWidth / newWidth : 1;
+ //check isGuestSigner is present in local if yes than handle login flow header in mobile view
+ const isGuestSigner = localStorage.getItem("isGuestSigner");
+
+ // handle signature block width and height according to screen
+ const posWidth = (pos, signYourself) => {
+ const defaultWidth = defaultWidthHeight(pos.type).width;
+ const posWidth = pos.Width ? pos.Width : defaultWidth;
+ let width;
+ if (signYourself) {
+ width = posWidth;
+ return width;
+ } else {
+ if (isMobile) {
+ if (!pos.isMobile) {
+ if (pos.IsResize) {
+ width = posWidth ? posWidth : defaultWidth;
+ return width;
+ } else {
+ width = (posWidth || defaultWidth) / scale;
+
+ return width;
+ }
+ } else {
+ width = posWidth;
+ return width;
+ }
+ } else {
+ if (pos.isMobile) {
+ if (pos.IsResize) {
+ width = posWidth ? posWidth : defaultWidth;
+ return width;
+ } else {
+ width = (posWidth || defaultWidth) * pos.scale;
+ return width;
+ }
+ } else {
+ width = posWidth ? posWidth : defaultWidth;
+ return width;
+ }
+ }
+ }
+ };
+ const posHeight = (pos, signYourself) => {
+ let height;
+ const posHeight = pos.Height;
+ const defaultHeight = defaultWidthHeight(pos.type).height;
+
+ if (signYourself) {
+ height = posHeight ? posHeight : defaultHeight;
+
+ return height;
+ } else {
+ if (isMobile) {
+ if (!pos.isMobile) {
+ if (pos.IsResize) {
+ height = posHeight ? posHeight : defaultHeight;
+ return height;
+ } else {
+ height = (posHeight || defaultHeight) / scale;
+
+ return height;
+ }
+ } else {
+ height = posHeight ? posHeight : defaultHeight;
+ return height;
+ }
+ } else {
+ if (pos.isMobile) {
+ if (pos.IsResize) {
+ height = posHeight ? posHeight : defaultHeight;
+ return height;
+ } else {
+ height = (posHeight || defaultHeight) * pos.scale;
+ return height;
+ }
+ } else {
+ height = posHeight ? posHeight : defaultHeight;
+ return height;
+ }
+ }
+ }
+ };
+
+ const xPos = (pos, signYourself) => {
+ const resizePos = pos.xPosition;
+ if (signYourself) {
+ return resizePos;
+ } else {
+ //checking both condition mobile and desktop view
+ if (isMobile) {
+ //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale
+ if (!pos.isMobile) {
+ return resizePos / scale;
+ }
+ //pos.isMobile true -- placeholder save from mobile view(small device) handle position in mobile view(small screen) view divided by scale
+ else {
+ return resizePos * (pos.scale / scale);
+ }
+ } else {
+ //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale
+
+ if (pos.isMobile) {
+ return pos.scale && resizePos * pos.scale;
+ }
+ //else placeholder save from desktop(bigscreen) and show in desktop(bigscreen)
+ else {
+ return resizePos;
+ }
+ }
+ }
+ };
+ const yPos = (pos, signYourself) => {
+ const resizePos = pos.yPosition;
+ if (signYourself) {
+ return resizePos;
+ } else {
+ //checking both condition mobile and desktop view
+ if (isMobile) {
+ //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale
+ if (!pos.isMobile) {
+ return resizePos / scale;
+ }
+ //pos.isMobile true -- placeholder save from mobile view(small device) handle position in mobile view(small screen) view divided by scale
+ else {
+ return resizePos * (pos.scale / scale);
+ }
+ } else {
+ //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale
+
+ if (pos.isMobile) {
+ return pos.scale && resizePos * pos.scale;
+ }
+ //else placeholder save from desktop(bigscreen) and show in desktop(bigscreen)
+ else {
+ return resizePos;
+ }
+ }
+ }
+ };
+ //function for render placeholder block over pdf document
+ const checkSignedSignes = (data) => {
+ const checkSign = signedSigners.filter(
+ (sign) => sign.objectId === data.signerObjId
+ );
+ if (data.signerObjId === signerObjectId) {
+ setCurrentSigner(true);
+ }
+ const handleAllUserName = (Id, Role, type) => {
+ return pdfDetails[0].Signers.map((signerData, key) => {
+ return (
+ signerData.objectId === data.signerObjId && (
+ <React.Fragment key={key}>
+ {signerData?.Name && (
+ <div style={{ color: "black", fontSize: 8, fontWeight: "500" }}>
+ {signerData.Name}
+ </div>
+ )}
+ {type && (
+ <div style={{ fontWeight: "700", fontSize: 11 }}>{type}</div>
+ )}
+ {Role && (
+ <div style={{ color: "black", fontSize: 8, fontWeight: "500" }}>
+ {`(${Role})`}
+ </div>
+ )}
+ </React.Fragment>
+ )
+ );
+ });
+ };
+
+ return (
+ checkSign.length === 0 &&
+ data.placeHolder.map((placeData, key) => {
+ return (
+ <React.Fragment key={key}>
+ {placeData.pageNumber === pageNumber &&
+ placeData.pos.map((pos) => {
+ return (
+ pos && (
+ <React.Fragment key={pos.key}>
+ <Placeholder
+ pos={pos}
+ setSignKey={setSignKey}
+ setIsSignPad={setIsSignPad}
+ setIsStamp={setIsStamp}
+ handleSignYourselfImageResize={handleImageResize}
+ index={pageNumber}
+ xyPostion={signerPos}
+ setXyPostion={setSignerPos}
+ data={data}
+ setIsResize={setIsResize}
+ isShowBorder={false}
+ signerObjId={signerObjectId}
+ isShowDropdown={true}
+ isNeedSign={true}
+ isSignYourself={false}
+ xPos={xPos}
+ yPos={yPos}
+ posWidth={posWidth}
+ posHeight={posHeight}
+ handleUserName={handleAllUserName}
+ isDragging={false}
+ pdfDetails={pdfDetails}
+ setIsInitial={setIsInitial}
+ setValidateAlert={setValidateAlert}
+ unSignedWidgetId={unSignedWidgetId}
+ />
+ </React.Fragment>
+ )
+ );
+ })}
+ </React.Fragment>
+ );
+ })
+ );
+ };
+
+ const handleUserName = (Id, Role, type) => {
+ if (Id) {
+ const checkSign = signersdata.find((sign) => sign.Id === Id);
+ if (checkSign?.Name) {
+ return (
+ <>
+ <div style={{ color: "black", fontSize: 8, fontWeight: "500" }}>
+ {checkSign?.Name}
+ </div>
+ {type && (
+ <div style={{ fontWeight: "700", fontSize: 11 }}>{type}</div>
+ )}
+ <div style={{ color: "black", fontSize: 8, fontWeight: "500" }}>
+ {`(${Role})`}
+ </div>
+ </>
+ );
+ } else {
+ return (
+ <>
+ {type && (
+ <div style={{ fontWeight: "700", fontSize: 11 }}>{type}</div>
+ )}
+ <div style={{ color: "black", fontSize: 8, fontWeight: "500" }}>
+ {Role}
+ </div>
+ </>
+ );
+ }
+ } else {
+ return (
+ <>
+ {type && (
+ <div style={{ fontWeight: "700", fontSize: 11 }}>{type}</div>
+ )}
+ <div style={{ color: "black", fontSize: 8, fontWeight: "500" }}>
+ {Role}
+ </div>
+ </>
+ );
+ }
+ };
+
+ return (
+ <>
+ {isMobile && scale ? (
+ <div
+ style={{
+ border: "0.1px solid #ebe8e8",
+ marginTop: isGuestSigner && "30px"
+ }}
+ ref={drop}
+ id="container"
+ >
+ <EmailToast isShow={successEmail} />
+ {pdfLoadFail.status &&
+ (pdfRequest
+ ? signerPos.map((data, key) => {
+ return (
+ <React.Fragment key={key}>
+ {checkSignedSignes(data)}
+ </React.Fragment>
+ );
+ })
+ : placeholder // placeholder mobile
+ ? signerPos.map((data, ind) => {
+ return (
+ <React.Fragment key={ind}>
+ {data.placeHolder.map((placeData, index) => {
+ return (
+ <React.Fragment key={index}>
+ {placeData.pageNumber === pageNumber &&
+ placeData.pos.map((pos) => {
+ return (
+ <React.Fragment key={pos.key}>
+ <Placeholder
+ pos={pos}
+ setIsPageCopy={setIsPageCopy}
+ setSignKey={setSignKey}
+ handleDeleteSign={handleDeleteSign}
+ setIsStamp={setIsStamp}
+ handleTabDrag={handleTabDrag}
+ handleStop={handleStop}
+ handleSignYourselfImageResize={
+ handleImageResize
+ }
+ index={pageNumber}
+ xyPostion={signerPos}
+ setXyPostion={setSignerPos}
+ setSignerObjId={setSignerObjId}
+ data={data}
+ setIsResize={setIsResize}
+ setShowDropdown={setShowDropdown}
+ isShowBorder={true}
+ isPlaceholder={true}
+ setUniqueId={setUniqueId}
+ handleLinkUser={handleLinkUser}
+ handleUserName={handleUserName}
+ isSignYourself={false}
+ xPos={xPos}
+ yPos={yPos}
+ posWidth={posWidth}
+ posHeight={posHeight}
+ isDragging={isDragging}
+ setIsValidate={setIsValidate}
+ setWidgetType={setWidgetType}
+ setIsRadio={setIsRadio}
+ setIsCheckbox={setIsCheckbox}
+ setCurrWidgetsDetails={
+ setCurrWidgetsDetails
+ }
+ setSelectWidgetId={setSelectWidgetId}
+ selectWidgetId={selectWidgetId}
+ handleNameModal={handleNameModal}
+ />
+ </React.Fragment>
+ );
+ })}
+ </React.Fragment>
+ );
+ })}
+ </React.Fragment>
+ );
+ })
+ : xyPostion.map((data, ind) => {
+ return (
+ <React.Fragment key={ind}>
+ {data.pageNumber === pageNumber &&
+ data.pos.map((pos) => {
+ return (
+ pos && (
+ <Placeholder
+ pos={pos}
+ setIsPageCopy={setIsPageCopy}
+ setSignKey={setSignKey}
+ handleDeleteSign={handleDeleteSign}
+ setIsStamp={setIsStamp}
+ handleTabDrag={handleTabDrag}
+ handleStop={handleStop}
+ handleSignYourselfImageResize={
+ handleSignYourselfImageResize
+ }
+ index={index}
+ xyPostion={xyPostion}
+ setXyPostion={setXyPostion}
+ pdfOriginalWidth={pdfOriginalWidth}
+ containerWH={containerWH}
+ setIsSignPad={setIsSignPad}
+ isShowBorder={true}
+ isSignYourself={true}
+ xPos={xPos}
+ yPos={yPos}
+ posWidth={posWidth}
+ posHeight={posHeight}
+ pdfDetails={pdfDetails[0]}
+ isDragging={isDragging}
+ setIsInitial={setIsInitial}
+ setWidgetType={setWidgetType}
+ setSelectWidgetId={setSelectWidgetId}
+ selectWidgetId={selectWidgetId}
+ handleUserName={handleUserName}
+ setIsCheckbox={setIsCheckbox}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ />
+ )
+ );
+ })}
+ </React.Fragment>
+ );
+ }))}
+
+ {/* this component for render pdf document is in middle of the component */}
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center"
+ }}
+ >
+ <Document
+ onLoadError={() => {
+ setPdfLoadFail(true);
+ }}
+ loading={"Loading Document.."}
+ onLoadSuccess={pageDetails}
+ // ref={pdfRef}'
+ onClick={() => {
+ if (setSelectWidgetId) {
+ setSelectWidgetId("");
+ }
+ }}
+ file={
+ pdfUrl
+ ? pdfUrl
+ : pdfDetails[0] && pdfDetails[0].SignedUrl
+ ? pdfDetails[0].SignedUrl
+ : pdfDetails[0].URL
+ }
+ >
+ {Array.from(new Array(numPages), (el, index) => (
+ <Page
+ key={index}
+ pageNumber={pageNumber}
+ width={containerWH.width}
+ height={containerWH.height}
+ renderAnnotationLayer={false}
+ renderTextLayer={false}
+ onGetAnnotationsError={(error) => {
+ console.log("annotation error", error);
+ }}
+ />
+ ))}
+ </Document>
+ </div>
+ </div>
+ ) : (
+ <RSC
+ style={{
+ position: "relative",
+ boxShadow: "rgba(17, 12, 46, 0.15) 0px 48px 100px 0px",
+ width:
+ pdfOriginalWidth > pdfNewWidth ? pdfNewWidth : pdfOriginalWidth,
+ height: window.innerHeight - 110 + "px"
+ }}
+ noScrollY={false}
+ noScrollX={pdfNewWidth < pdfOriginalWidth ? false : true}
+ >
+ <div
+ style={{
+ border: "0.1px solid #ebe8e8",
+ width: pdfOriginalWidth
+ }}
+ ref={drop}
+ id="container"
+ >
+ <EmailToast isShow={successEmail} />
+ {pdfLoadFail.status &&
+ (pdfRequest
+ ? signerPos.map((data, key) => {
+ return (
+ <React.Fragment key={key}>
+ {checkSignedSignes(data)}
+ </React.Fragment>
+ );
+ })
+ : placeholder
+ ? signerPos.map((data, ind) => {
+ return (
+ <React.Fragment key={ind}>
+ {data.placeHolder.map((placeData, index) => {
+ return (
+ <React.Fragment key={index}>
+ {placeData.pageNumber === pageNumber &&
+ placeData.pos.map((pos) => {
+ return (
+ <React.Fragment key={pos.key}>
+ <Placeholder
+ pos={pos}
+ setIsPageCopy={setIsPageCopy}
+ setSignKey={setSignKey}
+ handleDeleteSign={handleDeleteSign}
+ setIsStamp={setIsStamp}
+ handleTabDrag={handleTabDrag}
+ handleStop={handleStop}
+ handleSignYourselfImageResize={
+ handleImageResize
+ }
+ index={pageNumber}
+ xyPostion={signerPos}
+ setXyPostion={setSignerPos}
+ setSignerObjId={setSignerObjId}
+ data={data}
+ setIsResize={setIsResize}
+ setShowDropdown={setShowDropdown}
+ isShowBorder={true}
+ isPlaceholder={true}
+ setUniqueId={setUniqueId}
+ handleLinkUser={handleLinkUser}
+ handleUserName={handleUserName}
+ isSignYourself={false}
+ xPos={xPos}
+ yPos={yPos}
+ posWidth={posWidth}
+ posHeight={posHeight}
+ isDragging={isDragging}
+ setIsValidate={setIsValidate}
+ setWidgetType={setWidgetType}
+ setIsRadio={setIsRadio}
+ setIsCheckbox={setIsCheckbox}
+ setCurrWidgetsDetails={
+ setCurrWidgetsDetails
+ }
+ setSelectWidgetId={setSelectWidgetId}
+ selectWidgetId={selectWidgetId}
+ handleNameModal={handleNameModal}
+ />
+ </React.Fragment>
+ );
+ })}
+ </React.Fragment>
+ );
+ })}
+ </React.Fragment>
+ );
+ })
+ : xyPostion.map((data, ind) => {
+ return (
+ <React.Fragment key={ind}>
+ {data.pageNumber === pageNumber &&
+ data.pos.map((pos) => {
+ return (
+ pos && (
+ <React.Fragment key={pos.key}>
+ <Placeholder
+ pos={pos}
+ setIsPageCopy={setIsPageCopy}
+ setSignKey={setSignKey}
+ handleDeleteSign={handleDeleteSign}
+ setIsStamp={setIsStamp}
+ handleTabDrag={handleTabDrag}
+ handleStop={(event, dragElement) =>
+ handleStop(event, dragElement, pos.type)
+ }
+ handleSignYourselfImageResize={
+ handleSignYourselfImageResize
+ }
+ index={index}
+ xyPostion={xyPostion}
+ setXyPostion={setXyPostion}
+ pdfOriginalWidth={pdfOriginalWidth}
+ containerWH={containerWH}
+ setIsSignPad={setIsSignPad}
+ isShowBorder={true}
+ isSignYourself={true}
+ xPos={xPos}
+ yPos={yPos}
+ posWidth={posWidth}
+ posHeight={posHeight}
+ pdfDetails={pdfDetails[0]}
+ isDragging={isDragging}
+ setIsInitial={setIsInitial}
+ setWidgetType={setWidgetType}
+ setSelectWidgetId={setSelectWidgetId}
+ selectWidgetId={selectWidgetId}
+ handleUserName={handleUserName}
+ setIsCheckbox={setIsCheckbox}
+ setCurrWidgetsDetails={
+ setCurrWidgetsDetails
+ }
+ />
+ </React.Fragment>
+ )
+ );
+ })}
+ </React.Fragment>
+ );
+ }))}
+
+ {/* this component for render pdf document is in middle of the component */}
+ <Document
+ onLoadError={() => {
+ const load = {
+ status: false,
+ type: "failed"
+ };
+ setPdfLoadFail(load);
+ }}
+ loading={"Loading Document.."}
+ onLoadSuccess={pageDetails}
+ onClick={() => {
+ if (setSelectWidgetId) {
+ setSelectWidgetId("");
+ }
+ }}
+ // ref={pdfRef}
+ file={
+ pdfUrl
+ ? pdfUrl
+ : pdfDetails[0] && pdfDetails[0].SignedUrl
+ ? pdfDetails[0].SignedUrl
+ : pdfDetails[0].URL
+ }
+ >
+ {Array.from(new Array(numPages), (el, index) => (
+ <Page
+ key={index}
+ pageNumber={pageNumber}
+ renderAnnotationLayer={false}
+ renderTextLayer={false}
+ onGetAnnotationsError={(error) => {
+ console.log("annotation error", error);
+ }}
+ />
+ ))}
+ </Document>
+ </div>
+ </RSC>
+ )}
+ </>
+ );
+}
+
+export default RenderPdf;
diff --git a/apps/OpenSign/src/components/pdf/SignPad.js b/apps/OpenSign/src/components/pdf/SignPad.js
new file mode 100644
index 000000000..9428f8297
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/SignPad.js
@@ -0,0 +1,677 @@
+import React, { useRef, useState, useEffect } from "react";
+import SignatureCanvas from "react-signature-canvas";
+import redPen from "../../assets/images/redPen.png";
+import bluePen from "../../assets/images/bluePen.png";
+import blackPen from "../../assets/images/blackPen.png";
+import { themeColor } from "../../constant/const";
+
+function SignPad({
+ isSignPad,
+ isStamp,
+ setIsImageSelect,
+ onSaveSign,
+ setIsSignPad,
+ setImage,
+ isImageSelect,
+ imageRef,
+ onImageChange,
+ onSaveImage,
+ image,
+ defaultSign,
+ setSignature,
+ myInitial,
+ isInitial,
+ setIsInitial,
+ setIsStamp,
+ widgetType
+}) {
+ const [penColor, setPenColor] = useState("blue");
+ const allColor = [bluePen, redPen, blackPen];
+ const canvasRef = useRef(null);
+ const [isDefaultSign, setIsDefaultSign] = useState(false);
+ const [isTab, setIsTab] = useState("draw");
+ const [isSignImg, setIsSignImg] = useState("");
+ const [signValue, setSignValue] = useState("");
+ const [textWidth, setTextWidth] = useState(null);
+ const [textHeight, setTextHeight] = useState(null);
+ const fontOptions = [
+ { value: "Fasthand" },
+ { value: "Dancing Script" },
+ { value: "Cedarville Cursive" },
+ { value: "Delicious Handrawn" }
+ // Add more font options as needed
+ ];
+ const [fontSelect, setFontSelect] = useState(fontOptions[0].value);
+
+ const senderUser =
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ ) &&
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ );
+ const jsonSender = JSON.parse(senderUser);
+
+ const currentUserName = jsonSender && jsonSender.name;
+
+ useEffect(() => {
+ const trimmedName = currentUserName.trim();
+ const firstCharacter = trimmedName.charAt(0);
+ const userName = isInitial ? firstCharacter : currentUserName;
+ setSignValue(userName);
+ setFontSelect("Fasthand");
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+ //function for clear signature image
+ const handleClear = () => {
+ if (isTab === "draw") {
+ if (canvasRef.current) {
+ canvasRef.current.clear();
+ } else if (isStamp) {
+ setImage("");
+ }
+
+ setIsSignImg("");
+ } else if (isTab === "uploadImage") {
+ setImage("");
+ }
+ setIsInitial(false);
+ };
+ //function for set signature url
+ const handleSignatureChange = () => {
+ // canvasRef.current.backgroundColor = 'rgb(165, 26, 26)'
+ setSignature(canvasRef.current.toDataURL());
+ setIsSignImg(canvasRef.current.toDataURL());
+ };
+
+ //save button component
+ const SaveBtn = () => {
+ return (
+ <div style={{ marginTop: "2px" }}>
+ {(isTab === "draw" || isTab === "uploadImage") && (
+ <button
+ style={{
+ color: "black",
+ border: "1px solid #ccc"
+ }}
+ type="button"
+ className="finishBtn saveBtn"
+ onClick={() => handleClear()}
+ >
+ Clear
+ </button>
+ )}
+
+ <button
+ onClick={() => {
+ if (!image) {
+ if (isTab === "mysignature") {
+ setIsSignImg("");
+ if (isInitial) {
+ onSaveSign("initials");
+ } else {
+ onSaveSign("default");
+ }
+ } else {
+ if (isTab === "type") {
+ setIsSignImg("");
+ onSaveSign(false, textWidth, textHeight);
+ } else {
+ setIsSignImg("");
+ onSaveSign();
+ }
+ }
+
+ setPenColor("blue");
+ } else {
+ setIsSignImg("");
+ onSaveImage();
+ }
+ setIsSignPad(false);
+ setIsInitial(false);
+ setIsImageSelect(false);
+ setIsDefaultSign(false);
+ setImage();
+ setIsTab("draw");
+ setSignValue("");
+ setIsStamp(false);
+ }}
+ style={{
+ background: themeColor,
+ color: "white"
+ }}
+ disabled={
+ isSignImg || image || isDefaultSign || textWidth ? false : true
+ }
+ type="button"
+ className={
+ isSignImg || image || isDefaultSign || textWidth
+ ? "finishBtn saveBtn"
+ : "disabledFinish saveBtn"
+ }
+ >
+ Save
+ </button>
+ </div>
+ );
+ };
+
+ useEffect(() => {
+ const loadFont = async () => {
+ try {
+ await document.fonts.load(`20px ${fontSelect}`);
+ const selectFontSTyle = fontOptions.find(
+ (font) => font.value === fontSelect
+ );
+ setFontSelect(selectFontSTyle?.value || fontOptions[0].value);
+ } catch (error) {
+ console.error("Error loading font:", error);
+ }
+ };
+
+ loadFont();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [fontSelect]);
+
+ useEffect(() => {
+ // Load the default signature after the component mounts
+ if (canvasRef.current) {
+ canvasRef.current.fromDataURL(isSignImg);
+ }
+ if (isTab === "type") {
+ const trimmedName = signValue ? signValue.trim() : currentUserName.trim();
+ const firstCharacter = trimmedName.charAt(0);
+ const userName = isInitial ? firstCharacter : signValue;
+ setSignValue(userName);
+ convertToImg(fontSelect, userName);
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [isTab]);
+
+ //function for convert input text value in image
+ const convertToImg = async (fontStyle, text) => {
+ //get text content to convert in image
+ const textContent = text;
+ const fontfamily = fontStyle
+ ? fontStyle
+ : fontSelect
+ ? fontSelect
+ : "Fasthand";
+
+ //creating span for getting text content width
+ const span = document.createElement("span");
+ span.textContent = textContent;
+ span.style.font = `20px ${fontfamily}`; // here put your text size and font family
+ span.style.display = "hidden";
+ document.body.appendChild(span); // Replace 'container' with the ID of the container element
+
+ //create canvas to render text in canvas and convert in image
+ const canvasElement = document.createElement("canvas");
+ // Draw the text content on the canvas
+ const ctx = canvasElement.getContext("2d");
+ const pixelRatio = window.devicePixelRatio || 1;
+ const width = span.offsetWidth;
+ const height = span.offsetHeight;
+ setTextWidth(width);
+ setTextHeight(height);
+ const font = span.style["font"];
+ // Set the canvas dimensions to match the span
+ canvasElement.width = width * pixelRatio;
+ canvasElement.height = height * pixelRatio;
+
+ // Render the content of the span onto the canvas
+ // ctx.fillStyle = "white"; // Set the background color of the canvas
+ // ctx.fillRect(0, 0, width*pixelRatio, height*pixelRatio);
+
+ // You can customize text styles if needed
+ ctx.font = font;
+ ctx.fillStyle = "black"; // Set the text color
+ ctx.textAlign = "center";
+ ctx.textBaseline = "middle";
+ ctx.scale(pixelRatio, pixelRatio);
+ // Draw the content of the span onto the canvas
+ ctx.fillText(span.textContent, width / 2, height / 2); // Adjust the x,y-coordinate as needed
+ //remove span tag
+ document.body.removeChild(span);
+ // Convert the canvas to image data
+ const dataUrl = canvasElement.toDataURL("image/png");
+ setSignature(dataUrl);
+ };
+
+ return (
+ <div>
+ {isSignPad && (
+ <div className="modaloverlay">
+ <div className="modalcontainer">
+ <div
+ className="modalheader"
+ style={{ padding: "0 13px", marginTop: "5px" }}
+ >
+ <div className="modaltitle">
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ background: "white",
+ marginTop: "3px"
+ }}
+ >
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-around",
+ alignItems: "end",
+ gap: 10
+ }}
+ >
+ {isStamp ? (
+ <span style={{ color: themeColor }} className="signTab">
+ {widgetType === "image"
+ ? "Upload image"
+ : "Upload stamp image"}
+ </span>
+ ) : (
+ <>
+ <div>
+ <span
+ onClick={() => {
+ setIsDefaultSign(false);
+ setIsImageSelect(false);
+ setIsTab("draw");
+ setImage();
+ }}
+ style={{
+ color: isTab === "draw" ? themeColor : "#515252",
+
+ marginLeft: "2px"
+ }}
+ className="signTab"
+ >
+ Draw
+ </span>
+
+ <div
+ style={{
+ border:
+ isTab === "draw"
+ ? "1.5px solid #108783"
+ : "1.5px solid #ffffff"
+ }}
+ ></div>
+ </div>
+ <div>
+ <span
+ onClick={() => {
+ setIsDefaultSign(false);
+ setIsImageSelect(true);
+ setIsTab("uploadImage");
+ }}
+ style={{
+ color:
+ isTab === "uploadImage" ? themeColor : "#515252"
+ }}
+ className="signTab"
+ >
+ Upload Image
+ </span>
+ <div
+ style={{
+ border:
+ isTab === "uploadImage"
+ ? "1.5px solid #108783"
+ : "1.5px solid #ffffff"
+ }}
+ ></div>
+ </div>
+ <div>
+ <span
+ onClick={() => {
+ setIsDefaultSign(false);
+ setIsImageSelect(false);
+ setIsTab("type");
+ setImage();
+ }}
+ style={{
+ color: isTab === "type" ? themeColor : "#515252",
+
+ marginLeft: "2px"
+ }}
+ className="signTab"
+ >
+ Type
+ </span>
+
+ <div
+ style={{
+ border:
+ isTab === "type"
+ ? "1.5px solid #108783"
+ : "1.5px solid #ffffff"
+ }}
+ ></div>
+ </div>
+ {!isInitial && defaultSign ? (
+ <div>
+ <span
+ onClick={() => {
+ setIsDefaultSign(true);
+ setIsImageSelect(true);
+ setIsTab("mysignature");
+ setImage();
+ }}
+ style={{
+ color:
+ isTab === "mysignature"
+ ? themeColor
+ : "#515252"
+ }}
+ className="signTab"
+ >
+ My Signature
+ </span>
+ <div
+ style={{
+ border:
+ isTab === "mysignature"
+ ? "1.5px solid #108783"
+ : "1.5px solid #ffffff"
+ }}
+ ></div>
+ </div>
+ ) : (
+ isInitial &&
+ myInitial && (
+ <div>
+ <span
+ onClick={() => {
+ setIsDefaultSign(true);
+ setIsImageSelect(true);
+ setIsTab("mysignature");
+ setImage();
+ }}
+ style={{
+ color:
+ isTab === "mysignature"
+ ? themeColor
+ : "#515252"
+ }}
+ className="signTab"
+ >
+ My Initials
+ </span>
+ <div
+ style={{
+ border:
+ isTab === "mysignature"
+ ? "1.5px solid #108783"
+ : "1.5px solid #ffffff"
+ }}
+ ></div>
+ </div>
+ )
+ )}
+ </>
+ )}
+ </div>
+ </div>
+ </div>
+ <div
+ className="closebtn"
+ style={{ color: "black" }}
+ onClick={() => {
+ setPenColor("blue");
+ setIsSignPad(false);
+ setIsInitial(false);
+ setIsImageSelect(false);
+ setIsDefaultSign(false);
+ setImage();
+ setIsTab("draw");
+ setSignValue("");
+ setIsStamp(false);
+ }}
+ >
+ &times;
+ </div>
+ </div>
+ <div style={{ height: "100%", padding: 20 }}>
+ {isDefaultSign ? (
+ <>
+ <div style={{ display: "flex", justifyContent: "center" }}>
+ <div
+ style={{
+ border: "1.3px solid #007bff",
+ borderRadius: "2px",
+ display: "flex",
+ flexDirection: "column",
+ justifyContent: "center",
+ alignItems: "center",
+ marginBottom: 6,
+ cursor: "pointer"
+ }}
+ className={
+ isInitial ? "intialSignatureCanvas" : "signatureCanvas"
+ }
+ >
+ <img
+ alt="stamp img"
+ style={{
+ width: "100%",
+ height: "100%",
+ background: "rgb(255, 255, 255)",
+ objectFit: "contain"
+ }}
+ src={isInitial ? myInitial : defaultSign}
+ />
+ </div>
+ </div>
+ <div style={{ display: "flex", justifyContent: "flex-end" }}>
+ <SaveBtn />
+ </div>
+ </>
+ ) : isImageSelect || isStamp ? (
+ !image ? (
+ <div style={{ display: "flex", justifyContent: "center" }}>
+ <div
+ style={{
+ border: "1.3px solid #007bff",
+ borderRadius: "2px",
+
+ display: "flex",
+ flexDirection: "column",
+ justifyContent: "center",
+ alignItems: "center",
+ marginBottom: 6,
+ cursor: "pointer"
+ }}
+ className={
+ isInitial ? "intialSignatureCanvas" : "signatureCanvas"
+ }
+ onClick={() => imageRef.current.click()}
+ >
+ <input
+ type="file"
+ onChange={onImageChange}
+ className="filetype"
+ accept="image/*"
+ ref={imageRef}
+ hidden
+ />
+ <i className="fas fa-cloud-upload-alt uploadImgLogo"></i>
+ <div className="uploadImg">Upload</div>
+ </div>
+ </div>
+ ) : (
+ <>
+ <div style={{ display: "flex", justifyContent: "center" }}>
+ <div
+ style={{
+ border: "1.3px solid #007bff",
+ borderRadius: "2px",
+ marginBottom: 6,
+ overflow: "hidden"
+ }}
+ className={
+ isInitial
+ ? "intialSignatureCanvas"
+ : "signatureCanvas"
+ }
+ >
+ <img
+ alt="print img"
+ ref={imageRef}
+ src={image.src}
+ style={{
+ objectFit: "contain",
+ height: "100%",
+ width: "100%"
+ }}
+ />
+ </div>
+ </div>
+ <div
+ style={{ display: "flex", justifyContent: "flex-end" }}
+ >
+ <SaveBtn />
+ </div>
+ </>
+ )
+ ) : isTab === "type" ? (
+ <div>
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "space-between",
+ alignItems: "center"
+ }}
+ >
+ <span className="signatureText">
+ {isInitial ? "Initials" : "Signature"}:
+ </span>
+
+ <input
+ maxLength={isInitial ? 3 : 30}
+ style={{ fontFamily: fontSelect }}
+ type="text"
+ className="signatureInput"
+ placeholder="Your signature"
+ value={signValue}
+ onChange={(e) => {
+ setSignValue(e.target.value);
+ convertToImg(fontSelect, e.target.value);
+ }}
+ />
+ </div>
+
+ <div className="fontOptionContainer">
+ {fontOptions.map((font, ind) => {
+ return (
+ <div
+ key={ind}
+ style={{
+ cursor: "pointer",
+ fontFamily: font.value,
+ backgroundColor:
+ fontSelect === font.value && "rgb(206 225 247)"
+ }}
+ onClick={() => {
+ setFontSelect(font.value);
+ convertToImg(font.value, signValue);
+ }}
+ >
+ <div
+ style={{
+ padding: "5px 10px 5px 10px",
+ fontSize: "20px"
+ }}
+ >
+ {signValue ? signValue : "Your signature"}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+
+ <div style={{ display: "flex", justifyContent: "flex-end" }}>
+ <SaveBtn />
+ </div>
+ </div>
+ ) : (
+ <>
+ <div style={{ display: "flex", justifyContent: "center" }}>
+ <SignatureCanvas
+ ref={canvasRef}
+ penColor={penColor}
+ canvasProps={{
+ className: isInitial
+ ? "intialSignatureCanvas"
+ : "signatureCanvas",
+ style: {
+ border: "1.6px solid #007bff",
+ borderRadius: "2px"
+ }
+ }}
+ backgroundColor="rgb(255, 255, 255)"
+ onEnd={() =>
+ handleSignatureChange(canvasRef.current.toDataURL())
+ }
+ dotSize={1}
+ />
+ </div>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ marginTop: "10px"
+ }}
+ >
+ <div style={{ display: "flex", flexDirection: "row" }}>
+ {allColor.map((data, key) => {
+ return (
+ <img
+ key={key}
+ alt="pen img"
+ style={{
+ border: "none",
+ margin: "5px",
+ borderBottom:
+ key === 0 && penColor === "blue"
+ ? "2px solid blue"
+ : key === 1 && penColor === "red"
+ ? "2px solid red"
+ : key === 2 && penColor === "black"
+ ? "2px solid black"
+ : "2px solid white"
+ }}
+ onClick={() => {
+ if (key === 0) {
+ setPenColor("blue");
+ } else if (key === 1) {
+ setPenColor("red");
+ } else if (key === 2) {
+ setPenColor("black");
+ }
+ }}
+ src={data}
+ width={20}
+ height={20}
+ />
+ );
+ })}
+ </div>
+
+ <SaveBtn />
+ </div>
+ </>
+ )}
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ );
+}
+
+export default SignPad;
diff --git a/apps/OpenSign/src/components/pdf/Signedby.js b/apps/OpenSign/src/components/pdf/Signedby.js
new file mode 100644
index 000000000..5f8b907a0
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/Signedby.js
@@ -0,0 +1,66 @@
+import React from "react";
+import { themeColor } from "../../constant/const";
+import "../../styles/signature.css";
+function Signedby({ pdfDetails }) {
+ const getFirstLetter = (name) => {
+ const firstLetter = name.charAt(0);
+ return firstLetter;
+ };
+
+ return (
+ <div className="signerComponent">
+ <div
+ style={{
+ background: themeColor,
+ color: "white"
+ }}
+ className="signedStyle"
+ >
+ Signed By
+ </div>
+ <div style={{ marginTop: "2px", background: "white" }}>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ padding: "10px",
+
+ background: "#93a3db"
+ }}
+ >
+ <div
+ className="signerStyle"
+ style={{
+ background: "#abd1d0",
+ width: 20,
+ height: 20,
+ display: "flex",
+ borderRadius: 30 / 2,
+ justifyContent: "center",
+ alignItems: "center",
+ marginRight: "20px",
+ marginTop: "5px"
+ }}
+ >
+ <span
+ style={{
+ fontSize: "8px",
+ textAlign: "center",
+ fontWeight: "bold"
+ }}
+ >
+ {" "}
+ {getFirstLetter(pdfDetails.ExtUserPtr.Name)}
+ </span>
+ </div>
+ <div style={{ display: "flex", flexDirection: "column" }}>
+ <span className="userName">{pdfDetails.ExtUserPtr.Name}</span>
+ <span className="useEmail">{pdfDetails.ExtUserPtr.Email}</span>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+export default Signedby;
diff --git a/apps/OpenSign/src/components/pdf/SignerListPlace.js b/apps/OpenSign/src/components/pdf/SignerListPlace.js
new file mode 100644
index 000000000..e123c257a
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/SignerListPlace.js
@@ -0,0 +1,36 @@
+import React from "react";
+import { themeColor } from "../../constant/const";
+import "../../styles/signerListPlace.css";
+import RecipientList from "./RecipientList";
+
+function SignerListPlace(props) {
+ return (
+ <div>
+ <div
+ style={{
+ background: themeColor,
+ padding: "5px"
+ }}
+ >
+ <span className="signedStyle">
+ {props.title ? props.title : "Recipients"}
+ </span>
+ </div>
+ <div className="signerList">
+ <RecipientList {...props} />
+ </div>
+ {props.handleAddSigner && (
+ <div
+ data-tut="reactourAddbtn"
+ className="addSignerBtn"
+ onClick={() => props.handleAddSigner()}
+ >
+ <i className="fa-solid fa-plus"></i>
+ <span style={{ marginLeft: 2 }}>Add role</span>
+ </div>
+ )}
+ </div>
+ );
+}
+
+export default SignerListPlace;
diff --git a/apps/OpenSign/src/components/pdf/WidgetComponent.js b/apps/OpenSign/src/components/pdf/WidgetComponent.js
new file mode 100644
index 000000000..656f60616
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/WidgetComponent.js
@@ -0,0 +1,420 @@
+import React, { useState, useRef, useEffect } from "react";
+import ModalUi from "../../primitives/ModalUi";
+import RecipientList from "./RecipientList";
+import { useDrag } from "react-dnd";
+import WidgetList from "./WidgetList";
+import { widgets } from "../../constant/Utils";
+
+function WidgetComponent({
+ dragSignature,
+ signRef,
+ handleDivClick,
+ handleMouseLeave,
+ themeColor,
+ dragStamp,
+ isSignYourself,
+ addPositionOfSignature,
+ signersdata,
+ isSelectListId,
+ setSignerObjId,
+ setIsSelectId,
+ setContractName,
+ isSigners,
+ dataTut,
+ isMailSend,
+ handleAddSigner,
+ setUniqueId,
+ setRoleName,
+ handleDeleteUser,
+ signerPos,
+ handleRoleChange,
+ handleOnBlur,
+ title,
+
+ isTemplateFlow
+}) {
+ const [isSignersModal, setIsSignersModal] = useState(false);
+
+ const [, dropdown] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 5,
+ text: "dropdown"
+ },
+
+ collect: (monitor) => ({
+ isDragDropdown: !!monitor.isDragging()
+ })
+ });
+ const [, checkbox] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 6,
+ text: "checkbox"
+ },
+
+ collect: (monitor) => ({
+ isDragCheck: !!monitor.isDragging()
+ })
+ });
+ const [, text] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 7,
+ text: "text"
+ },
+
+ collect: (monitor) => ({
+ isDragText: !!monitor.isDragging()
+ })
+ });
+ const [, initials] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 8,
+ text: "initials"
+ },
+
+ collect: (monitor) => ({
+ isDragInitial: !!monitor.isDragging()
+ })
+ });
+ const [, name] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 9,
+ text: "name"
+ },
+
+ collect: (monitor) => ({
+ isDragName: !!monitor.isDragging()
+ })
+ });
+ const [, company] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 10,
+ text: "company"
+ },
+
+ collect: (monitor) => ({
+ isDragCompany: !!monitor.isDragging()
+ })
+ });
+ const [, jobTitle] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 11,
+ text: "job title"
+ },
+
+ collect: (monitor) => ({
+ isDragJobtitle: !!monitor.isDragging()
+ })
+ });
+ const [, date] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 12,
+ text: "date"
+ },
+
+ collect: (monitor) => ({
+ isDragDate: !!monitor.isDragging()
+ })
+ });
+ const [, image] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 13,
+ text: "image"
+ },
+
+ collect: (monitor) => ({
+ isDragImage: !!monitor.isDragging()
+ })
+ });
+ const [, email] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 14,
+ text: "email"
+ },
+ collect: (monitor) => ({
+ isDragEmail: !!monitor.isDragging()
+ })
+ });
+ const [, radio] = useDrag({
+ type: "BOX",
+
+ item: {
+ type: "BOX",
+ id: 15,
+ text: "radio"
+ },
+ collect: (monitor) => ({
+ isDragRadio: !!monitor.isDragging()
+ })
+ });
+ const [, label] = useDrag({
+ type: "BOX",
+
+ item: {
+ type: "BOX",
+ id: 16,
+ text: "label"
+ },
+ collect: (monitor) => ({
+ isDragLabel: !!monitor.isDragging()
+ })
+ });
+ const isMobile = window.innerWidth < 767;
+ const scrollContainerRef = useRef(null);
+ const [widget, setWidget] = useState([]);
+
+ const color = [
+ "#93a3db",
+ "#e6c3db",
+ "#c0e3bc",
+ "#bce3db",
+ "#b8ccdb",
+ "#ceb8db",
+ "#ffccff",
+ "#99ffcc",
+ "#cc99ff",
+ "#ffcc99",
+ "#66ccff",
+ "#ffffcc"
+ ];
+ const handleModal = () => {
+ setIsSignersModal(!isSignersModal);
+ };
+
+ useEffect(() => {
+ const widgetRef = [
+ dragSignature,
+ dragStamp,
+ initials,
+ label,
+ text,
+ checkbox,
+ dropdown,
+ radio,
+ image,
+ date,
+ name,
+ email,
+ company,
+ jobTitle
+ ];
+ const getWidgetArray = widgets;
+ const newUpdateSigner = getWidgetArray.map((obj, ind) => {
+ return { ...obj, ref: widgetRef[ind] };
+ });
+
+ setWidget(newUpdateSigner);
+ // eslint-disable-next-line
+ }, []);
+
+ const filterWidgets = widget.filter(
+ (data) =>
+ data.type !== "dropdown" && data.type !== "radio" && data.type !== "label"
+ );
+ const labelWidget = widget.filter((data) => data.type !== "label");
+ const updateWidgets = isSignYourself
+ ? filterWidgets
+ : isTemplateFlow
+ ? labelWidget
+ : widget;
+
+ return (
+ <>
+ {isMobile ? (
+ !isMailSend && (
+ <div
+ data-tut={dataTut}
+ id="navbar"
+ className="stickyfooter"
+ style={{ width: window.innerWidth + "px" }}
+ >
+ {isSigners && (
+ <div
+ data-tut={dataTut}
+ style={{
+ background: isSelectListId
+ ? color[isSelectListId % color.length]
+ : color[0],
+ padding: "10px 20px",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center"
+ }}
+ onClick={() => {
+ // if (signersdata?.length) {
+ handleModal();
+ // }
+ }}
+ >
+ <span
+ style={{
+ fontSize: "13px",
+ fontWeight: "700",
+ textAlign: "center"
+ }}
+ >
+ {title ? title : "Recipient"}
+ </span>
+ <span
+ style={{
+ fontSize: "13px",
+ fontWeight: "700",
+ display: "flex",
+ alignItems: "center"
+ }}
+ >
+ {signersdata[isSelectListId]?.Role && (
+ <div>
+ {signersdata[isSelectListId]?.Name ? (
+ <>
+ :{" "}
+ {signersdata[isSelectListId]?.Name?.length > 12
+ ? `${signersdata[isSelectListId].Name.slice(
+ 0,
+ 12
+ )}...`
+ : signersdata[isSelectListId]?.Name}
+ </>
+ ) : (
+ <>
+ :{" "}
+ {signersdata[isSelectListId]?.Role?.length > 12
+ ? `${signersdata[isSelectListId].Role.slice(
+ 0,
+ 12
+ )}...`
+ : signersdata[isSelectListId]?.Role}
+ </>
+ )}
+ </div>
+ )}
+ <div style={{ marginLeft: 6, fontSize: 16 }}>
+ <i className="fa-solid fa-angle-down"></i>
+ </div>
+ </span>
+ </div>
+ )}
+ {handleAddSigner && (
+ <div
+ data-tut="reactourAddbtn"
+ style={{
+ margin: "5px 0 5px 0",
+ backgroundColor: themeColor,
+ color: "white"
+ }}
+ className="addSignerBtn"
+ onClick={() => handleAddSigner()}
+ >
+ <i className="fa-solid fa-plus"></i>
+ <span style={{ marginLeft: 2 }}>Add role</span>
+ </div>
+ )}
+
+ <div
+ ref={scrollContainerRef}
+ style={{
+ background: "white",
+ borderTop: `2px solid ${themeColor}`
+ }}
+ >
+ <div
+ style={{
+ display: "flex",
+ overflowX: "scroll",
+ whiteSpace: "nowrap",
+ padding: "10px"
+ }}
+ >
+ <WidgetList
+ updateWidgets={updateWidgets}
+ handleDivClick={handleDivClick}
+ handleMouseLeave={handleMouseLeave}
+ signRef={signRef}
+ marginLeft={5}
+ addPositionOfSignature={addPositionOfSignature}
+ isMobile={isMobile}
+ />
+ </div>
+ </div>
+ </div>
+ )
+ ) : (
+ <div data-tut={dataTut} className="signerComponent">
+ <div
+ style={{
+ background: themeColor,
+ padding: "5px"
+ }}
+ >
+ <span className="signedStyle">Fields</span>
+ </div>
+
+ <div className="signLayoutContainer1">
+ <WidgetList
+ updateWidgets={updateWidgets}
+ handleDivClick={handleDivClick}
+ handleMouseLeave={handleMouseLeave}
+ signRef={signRef}
+ />
+ </div>
+ </div>
+ )}
+ {isSignersModal && (
+ <ModalUi
+ title={"Roles"}
+ isOpen={isSignersModal}
+ handleClose={handleModal}
+ >
+ {signersdata.length > 0 ? (
+ <RecipientList
+ signerPos={signerPos}
+ signersdata={signersdata}
+ isSelectListId={isSelectListId}
+ setSignerObjId={setSignerObjId}
+ setIsSelectId={setIsSelectId}
+ setContractName={setContractName}
+ setUniqueId={setUniqueId}
+ setRoleName={setRoleName}
+ handleDeleteUser={handleDeleteUser}
+ handleRoleChange={handleRoleChange}
+ handleOnBlur={handleOnBlur}
+ handleModal={handleModal}
+ />
+ ) : (
+ <div
+ style={{
+ padding: 20,
+ fontSize: 15,
+ fontWeight: "500",
+ textAlign: "center"
+ }}
+ >
+ Please add a role
+ </div>
+ )}
+ </ModalUi>
+ )}
+ </>
+ );
+}
+
+export default WidgetComponent;
diff --git a/apps/OpenSign/src/components/pdf/WidgetList.js b/apps/OpenSign/src/components/pdf/WidgetList.js
new file mode 100644
index 000000000..aa0c9aba5
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/WidgetList.js
@@ -0,0 +1,36 @@
+import React from "react";
+import { getWidgetType } from "../../constant/Utils";
+
+function WidgetList(props) {
+ return props.updateWidgets.map((item, ind) => {
+ return (
+ <div key={ind} style={{ marginBottom: "10px" }}>
+ <div
+ className="widgets"
+ onClick={() => {
+ props.addPositionOfSignature &&
+ props.addPositionOfSignature("onclick", item);
+ }}
+ ref={(element) => {
+ if (!props.isMobile) {
+ item.ref(element);
+ if (element) {
+ if (props?.signRef) {
+ props.signRef.current = element;
+ }
+ }
+ }
+ }}
+ onMouseMove={props?.handleDivClick}
+ onMouseDown={() => {
+ props?.handleMouseLeave();
+ }}
+ >
+ {item.ref && getWidgetType(item, props?.marginLeft)}
+ </div>
+ </div>
+ );
+ });
+}
+
+export default WidgetList;
diff --git a/apps/OpenSign/src/components/pdf/WidgetNameModal.js b/apps/OpenSign/src/components/pdf/WidgetNameModal.js
new file mode 100644
index 000000000..340ec18ca
--- /dev/null
+++ b/apps/OpenSign/src/components/pdf/WidgetNameModal.js
@@ -0,0 +1,284 @@
+import React, { useEffect, useState } from "react";
+import ModalUi from "../../primitives/ModalUi";
+import "../../styles/AddUser.css";
+import RegexParser from "regex-parser";
+
+const WidgetNameModal = (props) => {
+ const [formdata, setFormdata] = useState({
+ name: "",
+ defaultValue: "",
+ status: "required",
+ hint: "",
+ textvalidate: "text"
+ });
+ const [isValid, setIsValid] = useState(true);
+ const statusArr = ["Required", "Optional"];
+ const inputOpt = ["email", "number", "text"];
+
+ useEffect(() => {
+ if (props.defaultdata) {
+ setFormdata({
+ name: props.defaultdata?.options?.name || props?.widgetName || "",
+ defaultValue: props.defaultdata?.options?.defaultValue || "",
+ status: props.defaultdata?.options?.status || "required",
+ hint: props.defaultdata?.options?.hint || "",
+ textvalidate:
+ props.defaultdata?.options?.validation?.type === "regex"
+ ? props.defaultdata?.options?.validation?.pattern
+ : props.defaultdata?.options?.validation?.type || ""
+ });
+ } else {
+ setFormdata({
+ ...formdata,
+ name: props.defaultdata?.options?.name || props?.widgetName || ""
+ });
+ }
+ // eslint-disable-next-line
+ }, [props.defaultdata, props.widgetName]);
+ const handleSubmit = (e) => {
+ e.preventDefault();
+ if (props.handleData) {
+ props.handleData(formdata);
+ setFormdata({
+ name: "",
+ defaultValue: "",
+ status: "required",
+ hint: "",
+ textvalidate: "text"
+ });
+ }
+ };
+ const handleChange = (e) => {
+ setFormdata({ ...formdata, [e.target.name]: e.target.value });
+ };
+
+ const handledefaultChange = (e) => {
+ if (formdata.textvalidate) {
+ const regexObject = RegexParser(handleValidation(formdata.textvalidate));
+ const isValidate = regexObject?.test(e.target.value);
+ setIsValid(isValidate);
+ } else {
+ setIsValid(true);
+ }
+ setFormdata({ ...formdata, [e.target.name]: e.target.value });
+ };
+
+ function handleValidation(type) {
+ switch (type) {
+ case "email":
+ return "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/";
+ case "number":
+ return "/^\\d+$/";
+ case "text":
+ return "/^[a-zA-Zs]+$/";
+ default:
+ return type;
+ }
+ }
+
+ function handleBlurRegex() {
+ if (!formdata.textvalidate) {
+ setFormdata({ ...formdata, textvalidate: "text" });
+ } else {
+ if (formdata.defaultValue) {
+ const regexObject = RegexParser(
+ handleValidation(formdata.textvalidate)
+ );
+ const isValidate = regexObject?.test(formdata.defaultValue);
+ if (isValidate === false) {
+ setFormdata({ ...formdata, defaultValue: "" });
+ }
+ }
+ }
+ }
+ return (
+ <ModalUi
+ isOpen={props.isOpen}
+ handleClose={props.handleClose && props.handleClose}
+ title={"Widget info"}
+ >
+ <form onSubmit={handleSubmit} style={{ padding: 20 }}>
+ <div className="form-section">
+ <label htmlFor="name" style={{ fontSize: 13 }}>
+ Name
+ <span style={{ color: "red", fontSize: 13 }}> *</span>
+ </label>
+ <input
+ className="addUserInput"
+ name="name"
+ value={formdata.name}
+ onChange={(e) => handleChange(e)}
+ required
+ />
+ </div>
+ {(props.defaultdata?.type === "text" ||
+ props.widgetName === "text") && (
+ <>
+ <div className="form-section">
+ <label htmlFor="textvalidate" style={{ fontSize: 13 }}>
+ Validation
+ </label>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ gap: 10,
+ marginBottom: "0.5rem"
+ }}
+ >
+ <div style={{ width: "100%", position: "relative" }}>
+ <input
+ style={{
+ padding: "0.5rem 0.75rem",
+ width: "92%",
+ borderWidth: "1px",
+ borderColor: "#d1d5db",
+ borderTopLeftRadius: "0.375rem",
+ borderBottomLeftRadius: "0.375rem",
+ outline: "none",
+ fontSize: "0.75rem",
+ position: "relative",
+ zIndex: 2
+ }}
+ name="textvalidate"
+ placeholder="Enter custom expression"
+ value={formdata.textvalidate}
+ onChange={(e) => handleChange(e)}
+ onBlur={() => handleBlurRegex()}
+ />
+ <select
+ style={{ position: "absolute", left: 0, zIndex: 1 }}
+ className="addUserInput"
+ name="textvalidate"
+ value={formdata.textvalidate}
+ onChange={(e) => handleChange(e)}
+ onBlur={() => handleBlurRegex()}
+ >
+ <option disabled style={{ fontSize: "13px" }}>
+ Select...
+ </option>
+ {inputOpt.map((data, ind) => {
+ return (
+ <option
+ style={{ fontSize: "13px" }}
+ key={ind}
+ value={data}
+ >
+ {data}
+ </option>
+ );
+ })}
+ </select>
+ </div>
+ </div>
+ </div>
+ <div className="form-section">
+ <label htmlFor="name" style={{ fontSize: 13 }}>
+ Default value
+ </label>
+ <input
+ className="addUserInput"
+ name="defaultValue"
+ value={formdata.defaultValue}
+ onChange={(e) => handledefaultChange(e)}
+ onBlur={() =>
+ isValid === false &&
+ setFormdata({ ...formdata, defaultValue: "" })
+ }
+ />
+ {isValid === false ? (
+ <p style={{ color: "Red", fontSize: 8 }}>
+ invalid default value
+ </p>
+ ) : (
+ <p
+ style={{
+ color: "transparent",
+ fontSize: 10,
+ margin: "3px 8px"
+ }}
+ >
+ .
+ </p>
+ )}
+ </div>
+ </>
+ )}
+ <div className="form-section">
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ gap: 10,
+ marginBottom: "0.5rem"
+ }}
+ >
+ {statusArr.map((data, ind) => {
+ return (
+ <div
+ key={ind}
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ gap: 5,
+ alignItems: "center"
+ }}
+ >
+ <input
+ style={{ accentColor: "red", marginRight: "10px" }}
+ type="radio"
+ name="status"
+ onChange={() =>
+ setFormdata({ ...formdata, status: data.toLowerCase() })
+ }
+ checked={
+ formdata.status.toLowerCase() === data.toLowerCase()
+ }
+ />
+ <div style={{ fontSize: "13px", fontWeight: "500" }}>
+ {data}
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ {(props.defaultdata?.type === "text" ||
+ props?.widgetName === "text") && (
+ <div className="form-section">
+ <label htmlFor="hint" style={{ fontSize: 13 }}>
+ Hint
+ </label>
+ <input
+ className="addUserInput"
+ name="hint"
+ value={formdata.hint}
+ onChange={(e) => handleChange(e)}
+ />
+ </div>
+ )}
+ <div
+ style={{
+ height: 1,
+ backgroundColor: "#b7b3b3",
+ width: "100%",
+ marginBottom: "16px"
+ }}
+ ></div>
+ <button
+ style={{
+ color: "white",
+ padding: "5px 20px",
+ backgroundColor: "#32a3ac"
+ }}
+ type="submit"
+ className="finishBtn"
+ >
+ Save
+ </button>
+ </form>
+ </ModalUi>
+ );
+};
+
+export default WidgetNameModal;
diff --git a/apps/OpenSign/src/components/sidebar/Menu.js b/apps/OpenSign/src/components/sidebar/Menu.js
index 459451b23..c767ff673 100644
--- a/apps/OpenSign/src/components/sidebar/Menu.js
+++ b/apps/OpenSign/src/components/sidebar/Menu.js
@@ -2,20 +2,24 @@ import React from "react";
import { NavLink } from "react-router-dom";
const Menu = ({ item, isOpen, closeSidebar }) => {
- return (
- <li key={item.title} role="none">
- <NavLink
- to={`/${item.pageType}/${item.objectId}`}
- className="mx-auto flex items-center hover:bg-[#eef1f5] p-3 lg:p-4"
- onClick={closeSidebar}
- tabIndex={isOpen ? 0 : -1}
- role="menuitem"
- >
- <i className={`${item.icon} text-[18px]`} aria-hidden="true"></i>
- <span className="ml-3 lg:ml-4">{item.title}</span>
- </NavLink>
- </li>
- )
-}
+ return (
+ <li key={item.title} role="none">
+ <NavLink
+ to={
+ item.pageType
+ ? `/${item.pageType}/${item.objectId}`
+ : `/${item.objectId}`
+ }
+ className="mx-auto flex items-center hover:bg-[#eef1f5] p-3 lg:p-4"
+ onClick={closeSidebar}
+ tabIndex={isOpen ? 0 : -1}
+ role="menuitem"
+ >
+ <i className={`${item.icon} text-[18px]`} aria-hidden="true"></i>
+ <span className="ml-3 lg:ml-4">{item.title}</span>
+ </NavLink>
+ </li>
+ );
+};
-export default Menu;
\ No newline at end of file
+export default Menu;
diff --git a/apps/OpenSign/src/components/sidebar/SubMenu.js b/apps/OpenSign/src/components/sidebar/SubMenu.js
index 3b3adac42..d4af05c68 100644
--- a/apps/OpenSign/src/components/sidebar/SubMenu.js
+++ b/apps/OpenSign/src/components/sidebar/SubMenu.js
@@ -22,8 +22,9 @@ const Submenu = ({ item, closeSidebar }) => {
<div className="flex justify-between items-center w-full">
<span className="ml-3 lg:ml-4">{title}</span>
<i
- className={`${submenuOpen ? "fa-solid fa-angle-down" : "fa-solid fa-angle-right"
- }`}
+ className={`${
+ submenuOpen ? "fa-solid fa-angle-down" : "fa-solid fa-angle-right"
+ }`}
aria-hidden="true"
></i>
</div>
@@ -33,13 +34,20 @@ const Submenu = ({ item, closeSidebar }) => {
{children.map((childItem) => (
<li key={childItem.title} role="none">
<NavLink
- to={`/${childItem.pageType}/${childItem.objectId}`}
+ to={
+ childItem.pageType
+ ? `/${childItem.pageType}/${childItem.objectId}`
+ : `/${childItem.objectId}`
+ }
className="block pl-6 md:pl-8 py-2 text-sm text-gray-700 hover:bg-blue-500 hover:text-white"
onClick={closeSidebar}
role="menuitem"
tabIndex={submenuOpen ? 0 : -1}
>
- <i className={`${childItem.icon} text-[18px]`} aria-hidden="true"></i>
+ <i
+ className={`${childItem.icon} text-[18px]`}
+ aria-hidden="true"
+ ></i>
<span className="ml-3 lg:ml-4">{childItem.title}</span>
</NavLink>
</li>
diff --git a/apps/OpenSign/src/constant/Utils.js b/apps/OpenSign/src/constant/Utils.js
index aa44a9b13..f027108dc 100644
--- a/apps/OpenSign/src/constant/Utils.js
+++ b/apps/OpenSign/src/constant/Utils.js
@@ -1,3 +1,1449 @@
+import axios from "axios";
+import moment from "moment";
+import { themeColor } from "./const";
+import React from "react";
+import { rgb } from "pdf-lib";
+
+export const isMobile = window.innerWidth < 767;
export const openInNewTab = (url) => {
window.open(url, "_blank", "noopener,noreferrer");
};
+
+export const toDataUrl = (file) => {
+ return new Promise((resolve) => {
+ const reader = new FileReader();
+ reader.readAsDataURL(file);
+ reader.onloadend = (e) => {
+ resolve(e.target.result);
+ };
+ });
+};
+
+//function for getting document details for getDrive
+export const getDrive = async (documentId) => {
+ const data = {
+ docId: documentId && documentId
+ };
+ const driveDeatils = await axios
+ .post(`${localStorage.getItem("baseUrl")}functions/getDrive`, data, {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessiontoken: localStorage.getItem("accesstoken")
+ }
+ })
+ .then((Listdata) => {
+ const json = Listdata.data;
+
+ if (json && json.result.error) {
+ return json;
+ } else if (json && json.result) {
+ const data = json.result;
+ return data;
+ } else {
+ return [];
+ }
+ })
+ .catch((err) => {
+ console.log("Err ", err);
+ return "Error: Something went wrong!";
+ });
+
+ return driveDeatils;
+};
+
+// `pdfNewWidthFun` function is used to calculate pdf width to render in middle container
+export const pdfNewWidthFun = (divRef) => {
+ const clientWidth = divRef.current.offsetWidth;
+ const pdfWidth = clientWidth - 160 - 200;
+ //160 is width of left side, 200 is width of right side component
+ return pdfWidth;
+};
+
+//`contractUsers` function is used to get contract_User details
+export const contractUsers = async (email) => {
+ const data = {
+ email: email
+ };
+ const userDetails = await axios
+ .post(`${localStorage.getItem("baseUrl")}functions/getUserDetails`, data, {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessionToken: localStorage.getItem("accesstoken")
+ }
+ })
+ .then((Listdata) => {
+ const json = Listdata.data;
+ let data = [];
+
+ if (json && json.result) {
+ data.push(json.result);
+ return data;
+ }
+ })
+ .catch((err) => {
+ console.log("Err ", err);
+ return "Error: Something went wrong!";
+ });
+
+ return userDetails;
+};
+
+//function for resize image and update width and height for mulitisigners
+export const handleImageResize = (
+ ref,
+ key,
+ signerPos,
+ setSignerPos,
+ pageNumber,
+ signerId,
+ showResize
+) => {
+ // const filterSignerPos = signerPos.filter(
+ // (data) => data.signerObjId === signerId
+ // );
+
+ const filterSignerPos = signerPos.filter((data) => data.Id === signerId);
+
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos;
+ const getPosData = getXYdata;
+ const addSignPos = getPosData.map((url) => {
+ if (url.key === key) {
+ return {
+ ...url,
+ Width: ref.offsetWidth,
+ Height: ref.offsetHeight,
+ IsResize: showResize ? true : false
+ };
+ }
+ return url;
+ });
+
+ const newUpdateSignPos = getPlaceHolder.map((obj) => {
+ if (obj.pageNumber === pageNumber) {
+ return { ...obj, pos: addSignPos };
+ }
+ return obj;
+ });
+
+ const newUpdateSigner = signerPos.map((obj) => {
+ if (obj.Id === signerId) {
+ return { ...obj, placeHolder: newUpdateSignPos };
+ }
+ return obj;
+ });
+
+ setSignerPos(newUpdateSigner);
+ }
+ }
+};
+
+export const widgets = [
+ {
+ type: "signature",
+ icon: "fa-solid fa-pen-nib",
+ iconSize: "20px"
+ },
+ {
+ type: "stamp",
+ icon: "fa-solid fa-stamp",
+ iconSize: "19px"
+ },
+ {
+ type: "initials",
+ icon: "fa-solid fa-signature",
+ iconSize: "15px"
+ },
+ {
+ type: "label",
+ icon: "fa-solid fa-text-width",
+ iconSize: "20px"
+ },
+ {
+ type: "text",
+ icon: "fa-solid fa-font",
+ iconSize: "21px"
+ },
+ {
+ type: "checkbox",
+ icon: "fa-solid fa-square-check",
+ iconSize: "22px"
+ },
+ {
+ type: "dropdown",
+ icon: "fa-solid fa-circle-chevron-down",
+ iconSize: "19px"
+ },
+ {
+ type: "radio",
+ icon: "fa-regular fa-circle-dot",
+ iconSize: "20px"
+ },
+ {
+ type: "image",
+ icon: "fa-solid fa-image",
+ iconSize: "20px"
+ },
+ {
+ type: "date",
+ icon: "fa-solid fa-calendar-days",
+ iconSize: "20px"
+ },
+ {
+ type: "name",
+ icon: "fa-solid fa-user",
+ iconSize: "21px"
+ },
+ {
+ type: "email",
+ icon: "fa-solid fa-envelope",
+ iconSize: "20px"
+ },
+ {
+ type: "company",
+ icon: "fa-solid fa-building",
+ iconSize: "25px"
+ },
+ {
+ type: "job title",
+ icon: "fa-solid fa-address-card",
+ iconSize: "17px"
+ }
+];
+
+const getDate = () => {
+ const date = new Date();
+ const milliseconds = date.getTime();
+ const newDate = moment(milliseconds).format("MM/DD/YYYY");
+ return newDate;
+};
+
+export const addWidgetOptions = (type) => {
+ const defaultOpt = {
+ name: "",
+ status: "required"
+ };
+ switch (type) {
+ case "signature":
+ return defaultOpt;
+ case "stamp":
+ return defaultOpt;
+ case "checkbox":
+ return defaultOpt;
+ case "text":
+ return { ...defaultOpt, validation: { type: "text", pattern: "" } };
+ case "initials":
+ return defaultOpt;
+ case "name":
+ return { ...defaultOpt, validation: { type: "text", pattern: "" } };
+ case "company":
+ return { ...defaultOpt, validation: { type: "text", pattern: "" } };
+ case "job title":
+ return { ...defaultOpt, validation: { type: "text", pattern: "" } };
+ case "date":
+ return { ...defaultOpt, response: getDate() };
+ case "image":
+ return defaultOpt;
+ case "email":
+ return { ...defaultOpt, validation: { type: "email", pattern: "" } };
+ case "dropdown":
+ return defaultOpt;
+ case "radio":
+ return { ...defaultOpt, values: [] };
+ case "label":
+ return defaultOpt;
+ default:
+ return {};
+ }
+};
+export const getWidgetType = (item, marginLeft) => {
+ return (
+ <>
+ <div
+ className="signatureBtn widgets"
+ style={{
+ boxShadow:
+ "0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18)",
+ marginLeft: marginLeft && `${marginLeft}px`
+ }}
+ >
+ <div
+ style={{
+ display: "flex",
+ alignItems: "center",
+ marginLeft: "5px"
+ }}
+ >
+ <i
+ className="fa-sharp fa-solid fa-grip-vertical"
+ style={{ color: "#908d8d", fontSize: "13px" }}
+ ></i>
+ <span
+ style={{
+ fontWeight: "400",
+ fontSize: "15px",
+ // padding: "3px 20px 0px 20px",
+ color: "black",
+ marginLeft: "5px"
+ }}
+ >
+ {item.type}
+ </span>
+ </div>
+ <div
+ style={{
+ backgroundColor: themeColor,
+ padding: "0 5px",
+ display: "flex",
+ alignItems: "center"
+ }}
+ >
+ <i
+ style={{ color: "white", fontSize: item.iconSize }}
+ className={item.icon}
+ ></i>
+ </div>
+ </div>
+ </>
+ );
+};
+
+export const defaultWidthHeight = (type) => {
+ switch (type) {
+ case "signature":
+ return { width: 150, height: 60 };
+ case "stamp":
+ return { width: 150, height: 60 };
+ case "checkbox":
+ return { width: 15, height: 15 };
+ case "text":
+ return { width: 150, height: 25 };
+ case "dropdown":
+ return { width: 120, height: 22 };
+ case "initials":
+ return { width: 50, height: 50 };
+ case "name":
+ return { width: 150, height: 25 };
+ case "company":
+ return { width: 150, height: 25 };
+ case "job title":
+ return { width: 150, height: 25 };
+ case "date":
+ return { width: 100, height: 20 };
+ case "image":
+ return { width: 70, height: 70 };
+ case "email":
+ return { width: 150, height: 20 };
+ case "radio":
+ return { width: 15, height: 30 };
+ case "label":
+ return { width: 150, height: 17 };
+ default:
+ return { width: 150, height: 60 };
+ }
+};
+
+export const resizeBorderExtraWidth = () => {
+ return 20;
+};
+
+export async function getBase64FromUrl(url) {
+ const data = await fetch(url);
+ const blob = await data.blob();
+ return new Promise((resolve) => {
+ const reader = new FileReader();
+ reader.readAsDataURL(blob);
+ reader.onloadend = function () {
+ const pdfBase = this.result;
+ const removeBase64Prefix = "data:application/octet-stream;base64,";
+ const suffixbase64 = pdfBase.replace(removeBase64Prefix, "");
+ resolve(suffixbase64);
+ };
+ });
+}
+
+export async function getBase64FromIMG(url) {
+ const data = await fetch(url);
+ const blob = await data.blob();
+ return new Promise((resolve) => {
+ const reader = new FileReader();
+ reader.readAsDataURL(blob);
+ reader.onloadend = function () {
+ const pdfBase = this.result;
+
+ resolve(pdfBase);
+ };
+ });
+}
+//function for convert signature png base64 url to jpeg base64
+export const convertPNGtoJPEG = (base64Data) => {
+ return new Promise((resolve, reject) => {
+ const canvas = document.createElement("canvas");
+ const img = new Image();
+ img.src = base64Data;
+
+ img.onload = () => {
+ canvas.width = img.width;
+ canvas.height = img.height;
+
+ const ctx = canvas.getContext("2d");
+ ctx.fillStyle = "#ffffff"; // white color
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
+ ctx.drawImage(img, 0, 0);
+ // Convert to JPEG by using the canvas.toDataURL() method
+ const jpegBase64Data = canvas.toDataURL("image/jpeg");
+
+ resolve(jpegBase64Data);
+ };
+
+ img.onerror = (error) => {
+ reject(error);
+ };
+ });
+};
+
+//function for resize image and update width and height for sign-yourself
+export const handleSignYourselfImageResize = (
+ ref,
+ key,
+ xyPostion,
+ setXyPostion,
+ index
+) => {
+ const getXYdata = xyPostion[index].pos;
+ const getPosData = getXYdata;
+ const addSign = getPosData.map((url) => {
+ if (url.key === key) {
+ return {
+ ...url,
+ Width: ref.offsetWidth,
+ Height: ref.offsetHeight,
+ IsResize: true
+ };
+ }
+ return url;
+ });
+
+ const newUpdateUrl = xyPostion.map((obj, ind) => {
+ if (ind === index) {
+ return { ...obj, pos: addSign };
+ }
+ return obj;
+ });
+ setXyPostion(newUpdateUrl);
+};
+
+//function for call cloud function signPdf and generate digital signature
+export const signPdfFun = async (
+ base64Url,
+ documentId,
+ signerObjectId,
+ setIsAlert
+) => {
+ let singleSign;
+
+ singleSign = {
+ pdfFile: base64Url,
+ docId: documentId,
+ userId: signerObjectId
+ // };
+ };
+
+ const response = await axios
+ .post(`${localStorage.getItem("baseUrl")}functions/signPdf`, singleSign, {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessionToken: localStorage.getItem("accesstoken")
+ }
+ })
+ .then((Listdata) => {
+ const json = Listdata.data;
+ const res = json.result;
+ return res;
+ })
+ .catch((err) => {
+ console.log("Err ", err);
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong"
+ });
+ });
+
+ return response;
+};
+
+export const randomId = () => Math.floor(1000 + Math.random() * 9000);
+
+export const createDocument = async (template, placeholders, signerData) => {
+ if (template && template.length > 0) {
+ const Doc = template[0];
+
+ let placeholdersArr = [];
+ if (placeholders?.length > 0) {
+ placeholdersArr = placeholders;
+ }
+ let signers = [];
+ if (signerData?.length > 0) {
+ signerData.forEach((x) => {
+ if (x.objectId) {
+ const obj = {
+ __type: "Pointer",
+ className: "contracts_Contactbook",
+ objectId: x.objectId
+ };
+ signers.push(obj);
+ }
+ });
+ }
+ const data = {
+ Name: Doc.Name,
+ URL: Doc.URL,
+ SignedUrl: Doc.SignedUrl,
+ Description: Doc.Description,
+ Note: Doc.Note,
+ Placeholders: placeholdersArr,
+ ExtUserPtr: {
+ __type: "Pointer",
+ className: "contracts_Users",
+ objectId: Doc.ExtUserPtr.objectId
+ },
+ CreatedBy: {
+ __type: "Pointer",
+ className: "_User",
+ objectId: Doc.CreatedBy.objectId
+ },
+ Signers: signers,
+ SendinOrder: Doc?.SendinOrder || false
+ };
+
+ try {
+ const res = await axios.post(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Document`,
+ data,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ );
+ if (res) {
+ return { status: "success", id: res.data.objectId };
+ }
+ } catch (err) {
+ console.log("axois err ", err);
+ return { status: "error", id: "Something Went Wrong!" };
+ }
+ }
+};
+
+export const getFirstLetter = (name) => {
+ const firstLetter = name?.charAt(0);
+ return firstLetter;
+};
+
+export const darkenColor = (color, factor) => {
+ // Remove '#' from the color code and parse it to get RGB values
+ const hex = color.replace("#", "");
+ const r = parseInt(hex.substring(0, 2), 16);
+ const g = parseInt(hex.substring(2, 4), 16);
+ const b = parseInt(hex.substring(4, 6), 16);
+
+ // Darken the color by reducing each RGB component
+ const darkerR = Math.floor(r * (1 - factor));
+ const darkerG = Math.floor(g * (1 - factor));
+ const darkerB = Math.floor(b * (1 - factor));
+
+ // Convert the darkened RGB components back to hex
+ return `#${((darkerR << 16) | (darkerG << 8) | darkerB)
+ .toString(16)
+ .padStart(6, "0")}`;
+};
+
+export const addZIndex = (signerPos, key, setZIndex) => {
+ return signerPos.map((item) => {
+ if (item.placeHolder && item.placeHolder.length > 0) {
+ // If there is a nested array, recursively add the field to the last object
+ return {
+ ...item,
+ placeHolder: addZIndex(item.placeHolder, key, setZIndex)
+ };
+ } else if (item.pos && item.pos.length > 0) {
+ // If there is no nested array, add the new field
+ return {
+ ...item,
+ pos: addZIndex(item.pos, key, setZIndex)
+ // Adjust this line to add the desired field
+ };
+ } else {
+ if (item.key === key) {
+ setZIndex(item.zIndex);
+ return {
+ ...item,
+ zIndex: item.zIndex ? item.zIndex + 1 : 1
+ };
+ } else {
+ return {
+ ...item
+ };
+ }
+ }
+ });
+};
+
+//function for save widgets value on onchange function
+export const onChangeInput = (
+ value,
+ signKey,
+ xyPostion,
+ index,
+ setXyPostion,
+ userId,
+ initial,
+ dateFormat,
+ isPlaceholder,
+ selectedKey,
+ isDefaultEmpty
+) => {
+ const isSigners = xyPostion.some((data) => data.signerPtr);
+ let filterSignerPos;
+ if (isSigners) {
+ if (userId) {
+ filterSignerPos = xyPostion.filter((data) => data.Id === userId);
+ }
+ const getPlaceHolder = filterSignerPos[0]?.placeHolder;
+ if (initial) {
+ const xyData = addInitialData(xyPostion, setXyPostion, value, userId);
+ setXyPostion(xyData);
+ } else {
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === index
+ );
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos;
+ const getPosData = getXYdata;
+ const addSignPos = getPosData.map((position) => {
+ if (position.key === signKey) {
+ if (dateFormat) {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ response: value,
+ validation: {
+ type: "date-format",
+ format: dateFormat // This indicates the required date format explicitly.
+ }
+ }
+ };
+ } else if (isDefaultEmpty) {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ response: value,
+ defaultValue: []
+ }
+ };
+ } else {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ response: value
+ }
+ };
+ }
+ }
+ return position;
+ });
+ const newUpdateSignPos = getPlaceHolder.map((obj) => {
+ if (obj.pageNumber === index) {
+ return { ...obj, pos: addSignPos };
+ }
+ return obj;
+ });
+
+ const newUpdateSigner = xyPostion.map((obj) => {
+ if (obj.Id === userId) {
+ return { ...obj, placeHolder: newUpdateSignPos };
+ }
+ return obj;
+ });
+
+ setXyPostion(newUpdateSigner);
+ }
+ }
+ } else {
+ let getXYdata = xyPostion[index].pos;
+
+ const updatePosition = getXYdata.map((positionData) => {
+ if (positionData.key === signKey) {
+ return {
+ ...positionData,
+ options: {
+ ...positionData.options,
+ response: value
+ }
+ };
+ }
+ return positionData;
+ });
+
+ const updatePlaceholder = xyPostion.map((obj, ind) => {
+ if (ind === index) {
+ return { ...obj, pos: updatePosition };
+ }
+ return obj;
+ });
+ setXyPostion(updatePlaceholder);
+ }
+};
+
+export const addInitialData = (signerPos, setXyPostion, value, userId) => {
+ function widgetDataValue(type) {
+ switch (type) {
+ case "name":
+ return value?.Name;
+ case "company":
+ return value?.Company;
+ case "job title":
+ return value?.JobTitle;
+ case "email":
+ return value?.Email;
+ default:
+ return "";
+ }
+ }
+ return signerPos.map((item) => {
+ if (item.placeHolder && item.placeHolder.length > 0) {
+ // If there is a nested array, recursively add the field to the last object
+ if (item.Id === userId) {
+ return {
+ ...item,
+ placeHolder: addInitialData(
+ item.placeHolder,
+ setXyPostion,
+ value,
+ userId
+ )
+ };
+ } else {
+ return {
+ ...item
+ };
+ }
+ } else if (item.pos && item.pos.length > 0) {
+ // If there is no nested array, add the new field
+ return {
+ ...item,
+ pos: addInitialData(item.pos, setXyPostion, value, userId)
+ // Adjust this line to add the desired field
+ };
+ } else {
+ const widgetData = widgetDataValue(item.type);
+ if (["name", "company", "job title", "email"].includes(item.type)) {
+ return {
+ ...item,
+ options: {
+ ...item.options,
+ response: widgetData
+ },
+ Width: calculateInitialWidthHeight(item.type, widgetData).getWidth,
+ Height: calculateInitialWidthHeight(item.type, widgetData).getHeight
+ };
+ } else {
+ return {
+ ...item
+ };
+ }
+ }
+ });
+};
+
+//calculate width and height
+export const calculateInitialWidthHeight = (type, widgetData) => {
+ const intialText = widgetData;
+ const span = document.createElement("span");
+ span.textContent = intialText;
+ span.style.font = `14px`; // here put your text size and font family
+ span.style.display = "hidden";
+ document.body.appendChild(span);
+ const width = span.offsetWidth;
+ const height = span.offsetHeight;
+
+ document.body.removeChild(span);
+ return {
+ getWidth: width,
+ getHeight: height
+ };
+};
+
+//function for embed document id
+export const embedDocId = async (pdfDoc, documentId, allPages) => {
+ for (let i = 0; i < allPages; i++) {
+ const font = await pdfDoc.embedFont("Helvetica");
+ const fontSize = 10;
+ const textContent = documentId && `OpenSignâ„¢ DocumentId: ${documentId} `;
+ const pages = pdfDoc.getPages();
+ const page = pages[i];
+ page.drawText(textContent, {
+ x: 10,
+ y: page.getHeight() - 10,
+ size: fontSize,
+ font,
+ color: rgb(0.5, 0.5, 0.5)
+ });
+ }
+};
+
+//function for save button to save signature or image url
+export function onSaveSign(
+ xyPostion,
+ index,
+ signKey,
+ signatureImg,
+ imgWH,
+ isDefaultSign,
+ isTypeText
+) {
+ let getIMGWH;
+ let getXYdata = xyPostion[index].pos;
+ const updateXYData = getXYdata.map((position) => {
+ if (position.key === signKey) {
+ if (isDefaultSign === "initials") {
+ let imgWH = { width: position.Width, height: position.Height };
+ getIMGWH = calculateImgAspectRatio(imgWH, position);
+ } else if (isDefaultSign === "default") {
+ getIMGWH = calculateImgAspectRatio(imgWH, position);
+ } else if (isTypeText) {
+ getIMGWH = { newWidth: imgWH.width, newHeight: imgWH.height };
+ } else {
+ const defaultWidth = defaultWidthHeight(position?.type).width;
+ const defaultHeight = defaultWidthHeight(position?.type).height;
+
+ getIMGWH = calculateImgAspectRatio(
+ {
+ width: defaultWidth ? defaultWidth : 150,
+ height: defaultHeight ? defaultHeight : 60
+ },
+ position
+ );
+ }
+
+ const posWidth = getIMGWH ? getIMGWH.newWidth : 150;
+ const posHeight = getIMGWH ? getIMGWH.newHeight : 60;
+
+ return {
+ ...position,
+ Width: posWidth,
+ Height: posHeight,
+ SignUrl: signatureImg,
+ options: {
+ ...position.options,
+ response: signatureImg
+ }
+ };
+ }
+ return position;
+ });
+
+ const updateXYposition = xyPostion.map((obj, ind) => {
+ if (ind === index) {
+ return { ...obj, pos: updateXYData };
+ }
+ return obj;
+ });
+ return updateXYposition;
+}
+
+export const calculateImgAspectRatio = (imgWH, pos) => {
+ let newWidth, newHeight;
+
+ const placeholderHeight = pos && pos.Height ? pos.Height : 60;
+ const aspectRatio = imgWH.width / imgWH.height;
+ newWidth = aspectRatio * placeholderHeight;
+ newHeight = placeholderHeight;
+
+ return { newHeight, newWidth };
+};
+
+//function for upload stamp or image
+export function onSaveImage(xyPostion, index, signKey, imgWH, image) {
+ let getIMGWH;
+
+ //get current page position
+ const getXYData = xyPostion[index].pos;
+ const updateXYData = getXYData.map((position) => {
+ if (position.key === signKey) {
+ getIMGWH = calculateImgAspectRatio(imgWH, position);
+
+ return {
+ ...position,
+ Width: getIMGWH.newWidth,
+ Height: getIMGWH.newHeight,
+ SignUrl: image.src,
+ ImageType: image.imgType,
+ options: {
+ ...position.options,
+ response: image.src
+ }
+ };
+ }
+ return position;
+ });
+
+ const updateXYposition = xyPostion.map((obj, ind) => {
+ if (ind === index) {
+ return { ...obj, pos: updateXYData };
+ }
+ return obj;
+ });
+ return updateXYposition;
+}
+
+//function for select image and upload image
+export const onImageSelect = (event, setImgWH, setImage) => {
+ const imageType = event.target.files[0].type;
+ const reader = new FileReader();
+ reader.readAsDataURL(event.target.files[0]);
+
+ reader.onloadend = function (e) {
+ let width, height;
+ const image = new Image();
+
+ image.src = e.target.result;
+ image.onload = function () {
+ width = image.width;
+ height = image.height;
+ const aspectRatio = 460 / 184;
+ const imgR = width / height;
+
+ if (imgR > aspectRatio) {
+ width = 460;
+ height = 460 / imgR;
+ } else {
+ width = 184 * imgR;
+ height = 184;
+ }
+ setImgWH({ width: width, height: height });
+ };
+
+ image.src = reader.result;
+
+ setImage({ src: image.src, imgType: imageType });
+ };
+};
+
+//function for embed multiple signature using pdf-lib
+export const multiSignEmbed = async (
+ pngUrl,
+ pdfDoc,
+ pdfOriginalWidth,
+ signyourself,
+ containerWH
+) => {
+ for (let item of pngUrl) {
+ const newWidth = containerWH.width;
+ const scale = isMobile ? pdfOriginalWidth / newWidth : 1;
+ const pageNo = item.pageNumber;
+ const imgUrlList = item.pos;
+ const pages = pdfDoc.getPages();
+ const form = pdfDoc.getForm();
+ const page = pages[pageNo - 1];
+ const images = await Promise.all(
+ imgUrlList.map(async (url) => {
+ let signUrl = url.SignUrl && url.SignUrl;
+ if (signUrl) {
+ if (url.ImageType === "image/png") {
+ //function for convert signature png base64 url to jpeg base64
+ const newUrl = await convertPNGtoJPEG(signUrl);
+ signUrl = newUrl;
+ }
+ const checkUrl = urlValidator(signUrl);
+ if (checkUrl) {
+ signUrl = signUrl + "?get";
+ }
+ const res = await fetch(signUrl);
+ return res.arrayBuffer();
+ }
+ })
+ );
+
+ imgUrlList.forEach(async (position, id) => {
+ let img;
+ if (["signature", "stamp", "initials", "image"].includes(position.type)) {
+ if (
+ (position.ImageType && position.ImageType === "image/png") ||
+ position.ImageType === "image/jpeg"
+ ) {
+ img = await pdfDoc.embedJpg(images[id]);
+ } else {
+ img = await pdfDoc.embedPng(images[id]);
+ }
+ } else if (!position.type) {
+ if (
+ (position.ImageType && position.ImageType === "image/png") ||
+ position.ImageType === "image/jpeg"
+ ) {
+ img = await pdfDoc.embedJpg(images[id]);
+ } else {
+ img = await pdfDoc.embedPng(images[id]);
+ }
+ }
+ let scaleWidth, scaleHeight;
+ scaleWidth = placeholderWidth(position, scale, signyourself);
+ scaleHeight = placeholderHeight(position, scale, signyourself);
+
+ const xPos = (pos) => {
+ const resizePos = pos.xPosition;
+
+ if (signyourself) {
+ if (isMobile) {
+ return resizePos * scale;
+ } else {
+ return resizePos;
+ }
+ } else {
+ //checking both condition mobile and desktop view
+ if (isMobile) {
+ //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale
+ if (pos.isMobile) {
+ const x = resizePos * (pos.scale / scale);
+ return x * scale;
+ } else {
+ const x = resizePos / scale;
+ return x * scale;
+ }
+ } else {
+ //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale
+ if (pos.isMobile) {
+ const x = resizePos * pos.scale;
+ return x;
+ } else {
+ return resizePos;
+ }
+ }
+ }
+ };
+
+ const yPos = (pos, ind) => {
+ const resizePos = pos.yPosition;
+ const widgetHeight =
+ position.type === "radio"
+ ? 10
+ : position.type === "checkbox"
+ ? 10
+ : scaleHeight;
+ const newHeight = ind ? (ind > 0 ? widgetHeight : 0) : widgetHeight;
+
+ if (signyourself) {
+ if (isMobile) {
+ if (ind && ind > 0 && position.type === "checkbox") {
+ return page.getHeight() - resizePos * scale - newHeight;
+ } else if (!ind && position.type === "checkbox") {
+ return page.getHeight() - resizePos * scale;
+ } else {
+ return page.getHeight() - resizePos * scale - newHeight;
+ }
+ // return page.getHeight() - resizePos * scale - scaleHeight;
+ } else {
+ if (ind && ind > 0 && position.type === "checkbox") {
+ return page.getHeight() - resizePos - newHeight;
+ } else if (!ind && position.type === "checkbox") {
+ return page.getHeight() - resizePos;
+ } else {
+ return page.getHeight() - resizePos - newHeight;
+ }
+ // return page.getHeight() - resizePos - scaleHeight;
+ }
+ } else {
+ //checking both condition mobile and desktop view
+ const y = resizePos / scale;
+ if (isMobile) {
+ //if pos.isMobile false -- placeholder saved from desktop view then handle position in mobile view divided by scale
+ if (pos.isMobile) {
+ const y = resizePos * (pos.scale / scale);
+ return page.getHeight() - y * scale - scaleHeight;
+ } else {
+ if (pos.IsResize) {
+ return page.getHeight() - y * scale - scaleHeight;
+ } else {
+ return page.getHeight() - y * scale - scaleHeight;
+ }
+ }
+ } else {
+ //else if pos.isMobile true -- placeholder saved from mobile or tablet view then handle position in desktop view divide by scale
+ if (pos.isMobile) {
+ if (pos.IsResize) {
+ const y = resizePos * pos.scale;
+ return page.getHeight() - y - scaleHeight;
+ } else {
+ const y = resizePos * pos.scale;
+ return page.getHeight() - y - scaleHeight;
+ }
+ } else {
+ if (ind && ind > 0 && position.type === "checkbox") {
+ return page.getHeight() - resizePos - newHeight;
+ } else if (!ind && position.type === "checkbox") {
+ return page.getHeight() - resizePos;
+ } else {
+ return page.getHeight() - resizePos - newHeight;
+ }
+ }
+ }
+ }
+ };
+ const randomboxId = "randombox_" + position.key;
+ const widgetTypeExist = [
+ "text",
+ "name",
+ "company",
+ "job title",
+ "date",
+ "email",
+ "label"
+ ].includes(position.type);
+ if (position.type === "checkbox") {
+ let addYPosition, isCheck;
+
+ if (position?.options?.values.length > 0) {
+ position?.options?.values.forEach((item, ind) => {
+ const checkboxRandomId = "checkbox" + randomId();
+ let yPosition;
+ const height = 10;
+ if (
+ position?.options?.response &&
+ position?.options?.response?.length > 0
+ ) {
+ isCheck = position?.options?.response?.includes(ind);
+ } else if (position?.options?.defaultValue) {
+ isCheck = position?.options?.defaultValue?.includes(ind);
+ }
+
+ const checkbox = form.createCheckBox(checkboxRandomId);
+ if (ind > 0) {
+ yPosition = yPos(position, ind) - addYPosition;
+ addYPosition = addYPosition + height + 10;
+ } else {
+ yPosition = yPos(position, ind);
+ addYPosition = height;
+ }
+ checkbox.addToPage(page, {
+ x: xPos(position),
+ y: yPosition,
+ width: height,
+ height: height
+ });
+ if (isCheck) {
+ checkbox.check();
+ } else {
+ checkbox.uncheck();
+ }
+ checkbox.enableReadOnly();
+ });
+ }
+ } else if (widgetTypeExist) {
+ const font = await pdfDoc.embedFont("Helvetica");
+ const fontSize = 12;
+ let textContent;
+ if (position?.options?.response) {
+ textContent = position.options?.response;
+ } else if (position?.options?.defaultValue) {
+ textContent = position?.options?.defaultValue;
+ }
+ page.drawText(textContent, {
+ x: xPos(position),
+ y: yPos(position) + 10,
+ size: fontSize,
+ font,
+ color: rgb(0, 0, 0)
+ });
+ } else if (position.type === "dropdown") {
+ const dropdown = form.createDropdown(randomboxId);
+ dropdown.addOptions(position?.options?.values);
+ if (position?.options?.response) {
+ dropdown.select(position.options?.response);
+ } else if (position?.options?.defaultValue) {
+ dropdown.select(position?.options?.defaultValue);
+ }
+
+ dropdown.addToPage(page, {
+ x: xPos(position),
+ y: yPos(position),
+ width: scaleWidth,
+ height: scaleHeight
+ });
+ dropdown.enableReadOnly();
+ } else if (position.type === "radio") {
+ const radioGroup = form.createRadioGroup(randomboxId);
+ let addYPosition = 18;
+
+ for (let i = 1; i <= position?.options?.values.length; i++) {
+ const data = position?.options?.values[i - 1];
+ let yPosition;
+ if (i > 1) {
+ yPosition = yPos(position) - addYPosition;
+ } else {
+ yPosition = yPos(position);
+ }
+
+ radioGroup.addOptionToPage(data, page, {
+ x: xPos(position),
+ y: yPosition,
+ width: 11,
+ height: 11
+ });
+ if (i > 1) {
+ addYPosition = addYPosition + 18;
+ }
+ }
+ if (position?.options?.response) {
+ radioGroup.select(position.options?.response);
+ } else if (position?.options?.defaultValue) {
+ radioGroup.select(position?.options?.defaultValue);
+ }
+
+ radioGroup.enableReadOnly();
+ } else {
+ page.drawImage(img, {
+ x: xPos(position),
+ y: yPos(position),
+ width: scaleWidth,
+ height: scaleHeight
+ });
+ }
+ });
+ }
+
+ const pdfBytes = await pdfDoc.saveAsBase64({ useObjectStreams: false });
+
+ return pdfBytes;
+};
+
+// function for validating URLs
+export function urlValidator(url) {
+ try {
+ const newUrl = new URL(url);
+ return newUrl.protocol === "http:" || newUrl.protocol === "https:";
+ } catch (err) {
+ return false;
+ }
+}
+
+export const placeholderWidth = (pos, scale, signyourself) => {
+ let width;
+ const defaultWidth = defaultWidthHeight(pos.type).width;
+ const posWidth = pos.Width ? pos.Width : defaultWidth;
+
+ if (signyourself) {
+ if (isMobile) {
+ return posWidth * scale;
+ } else {
+ return posWidth;
+ }
+ } else {
+ if (isMobile) {
+ if (pos.isMobile) {
+ width = posWidth ? posWidth * scale : defaultWidth * scale;
+ return width;
+ } else {
+ if (pos.IsResize) {
+ width = posWidth ? posWidth * scale : defaultWidth * scale;
+ return width;
+ } else {
+ width = posWidth ? posWidth : defaultWidth;
+ return width;
+ }
+ }
+ } else {
+ if (pos.isMobile) {
+ if (pos.IsResize) {
+ width = posWidth ? posWidth : defaultWidth;
+ return width;
+ } else {
+ width = posWidth ? posWidth * pos.scale : defaultWidth * pos.scale;
+
+ return width;
+ }
+ } else {
+ width = posWidth ? posWidth : defaultWidth;
+ return width;
+ }
+ }
+ }
+};
+export const placeholderHeight = (pos, scale, signyourself) => {
+ let height;
+ const posHeight = pos.Height;
+ const defaultHeight = defaultWidthHeight(pos.type).height;
+ if (signyourself) {
+ if (isMobile) {
+ return posHeight ? posHeight * scale : defaultHeight * scale;
+ } else {
+ return posHeight ? posHeight : defaultHeight;
+ }
+ } else {
+ if (isMobile) {
+ if (pos.isMobile) {
+ height = posHeight ? posHeight * scale : defaultHeight * scale;
+ return height;
+ } else {
+ if (pos.IsResize) {
+ height = posHeight ? posHeight * scale : defaultHeight * scale;
+ return height;
+ } else {
+ height = posHeight ? posHeight : defaultHeight;
+
+ return height;
+ }
+ }
+ } else {
+ if (pos.isMobile) {
+ if (pos.IsResize) {
+ height = posHeight ? posHeight : defaultHeight;
+ return height;
+ } else {
+ height = posHeight
+ ? posHeight * pos.scale
+ : defaultHeight * pos.scale;
+ return height;
+ }
+ } else {
+ height = posHeight ? posHeight : defaultHeight;
+ return height;
+ }
+ }
+ }
+};
+
+//function for getting contracts_contactbook details
+export const contactBook = async (objectId) => {
+ const result = await axios
+ .get(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Contactbook?where={"objectId":"${objectId}"}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then((Listdata) => {
+ const json = Listdata.data;
+ const res = json.results;
+ return res;
+ })
+
+ .catch((err) => {
+ console.log("Err ", err);
+ return "Error: Something went wrong!";
+ });
+ return result;
+};
+
+export const contractDocument = async (documentId) => {
+ const data = {
+ docId: documentId
+ };
+ const documentDeatils = await axios
+ .post(`${localStorage.getItem("baseUrl")}functions/getDocument`, data, {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessionToken: localStorage.getItem("accesstoken")
+ }
+ })
+ .then((Listdata) => {
+ const json = Listdata.data;
+ let data = [];
+ if (json && json.result.error) {
+ return json;
+ } else if (json && json.result) {
+ data.push(json.result);
+ return data;
+ } else {
+ return [];
+ }
+ })
+ .catch((err) => {
+ console.log("Err ", err);
+ return "Error: Something went wrong!";
+ });
+
+ return documentDeatils;
+};
+
+//function for add default signature or image for all requested location
+export const addDefaultSignatureImg = (xyPostion, defaultSignImg) => {
+ let imgWH = { width: "", height: "" };
+ const img = new Image();
+ img.src = defaultSignImg;
+ if (img.complete) {
+ imgWH = {
+ width: img.width,
+ height: img.height
+ };
+ }
+
+ let xyDefaultPos = [];
+ for (let i = 0; i < xyPostion.length; i++) {
+ let getIMGWH;
+ const getXYdata = xyPostion[i].pos;
+ const getPageNo = xyPostion[i].pageNumber;
+ const getPosData = getXYdata;
+
+ const addSign = getPosData.map((position) => {
+ getIMGWH = calculateImgAspectRatio(imgWH, position);
+ if (position.type) {
+ if (position?.type === "signature") {
+ return {
+ ...position,
+ SignUrl: defaultSignImg,
+ Width: getIMGWH.newWidth,
+ Height: getIMGWH.newHeight,
+ ImageType: "default",
+ options: {
+ ...position.options,
+ response: defaultSignImg
+ }
+ };
+ }
+ } else if (position && !position.isStamp) {
+ return {
+ ...position,
+ SignUrl: defaultSignImg,
+ Width: getIMGWH.newWidth,
+ Height: getIMGWH.newHeight,
+ ImageType: "default",
+ options: {
+ ...position.options,
+ response: defaultSignImg
+ }
+ };
+ }
+ return position;
+ });
+
+ const newXypos = {
+ pageNumber: getPageNo,
+ pos: addSign
+ };
+ xyDefaultPos.push(newXypos);
+ }
+ return xyDefaultPos;
+};
diff --git a/apps/OpenSign/src/constant/appinfo.js b/apps/OpenSign/src/constant/appinfo.js
index f0f306a6b..e379ee3e1 100644
--- a/apps/OpenSign/src/constant/appinfo.js
+++ b/apps/OpenSign/src/constant/appinfo.js
@@ -3,7 +3,9 @@ export const appInfo = {
appTitle: "contracts",
applogo: logo,
appname: "contracts",
- baseurl: process.env.REACT_APP_SERVERURL,
+ baseurl: process.env.REACT_APP_SERVERURL
+ ? process.env.REACT_APP_SERVERURL
+ : window.location.origin + "/api/app",
defaultRole: "contracts_User",
fbAppId: process.env.REACT_APP_FBAPPID
? `${process.env.REACT_APP_FBAPPID}`
diff --git a/apps/OpenSign/src/constant/const.js b/apps/OpenSign/src/constant/const.js
index 4f7ded0f8..490504ae4 100644
--- a/apps/OpenSign/src/constant/const.js
+++ b/apps/OpenSign/src/constant/const.js
@@ -7,3 +7,5 @@ export const submitBtn =
"bg-[#32a3ac] rounded-sm shadow-md text-[12px] font-semibold uppercase text-white py-1.5 px-4 focus:outline-none text-center";
export const modalSubmitBtnColor = "#17a2b8";
export const modalCancelBtnColor = "white";
+export const themeColor = "#47a3ad";
+export const iconColor = "#686968";
diff --git a/apps/OpenSign/src/index.js b/apps/OpenSign/src/index.js
index 89cb35b00..9dad5e112 100644
--- a/apps/OpenSign/src/index.js
+++ b/apps/OpenSign/src/index.js
@@ -1 +1,62 @@
-import("./Bootstrap");
+import React from "react";
+import ReactDOM from "react-dom/client";
+import "./index.css";
+import App from "./App";
+import { Provider } from "react-redux";
+import { store } from "./redux/store";
+import { HTML5Backend } from "react-dnd-html5-backend";
+import { TouchBackend } from "react-dnd-touch-backend";
+import {
+ DndProvider,
+ TouchTransition,
+ MouseTransition,
+ Preview
+} from "react-dnd-multi-backend";
+import DragElement from "./components/pdf/DragElement";
+import TagManager from "react-gtm-module";
+
+const HTML5toTouch = {
+ backends: [
+ {
+ id: "html5",
+ backend: HTML5Backend,
+ transition: MouseTransition
+ },
+ {
+ id: "touch",
+ backend: TouchBackend,
+ options: { enableMouseEvents: true },
+ preview: true,
+ transition: TouchTransition
+ }
+ ]
+};
+const generatePreview = (props) => {
+ const { item, style } = props;
+ const newStyle = {
+ ...style
+ };
+
+ return (
+ <div style={newStyle}>
+ <DragElement {...item} />
+ </div>
+ );
+};
+
+if (process.env.REACT_APP_GTM) {
+ const tagManagerArgs = {
+ gtmId: process.env.REACT_APP_GTM
+ };
+ TagManager.initialize(tagManagerArgs);
+}
+
+const root = ReactDOM.createRoot(document.getElementById("root"));
+root.render(
+ <Provider store={store}>
+ <DndProvider options={HTML5toTouch}>
+ <Preview>{generatePreview}</Preview>
+ <App />
+ </DndProvider>
+ </Provider>
+);
diff --git a/apps/OpenSign/src/json/ReportJson.js b/apps/OpenSign/src/json/ReportJson.js
index fbe0b6444..0f0edc38c 100644
--- a/apps/OpenSign/src/json/ReportJson.js
+++ b/apps/OpenSign/src/json/ReportJson.js
@@ -16,8 +16,7 @@ export default function reportJson(id) {
btnColor: "#4bd396",
textColor: "white",
btnIcon: "fa fa-plus",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/draftDocument"
+ redirectUrl: "draftDocument"
}
]
};
@@ -32,8 +31,7 @@ export default function reportJson(id) {
btnColor: "#3ac9d6",
textColor: "white",
btnIcon: "fa fa-eye",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/pdfRequestFiles"
+ redirectUrl: "pdfRequestFiles"
}
]
};
@@ -48,8 +46,7 @@ export default function reportJson(id) {
btnColor: "#3ac9d6",
textColor: "white",
btnIcon: "fa fa-eye",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/pdfRequestFiles"
+ redirectUrl: "pdfRequestFiles"
}
]
};
@@ -64,8 +61,7 @@ export default function reportJson(id) {
btnColor: "#4bd396",
textColor: "white",
btnIcon: "fa fa-eye",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/draftDocument"
+ redirectUrl: "draftDocument"
}
]
};
@@ -80,8 +76,7 @@ export default function reportJson(id) {
btnColor: "#4bd396",
textColor: "white",
btnIcon: "fa fa-eye",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/draftDocument"
+ redirectUrl: "draftDocument"
}
]
};
@@ -96,8 +91,7 @@ export default function reportJson(id) {
btnColor: "#4bd396",
textColor: "white",
btnIcon: "fa fa-eye",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/draftDocument"
+ redirectUrl: "draftDocument"
}
]
};
@@ -112,8 +106,7 @@ export default function reportJson(id) {
btnColor: "#4bd396",
textColor: "white",
btnIcon: "fa fa-eye",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/pdfRequestFiles"
+ redirectUrl: "pdfRequestFiles"
}
]
};
@@ -128,8 +121,7 @@ export default function reportJson(id) {
btnColor: "#4bd396",
textColor: "white",
btnIcon: "fa fa-eye",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/pdfRequestFiles"
+ redirectUrl: "pdfRequestFiles"
}
]
};
@@ -144,8 +136,7 @@ export default function reportJson(id) {
btnColor: "#4bd396",
textColor: "white",
btnIcon: "fa fa-plus",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/draftDocument"
+ redirectUrl: "draftDocument"
}
]
};
@@ -175,16 +166,14 @@ export default function reportJson(id) {
btnColor: "#4bd396",
textColor: "white",
btnIcon: "fa fa-plus",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/placeHolderSign"
+ redirectUrl: "placeHolderSign"
},
{
btnLabel: "Edit",
btnColor: "#00c9d5",
textColor: "white",
btnIcon: "fa fa-plus",
- redirectUrl:
- "remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/template"
+ redirectUrl: "template"
}
]
};
diff --git a/apps/OpenSign/src/microappComponent/DragElement.js b/apps/OpenSign/src/microappComponent/DragElement.js
deleted file mode 100644
index 912af9c13..000000000
--- a/apps/OpenSign/src/microappComponent/DragElement.js
+++ /dev/null
@@ -1,112 +0,0 @@
-import React from "react";
-import { themeColor } from "./themeColor";
-
-function DragElement(item) {
- const getWidgets = [
- {
- type: "signature",
- icon: "fa-solid fa-pen-nib",
- iconSize: "20px"
- },
- {
- type: "stamp",
- icon: "fa-solid fa-stamp",
- iconSize: "19px"
- },
- {
- type: "dropdown",
- icon: "fa-solid fa-circle-chevron-down",
- iconSize: "19px"
- },
- {
- type: "checkbox",
- icon: "fa-solid fa-square-check",
- iconSize: "22px"
- },
- {
- type: "text",
- icon: "fa-solid fa-font",
- iconSize: "21px"
- },
- {
- type: "initials",
- icon: "fa-solid fa-signature",
- iconSize: "15px"
- },
- {
- type: "name",
- icon: "fa-solid fa-user",
- iconSize: "21px"
- },
- {
- type: "company",
- icon: "fa-solid fa-building",
- iconSize: "24px"
- },
- {
- type: "job title",
- icon: "fa-solid fa-address-card",
- iconSize: "16px"
- },
- {
- type: "date",
- icon: "fa-solid fa-calendar-days",
- iconSize: "19px"
- }
- ];
-
- const filterWidgetPreview = getWidgets.filter(
- (data) => data.type === item?.text
- );
-
- return (
- <div
- className="signatureBtn"
- style={{
- // opacity: isDragSign ? 0.5 : 1,
- boxShadow:
- "0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18)",
- marginLeft: "5px"
- }}
- >
- <div
- style={{
- display: "flex",
- alignItems: "center",
- marginLeft: "5px"
- }}
- >
- <i
- className="fa-sharp fa-solid fa-grip-vertical"
- style={{ color: "#908d8d", fontSize: "13px" }}
- ></i>
- <span
- style={{
- fontWeight: "400",
- fontSize: "15px",
- // padding: "3px 20px 0px 20px",
- color: "black",
- marginLeft: "5px"
- }}
- >
- {filterWidgetPreview[0].type}
- </span>
- </div>
- <div
- style={{
- backgroundColor: themeColor(),
- padding: "0 5px",
- display: "flex",
- alignItems: "center"
- }}
- >
- <i
- style={{ color: "white", fontSize: filterWidgetPreview[0].iconSize }}
- className={filterWidgetPreview[0].icon}
- ></i>
- </div>
- </div>
- );
-}
-
-export default DragElement;
diff --git a/apps/OpenSign/src/microappComponent/themeColor.js b/apps/OpenSign/src/microappComponent/themeColor.js
deleted file mode 100644
index 5f3d29530..000000000
--- a/apps/OpenSign/src/microappComponent/themeColor.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export const themeColor = () => {
- return "#47a3ad";
-};
diff --git a/apps/OpenSign/src/primitives/AddRoleModal.js b/apps/OpenSign/src/primitives/AddRoleModal.js
new file mode 100644
index 000000000..4c95afe87
--- /dev/null
+++ b/apps/OpenSign/src/primitives/AddRoleModal.js
@@ -0,0 +1,67 @@
+import React from "react";
+import ModalUi from "./ModalUi";
+
+const AddRoleModal = (props) => {
+ return (
+ <ModalUi
+ title={"Add Role"}
+ isOpen={props.isModalRole}
+ handleClose={props.handleCloseRoleModal}
+ >
+ <div className="addusercontainer">
+ <form
+ style={{ display: "flex", flexDirection: "column" }}
+ onSubmit={props.handleAddRole}
+ >
+ <input
+ value={props.roleName}
+ onChange={(e) => props.setRoleName(e.target.value)}
+ placeholder={
+ props.signersdata.length > 0
+ ? "User " + (props.signersdata.length + 1)
+ : "User 1"
+ }
+ className="addUserInput"
+ />
+ <p
+ style={{
+ color: "grey",
+ fontSize: 11,
+ margin: "10px 0 10px 5px"
+ }}
+ >
+ e.g: Hr, Director, Manager, New joinee, Accountant, etc...
+ </p>
+ <div>
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ type="submit"
+ style={{
+ background: "#00a2b7"
+ }}
+ className="finishBtn"
+ >
+ Add
+ </button>
+ <button
+ onClick={props.handleCloseRoleModal}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Close
+ </button>
+ </div>
+ </form>
+ </div>
+ </ModalUi>
+ );
+};
+
+export default AddRoleModal;
diff --git a/apps/OpenSign/src/primitives/AddUser.js b/apps/OpenSign/src/primitives/AddUser.js
new file mode 100644
index 000000000..7e62ae6b7
--- /dev/null
+++ b/apps/OpenSign/src/primitives/AddUser.js
@@ -0,0 +1,293 @@
+import React, { useState, useEffect } from "react";
+import Parse from "parse";
+import axios from "axios";
+import "../styles/AddUser.css";
+const AddUser = (props) => {
+ const [name, setName] = useState("");
+ const [phone, setPhone] = useState("");
+ const [email, setEmail] = useState("");
+ const [addYourself, setAddYourself] = useState(false);
+ const [isLoader, setIsLoader] = useState(false);
+ const [isUserExist, setIsUserExist] = useState(false);
+ const parseBaseUrl = localStorage.getItem("baseUrl");
+ const parseAppId = localStorage.getItem("parseAppId");
+ Parse.serverURL = parseBaseUrl;
+ Parse.initialize(parseAppId);
+
+ useEffect(() => {
+ checkUserExist();
+ }, []);
+ // Load user details from localStorage when the component mounts
+ useEffect(() => {
+ const savedUserDetails = JSON.parse(
+ localStorage.getItem("UserInformation")
+ );
+ if (savedUserDetails && addYourself) {
+ setName(savedUserDetails.name);
+ setPhone(savedUserDetails.phone);
+ setEmail(savedUserDetails.email);
+ }
+ }, [addYourself]);
+
+ const checkUserExist = async () => {
+ const user = Parse.User.current();
+ try {
+ const query = new Parse.Query("contracts_Contactbook");
+ query.equalTo("CreatedBy", user);
+ query.notEqualTo("IsDeleted", true);
+ query.equalTo("Email", user.getEmail());
+ const res = await query.first();
+ // console.log(res);
+ if (!res) {
+ setIsUserExist(true);
+ }
+ } catch (err) {
+ console.log("err", err);
+ }
+ };
+ // Define a function to handle form submission
+ const handleSubmit = async (e) => {
+ e.preventDefault();
+ e.stopPropagation();
+ setIsLoader(true);
+ Parse.serverURL = parseBaseUrl;
+ Parse.initialize(parseAppId);
+ try {
+ const contactQuery = new Parse.Object("contracts_Contactbook");
+ contactQuery.set("Name", name);
+ contactQuery.set("Phone", phone);
+ contactQuery.set("Email", email);
+ contactQuery.set("UserRole", "contracts_Guest");
+
+ if (localStorage.getItem("TenetId")) {
+ contactQuery.set("TenantId", {
+ __type: "Pointer",
+ className: "partners_Tenant",
+ objectId: localStorage.getItem("TenetId")
+ });
+ }
+
+ try {
+ const _users = Parse.Object.extend("User");
+ const _user = new _users();
+ _user.set("name", name);
+ _user.set("username", email);
+ _user.set("email", email);
+ _user.set("phone", phone);
+ _user.set("password", phone);
+
+ const user = await _user.save();
+ if (user) {
+ const roleurl = `${parseBaseUrl}functions/AddUserToRole`;
+ const headers = {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": parseAppId,
+ sessionToken: localStorage.getItem("accesstoken")
+ };
+ const body = {
+ appName: localStorage.getItem("_appName"),
+ roleName: "contracts_Guest",
+ userId: user.id
+ };
+ await axios.post(roleurl, body, { headers: headers });
+ const currentUser = Parse.User.current();
+ contactQuery.set(
+ "CreatedBy",
+ Parse.User.createWithoutData(currentUser.id)
+ );
+
+ contactQuery.set("UserId", user);
+ const acl = new Parse.ACL();
+ acl.setPublicReadAccess(true);
+ acl.setPublicWriteAccess(true);
+ acl.setReadAccess(currentUser.id, true);
+ acl.setWriteAccess(currentUser.id, true);
+
+ contactQuery.setACL(acl);
+
+ const res = await contactQuery.save();
+
+ const parseData = JSON.parse(JSON.stringify(res));
+ props.details(parseData);
+ if (props.closePopup) {
+ props.closePopup();
+ }
+
+ setIsLoader(false);
+ // Reset the form fields
+ setAddYourself(false);
+ setName("");
+ setPhone("");
+ setEmail("");
+ }
+ } catch (err) {
+ console.log("err ", err);
+ if (err.code === 202) {
+ const params = { email: email };
+ const userRes = await Parse.Cloud.run("getUserId", params);
+ const roleurl = `${parseBaseUrl}functions/AddUserToRole`;
+ const headers = {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": parseAppId,
+ sessionToken: localStorage.getItem("accesstoken")
+ };
+ const body = {
+ appName: localStorage.getItem("_appName"),
+ roleName: "contracts_Guest",
+ userId: userRes.id
+ };
+ await axios.post(roleurl, body, { headers: headers });
+ const currentUser = Parse.User.current();
+ contactQuery.set(
+ "CreatedBy",
+ Parse.User.createWithoutData(currentUser.id)
+ );
+
+ contactQuery.set("UserId", {
+ __type: "Pointer",
+ className: "_User",
+ objectId: userRes.id
+ });
+ const acl = new Parse.ACL();
+ acl.setPublicReadAccess(true);
+ acl.setPublicWriteAccess(true);
+ acl.setReadAccess(currentUser.id, true);
+ acl.setWriteAccess(currentUser.id, true);
+
+ contactQuery.setACL(acl);
+ const res = await contactQuery.save();
+
+ const parseData = JSON.parse(JSON.stringify(res));
+ if (props.details) {
+ props.details(parseData);
+ }
+
+ if (props.closePopup) {
+ props.closePopup();
+ }
+ setIsLoader(false);
+ // Reset the form fields
+ setAddYourself(false);
+ setName("");
+ setPhone("");
+ setEmail("");
+ }
+ }
+ } catch (err) {
+ // console.log("err", err);
+ setIsLoader(false);
+ alert("something went wrong!");
+ }
+ };
+
+ // Define a function to handle the "add yourself" checkbox
+ const handleAddYourselfChange = () => {
+ if (addYourself) {
+ setAddYourself(false);
+ setName("");
+ setPhone("");
+ setEmail("");
+ } else {
+ setAddYourself(true);
+ }
+ };
+ const handleReset = () => {
+ setAddYourself(false);
+ };
+
+ return (
+ <div className="addusercontainer">
+ {isLoader && (
+ <div className="loaderdiv">
+ <div
+ style={{
+ fontSize: "45px",
+ color: "#3dd3e0"
+ }}
+ className="loader-37"
+ ></div>
+ </div>
+ )}
+ <div className="form-wrapper">
+ <div style={{ fontSize: 14, fontWeight: "700" }}>Add User</div>
+
+ {isUserExist && (
+ <div className="form-section">
+ <input
+ type="checkbox"
+ id="addYourself"
+ checked={addYourself}
+ onChange={handleAddYourselfChange}
+ className="form-checkbox"
+ />
+ <label htmlFor="addYourself" className="checkbox-label ">
+ Add Yourself
+ </label>
+ </div>
+ )}
+ <form onSubmit={handleSubmit}>
+ <div className="form-section">
+ <label htmlFor="name" style={{ fontSize: 13 }}>
+ Name
+ <span style={{ color: "red", fontSize: 13 }}> *</span>
+ </label>
+ <input
+ type="text"
+ id="name"
+ value={name}
+ onChange={(e) => setName(e.target.value)}
+ required
+ disabled={addYourself}
+ className="addUserInput"
+ />
+ </div>
+ <div className="form-section">
+ <label htmlFor="email" style={{ fontSize: 13 }}>
+ Email
+ <span style={{ color: "red", fontSize: 13 }}> *</span>
+ </label>
+ <input
+ type="email"
+ id="email"
+ value={email}
+ onChange={(e) => setEmail(e.target.value)}
+ required
+ disabled={addYourself}
+ className="addUserInput"
+ />
+ </div>
+ <div className="form-section">
+ <label htmlFor="phone" style={{ fontSize: 13 }}>
+ Phone
+ <span style={{ color: "red", fontSize: 13 }}> *</span>
+ </label>
+ <input
+ type="text"
+ id="phone"
+ value={phone}
+ onChange={(e) => setPhone(e.target.value)}
+ required
+ disabled={addYourself}
+ className="addUserInput"
+ />
+ </div>
+
+ <div className="buttoncontainer">
+ <button type="submit" className="submitbutton">
+ Submit
+ </button>
+ <button
+ type="button"
+ onClick={() => handleReset()}
+ className="resetbutton"
+ >
+ Reset
+ </button>
+ </div>
+ </form>
+ </div>
+ </div>
+ );
+};
+
+export default AddUser;
diff --git a/apps/OpenSign/src/primitives/EmailToast.js b/apps/OpenSign/src/primitives/EmailToast.js
new file mode 100644
index 000000000..d22293cdc
--- /dev/null
+++ b/apps/OpenSign/src/primitives/EmailToast.js
@@ -0,0 +1,21 @@
+import React from "react";
+import "../styles/signature.css";
+
+function EmailToast({ isShow }) {
+ return (
+ <>
+ {isShow && (
+ <div style={{ display: "flex", justifyContent: "center" }}>
+ <div
+ className="alert alert-success successBox"
+ style={{ zIndex: "1051" }}
+ >
+ Email sent successfully!
+ </div>
+ </div>
+ )}
+ </>
+ );
+}
+
+export default EmailToast;
diff --git a/apps/OpenSign/src/primitives/GetReportDisplay.js b/apps/OpenSign/src/primitives/GetReportDisplay.js
index 8450c2657..a2b11348a 100644
--- a/apps/OpenSign/src/primitives/GetReportDisplay.js
+++ b/apps/OpenSign/src/primitives/GetReportDisplay.js
@@ -67,7 +67,7 @@ const ReportTable = ({
const handlemicroapp = async (item, url, btnLabel) => {
if (ReportName === "Templates") {
if (btnLabel === "Edit") {
- navigate(`/asmf/${url}/${item.objectId}`);
+ navigate(`/${url}/${item.objectId}`);
} else {
setActLoader({ [`${item.objectId}_${btnLabel}`]: true });
try {
@@ -149,7 +149,7 @@ const ReportTable = ({
if (res.data && res.data.objectId) {
setActLoader({});
setIsAlert(true);
- navigate(`/asmf/${url}/${res.data.objectId}`, {
+ navigate(`/${url}/${res.data.objectId}`, {
state: { title: "Use Template" }
});
}
@@ -177,7 +177,7 @@ const ReportTable = ({
}
} else {
localStorage.removeItem("rowlevel");
- navigate("/rpmf/" + url);
+ navigate(`/${url}`);
localStorage.setItem("rowlevel", JSON.stringify(item));
}
@@ -211,8 +211,10 @@ const ReportTable = ({
setIsDeleteModal({});
setActLoader({ [item.objectId]: true });
try {
- const url =
- process.env.REACT_APP_SERVERURL + "/classes/contracts_Contactbook/";
+ const serverUrl = process.env.REACT_APP_SERVERURL
+ ? process.env.REACT_APP_SERVERURL
+ : window.location.origin + "/api/app";
+ const url = serverUrl + "/classes/contracts_Contactbook/";
const body = { IsDeleted: true };
const res = await axios.put(url + item.objectId, body, {
headers: {
diff --git a/apps/OpenSign/src/primitives/HandleError.js b/apps/OpenSign/src/primitives/HandleError.js
new file mode 100644
index 000000000..a9227d4cf
--- /dev/null
+++ b/apps/OpenSign/src/primitives/HandleError.js
@@ -0,0 +1,18 @@
+import React from "react";
+
+function HandleError({ handleError }) {
+ return (
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100vh"
+ }}
+ >
+ <span style={{ fontSize: "20px", color: "gray" }}>{handleError}</span>
+ </div>
+ );
+}
+
+export default HandleError;
diff --git a/apps/OpenSign/src/primitives/LinkUserModal.js b/apps/OpenSign/src/primitives/LinkUserModal.js
new file mode 100644
index 000000000..930645b61
--- /dev/null
+++ b/apps/OpenSign/src/primitives/LinkUserModal.js
@@ -0,0 +1,47 @@
+import React from "react";
+import SelectSigners from "./SelectSigners";
+import AddUser from "./AddUser";
+import ModalUi from "./ModalUi";
+
+const LinkUserModal = (props) => {
+ return (
+ <ModalUi
+ title={"Add/Choose Signer"}
+ isOpen={props.isAddUser[props.uniqueId]}
+ handleClose={props.closePopup}
+ >
+ <SelectSigners
+ details={props.handleAddUser}
+ closePopup={props.closePopup}
+ />
+ <div
+ style={{
+ display: "flex",
+ alignItems: "center",
+ gap: 5,
+ margin: "0 30%",
+ color: "#808080"
+ }}
+ >
+ <span
+ style={{
+ height: 1,
+ width: "100%",
+ backgroundColor: "#ccc"
+ }}
+ ></span>
+ <span>or</span>
+ <span
+ style={{
+ height: 1,
+ width: "100%",
+ backgroundColor: "#ccc"
+ }}
+ ></span>
+ </div>
+ <AddUser details={props.handleAddUser} closePopup={props.closePopup} />
+ </ModalUi>
+ );
+};
+
+export default LinkUserModal;
diff --git a/apps/OpenSign/src/primitives/ModalUi.js b/apps/OpenSign/src/primitives/ModalUi.js
index a00a28b61..7a7ef9aca 100644
--- a/apps/OpenSign/src/primitives/ModalUi.js
+++ b/apps/OpenSign/src/primitives/ModalUi.js
@@ -1,4 +1,5 @@
import React from "react";
+
const ModalUi = ({
children,
title,
@@ -6,13 +7,20 @@ const ModalUi = ({
headColor,
handleClose,
showHeader = true,
- showClose = true
+ showClose = true,
+ styleClass
}) => {
return (
<>
{isOpen && (
<div className="fixed z-[999] top-0 left-0 w-[100%] h-[100%] bg-black bg-opacity-[75%]">
- <div className="fixed z-[1000] top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-sm bg-white rounded shadow-md max-h-90 min-w-[90%] md:min-w-[500px] overflow-y-auto hide-scrollbar">
+ <div
+ className={
+ styleClass
+ ? styleClass
+ : "fixed z-[1000] top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-sm bg-white rounded shadow-md max-h-90 min-w-[90%] md:min-w-[500px] overflow-y-auto hide-scrollbar"
+ }
+ >
{showHeader && (
<div
className="flex justify-between rounded-t items-center py-[15px] px-[20px] text-white"
diff --git a/apps/OpenSign/src/primitives/Nodata.js b/apps/OpenSign/src/primitives/Nodata.js
new file mode 100644
index 000000000..eab59c261
--- /dev/null
+++ b/apps/OpenSign/src/primitives/Nodata.js
@@ -0,0 +1,18 @@
+import React from "react";
+
+function Nodata() {
+ return (
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "50vh"
+ }}
+ >
+ <span style={{ fontWeight: "bold" }}>No Data Found!</span>
+ </div>
+ );
+}
+
+export default Nodata;
diff --git a/apps/OpenSign/src/primitives/PdfDeclineModal.js b/apps/OpenSign/src/primitives/PdfDeclineModal.js
new file mode 100644
index 000000000..6d12144e3
--- /dev/null
+++ b/apps/OpenSign/src/primitives/PdfDeclineModal.js
@@ -0,0 +1,65 @@
+import React from "react";
+import "../styles/customModal.css";
+import "../styles/signature.css";
+
+function CustomModal({
+ show,
+ headMsg,
+ bodyMssg,
+ footerMessage,
+ declineDoc,
+ setIsDecline,
+ containerWH
+}) {
+ const isMobile = window.innerWidth < 767;
+ return (
+ show && (
+ <div
+ className="parentDiv"
+ style={{
+ width: containerWH && containerWH.width,
+ height: isMobile ? "100%" : containerWH && containerWH.height
+ }}
+ >
+ <div className="childDiv">
+ <div className="modalHeadDiv bg-danger">{headMsg && headMsg}</div>
+ <div className="modalBodyDIv">
+ <p className="pTagBody">{bodyMssg && bodyMssg}</p>
+ </div>
+ {footerMessage && (
+ <>
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%"
+ }}
+ ></div>
+ <div className="modalFooterDiv">
+ <button
+ style={{
+ background: "#de4337"
+ }}
+ type="button"
+ className="finishBtn"
+ onClick={() => declineDoc()}
+ >
+ Yes
+ </button>
+ <button
+ type="button"
+ className="finishBtn cancelBtn"
+ onClick={() => setIsDecline({ isDeclined: false })}
+ >
+ Close
+ </button>
+ </div>
+ </>
+ )}
+ </div>
+ </div>
+ )
+ );
+}
+
+export default CustomModal;
diff --git a/apps/OpenSign/src/primitives/SelectSigners.js b/apps/OpenSign/src/primitives/SelectSigners.js
new file mode 100644
index 000000000..c70fc8660
--- /dev/null
+++ b/apps/OpenSign/src/primitives/SelectSigners.js
@@ -0,0 +1,108 @@
+import React, { useState } from "react";
+import Parse from "parse";
+import "../styles/AddUser.css";
+import AsyncSelect from "react-select/async";
+
+const customStyles = {
+ control: (provided) => ({
+ ...provided,
+ fontSize: "13px" // Font size for the control
+ }),
+ option: (provided) => ({
+ ...provided,
+ fontSize: "13px" // Font size for the options
+ })
+};
+const SelectSigners = (props) => {
+ const [userList, setUserList] = useState([]);
+ const [selected, setSelected] = useState();
+ const [userData, setUserData] = useState({});
+ const [isError, setIsError] = useState(false);
+ const parseBaseUrl = localStorage.getItem("baseUrl");
+ const parseAppId = localStorage.getItem("parseAppId");
+ Parse.serverURL = parseBaseUrl;
+ Parse.initialize(parseAppId);
+
+ // `handleOptions` is used to set just save from quick form to selected option in dropdown
+ const handleOptions = (item) => {
+ setSelected(item);
+ const userData = userList.find((x) => x.objectId === item.value);
+ if (userData) {
+ setUserData(userData);
+ }
+ };
+ const handleAdd = () => {
+ if (userData && userData.objectId) {
+ props.details(userData);
+ if (props.closePopup) {
+ props.closePopup();
+ }
+ } else {
+ setIsError(true);
+ setTimeout(() => setIsError(false), 1000);
+ }
+ };
+
+ const loadOptions = async (inputValue) => {
+ try {
+ const currentUser = Parse.User.current();
+ const contactbook = new Parse.Query("contracts_Contactbook");
+ contactbook.equalTo(
+ "CreatedBy",
+ Parse.User.createWithoutData(currentUser.id)
+ );
+ if (inputValue.length > 1) {
+ contactbook.matches("Name", new RegExp(inputValue, "i"));
+ }
+ contactbook.notEqualTo("IsDeleted", true);
+ const contactRes = await contactbook.find();
+ if (contactRes) {
+ const res = JSON.parse(JSON.stringify(contactRes));
+ // console.log("userList ", res);
+ setUserList(res);
+ return await res.map((item) => ({
+ label: item.Email,
+ value: item.objectId
+ }));
+ }
+ } catch (error) {
+ console.log("err", error);
+ }
+ };
+
+ return (
+ <div className="addusercontainer">
+ <div className="form-wrapper">
+ <div className="form-section" style={{ marginBottom: 0 }}>
+ <label style={{ fontSize: 14, fontWeight: "700" }}>Choose User</label>
+ <AsyncSelect
+ cacheOptions
+ defaultOptions
+ value={selected}
+ loadingMessage={() => "Loading..."}
+ noOptionsMessage={() => "User not Found"}
+ loadOptions={loadOptions}
+ onChange={handleOptions}
+ styles={customStyles}
+ />
+ </div>
+ {isError ? (
+ <p style={{ color: "red", fontSize: "12px", margin: "5px" }}>
+ Please select signer
+ </p>
+ ) : (
+ <p style={{ color: "transparent", fontSize: "12px", margin: "5px" }}>
+ .
+ </p>
+ )}
+ <div>
+ <button className="submitbutton" onClick={() => handleAdd()}>
+ Submit
+ </button>
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export default SelectSigners;
diff --git a/apps/OpenSign/src/primitives/TourContentWithBtn.js b/apps/OpenSign/src/primitives/TourContentWithBtn.js
new file mode 100644
index 000000000..f83a9e308
--- /dev/null
+++ b/apps/OpenSign/src/primitives/TourContentWithBtn.js
@@ -0,0 +1,34 @@
+import React, { useState } from "react";
+
+export default function TourContentWithBtn({ message, isChecked }) {
+ const [isCheck, setIsCheck] = useState(false);
+
+ const handleCheck = () => {
+ setIsCheck(!isCheck);
+ if (isChecked) {
+ isChecked(!isCheck);
+ }
+ };
+ return (
+ <div>
+ <p>{message}</p>
+ <label
+ style={{
+ textAlign: "center",
+ display: "flex",
+ justifyContent: "center"
+ }}
+ >
+ <input
+ type="checkbox"
+ style={{ marginRight: 3 }}
+ checked={isCheck}
+ onChange={handleCheck}
+ />{" "}
+ <span style={{ color: "#787878", fontSize: 12 }}>
+ Don&apos;t show this again
+ </span>
+ </label>
+ </div>
+ );
+}
diff --git a/apps/OpenSign/src/routes/DebugPdf.js b/apps/OpenSign/src/routes/DebugPdf.js
new file mode 100644
index 000000000..a56323e69
--- /dev/null
+++ b/apps/OpenSign/src/routes/DebugPdf.js
@@ -0,0 +1,429 @@
+import React, { useEffect, useState } from "react";
+import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
+import "../styles/signature.css";
+import "../styles/AddUser.css";
+import Title from "../components/Title";
+import RenderDebugPdf from "../components/RenderDebugPdf";
+import { pdfjs } from "react-pdf";
+import ModalUi from "../primitives/ModalUi";
+import Alert from "../primitives/Alert";
+import HandleError from "../primitives/HandleError";
+import { useWindowSize } from "../hook/useWindowSize";
+
+function processDimensions(x, y, width, height) {
+ if (width < 0) {
+ x -= Math.abs(width);
+ width = Math.abs(width);
+ }
+
+ if (height < 0) {
+ y -= Math.abs(height);
+ height = Math.abs(height);
+ }
+
+ return {
+ x: Math.floor(x),
+ y: Math.floor(y),
+ width: Math.floor(width),
+ height: Math.floor(height)
+ };
+}
+const DebugPdf = () => {
+ const { width } = useWindowSize();
+ const [pdf, setPdf] = useState("");
+ const [isModal, setIsModal] = useState(true);
+ const [allPages, setAllPages] = useState(null);
+ const [pageNumber, setPageNumber] = useState(1);
+ const [pdfLoadFail, setPdfLoadFail] = useState({
+ status: false,
+ type: "load"
+ });
+ const [pdfDetails, setPdfDetails] = useState({
+ name: "",
+ pdftype: "",
+ totalPages: "",
+ currentPage: 1,
+ x: 0,
+ y: 0,
+ base64: ""
+ });
+ const [hoverCoordinates, setHoverCoordinates] = useState({ x: 0, y: 0 });
+ const [pdfDimension, setPdfDimension] = useState({ width: 0, height: 0 });
+ const [annotations, setAnnotations] = useState([]);
+ const [newAnnotation, setNewAnnotation] = useState([]);
+ const [copied, setCopied] = useState(false);
+
+ useEffect(() => {
+ if (pdf && pdf.name) {
+ const fetchPdfMetadata = async () => {
+ try {
+ const pdfDataURL = URL.createObjectURL(pdf); // Convert File to data URL
+ console.log("pdfDataURL ", pdfDataURL);
+ const pdfInfo = await pdfjs.getDocument({ url: pdfDataURL }).promise;
+ const pdfType = await inferPdfType(pdfInfo);
+ setPdfDetails((prevDetails) => ({
+ ...prevDetails,
+ pdftype: pdfType
+ }));
+ } catch (error) {
+ console.error("Error fetching PDF metadata:", error);
+ }
+ };
+
+ fetchPdfMetadata();
+ }
+ }, [pdf]);
+
+ const inferPdfType = async (pdf) => {
+ try {
+ const firstPage = await pdf.getPage(1);
+ const scale = 1;
+ const { width, height } = firstPage.getViewport({ scale });
+ setPdfDimension({ width: width, height: height });
+
+ // Assuming a standard DPI of 72, you can adjust this value if needed
+ const dpi = 72;
+
+ const widthInInches = width / dpi;
+ const heightInInches = height / dpi;
+
+ const isA1 = widthInInches > 23.39 && heightInInches > 16.54;
+ const isA2 = widthInInches > 16.54 && heightInInches > 11.69;
+ const isA3 = widthInInches > 11.69 && heightInInches > 8.27;
+ const isA4 = widthInInches > 8.27 && heightInInches > 5.83;
+ const isLegal = widthInInches > 8.5 && heightInInches > 14;
+ const isLetter = widthInInches > 8.5 && heightInInches > 11;
+ const isLedger = widthInInches > 11 && heightInInches > 17;
+
+ if (isA1) return "A1";
+ if (isA2) return "A2";
+ if (isA3) return "A3";
+ if (isA4) return "A4";
+ if (isLegal) return "Legal";
+ if (isLetter) return "Letter";
+ if (isLedger) return "Ledger";
+
+ return "Unknown";
+ } catch (error) {
+ console.error("Error getting page dimensions:", error);
+ return "Unknown";
+ }
+ };
+
+ const handleSubmit = (e) => {
+ e.preventDefault();
+ setIsModal(false);
+ setPdfDetails((prevData) => ({ ...prevData, name: pdf?.name }));
+ };
+
+ //function for get pdf page details
+ const pageDetails = async ({ numPages }) => {
+ const load = {
+ status: true
+ };
+ setPdfDetails((prevDetails) => ({ ...prevDetails, totalPages: numPages }));
+ setPdfLoadFail(load);
+ };
+
+ const handleMouseMoveDiv = (event) => {
+ setHoverCoordinates({
+ x: event.nativeEvent.offsetX,
+ y: event.nativeEvent.offsetY
+ });
+ };
+ const handleMouseDown = (event) => {
+ if (newAnnotation.length === 0) {
+ const { x, y } = event.target.getStage().getPointerPosition();
+ setNewAnnotation([
+ { x, y, width: 0, height: 0, key: "0", page: pageNumber }
+ ]);
+ }
+ };
+
+ const handleMouseUp = (event) => {
+ if (newAnnotation.length === 1) {
+ const sx = newAnnotation[0].x;
+ const sy = newAnnotation[0].y;
+ const { x, y } = event.target.getStage().getPointerPosition();
+ const result = processDimensions(sx, sy, x - sx, y - sy);
+ const annotationToAdd = {
+ ...result,
+ key: annotations.length + 1,
+ page: pageNumber
+ };
+ annotations.push(annotationToAdd);
+ setNewAnnotation([]);
+ setAnnotations(annotations);
+ setPdfDetails((prevDetails) => ({
+ ...prevDetails,
+ x: result.x,
+ y: result.y
+ }));
+ }
+ };
+
+ const handleMouseMove = (event) => {
+ if (newAnnotation.length === 1) {
+ const sx = newAnnotation[0].x;
+ const sy = newAnnotation[0].y;
+ const { x, y } = event.target.getStage().getPointerPosition();
+ setNewAnnotation([
+ {
+ x: sx,
+ y: sy,
+ width: x - sx,
+ height: y - sy,
+ page: pageNumber,
+ key: "0"
+ }
+ ]);
+ }
+ };
+
+ const annotationsToDraw = [...annotations, ...newAnnotation];
+
+ const handlePageLoadSuccess = (page) => {
+ setPdfDetails((prevDetails) => ({
+ ...prevDetails,
+ currentPage: page.pageNumber
+ }));
+ };
+
+ const copytoclipboard = (text) => {
+ navigator.clipboard.writeText(text);
+ setCopied(true);
+ setTimeout(() => {
+ setCopied(false);
+ }, 1500); // Reset copied state after 1.5 seconds
+ };
+ const handleFileChange = (files) => {
+ const file = files[0];
+ setPdf(file);
+
+ if (file && file.type === "application/pdf") {
+ const reader = new FileReader();
+
+ reader.onloadend = () => {
+ const base64String = reader.result.split(",")[1];
+ setPdfDetails((prevdata) => ({ ...prevdata, base64: base64String }));
+ };
+
+ reader.readAsDataURL(file);
+ }
+ };
+ const handleDelete = (key) => {
+ const updateAnnotations = annotations.filter((x) => x.key !== key);
+ setAnnotations(updateAnnotations);
+ };
+ return (
+ <div>
+ {copied && <Alert type="success">Copied</Alert>}
+ <Title title={"Debug Pdf"} />
+ {width < 800 ? (
+ <HandleError handleError={"Debug PDF only availble for PC"} />
+ ) : (
+ <>
+ {!isModal && (
+ <div className="signatureContainer">
+ {/* this component used to render all pdf pages in left side */}
+ <RenderAllPdfPage
+ signPdfUrl={pdf}
+ allPages={allPages}
+ setAllPages={setAllPages}
+ setPageNumber={setPageNumber}
+ pageNumber={pageNumber}
+ />
+ {/* pdf render view */}
+ <div>
+ <div data-tut="reactourThird">
+ <RenderDebugPdf
+ pdfUrl={pdf}
+ pageDetails={pageDetails}
+ pageNumber={pageNumber}
+ setPdfLoadFail={setPdfLoadFail}
+ pdfLoadFail={pdfLoadFail}
+ handlePageLoadSuccess={handlePageLoadSuccess}
+ handleMouseMove={handleMouseMove}
+ handleMouseUp={handleMouseUp}
+ handleMouseDown={handleMouseDown}
+ hoverCoordinates={hoverCoordinates}
+ annotations={annotationsToDraw}
+ pdfDimension={pdfDimension}
+ handleMouseMoveDiv={handleMouseMoveDiv}
+ />
+ </div>
+ </div>
+ <div style={{ backgroundColor: "white", width: 220 }}>
+ <div
+ style={{
+ fontSize: 18,
+ fontWeight: 500,
+ padding: "10px 12px",
+ borderBottom: "1px solid grey"
+ }}
+ >
+ PDF details
+ </div>
+ <div style={{ fontSize: 14, padding: "5px 12px" }}>
+ Name: {pdfDetails?.name}
+ </div>
+ <div style={{ fontSize: 14, padding: "5px 12px" }}>
+ Pdf type: {pdfDetails?.pdftype}
+ </div>
+ <div style={{ fontSize: 14, padding: "5px 12px" }}>
+ Total Pages: {pdfDetails?.totalPages}
+ </div>
+ <div style={{ fontSize: 14, padding: "5px 12px" }}>
+ Current Page: {pdfDetails?.currentPage}
+ </div>
+ <div style={{ fontSize: 14, padding: "5px 12px" }}>
+ Base64 : {pdfDetails?.base64.slice(0, 10)}...
+ <span
+ style={{
+ borderRadius: 4,
+ padding: "3px 5px",
+ border: "1px solid gray",
+ fontSize: 12,
+ margin: 2,
+ cursor: "pointer"
+ }}
+ onClick={() => copytoclipboard(pdfDetails?.base64)}
+ >
+ <i className="fa-solid fa-copy"></i>
+ </span>
+ </div>
+ <div
+ style={{
+ fontSize: 18,
+ fontWeight: 500,
+ padding: "10px 12px",
+ borderBottom: "1px solid grey"
+ }}
+ >
+ Last click
+ </div>
+ <div style={{ fontSize: 14, padding: "5px 12px" }}>
+ x co-ordinate: {pdfDetails?.x}
+ </div>
+ <div style={{ fontSize: 14, padding: "5px 12px" }}>
+ y co-ordinate: {pdfDetails?.y}
+ </div>
+
+ <div
+ style={{
+ fontSize: 18,
+ fontWeight: 500,
+ padding: "10px 12px",
+ borderBottom: "1px solid grey",
+ borderTop: "1px solid grey"
+ }}
+ >
+ Annotation
+ </div>
+ <ul
+ style={{
+ listStyle: "none",
+ padding: 10,
+ height: 500,
+ overflowY: "auto",
+ scrollbarWidth: 5
+ }}
+ >
+ {annotations.map((coord, index) => (
+ <li key={index}>
+ <span style={{ fontSize: 13, fontWeight: 500 }}>{`Box ${
+ index + 1
+ }:`}</span>
+ <code
+ style={{
+ fontSize: 12,
+ color: "black",
+ cursor: "pointer"
+ }}
+ >
+ {` ["page":${coord?.page}, "x": ${coord.x}, "y": ${coord.y}, "w": ${coord.width}, "h": ${coord.height}]`}
+ </code>
+ <div>
+ <span
+ style={{
+ borderRadius: 4,
+ padding: "3px 5px",
+ border: "1px solid gray",
+ fontSize: 12,
+ margin: 2,
+ cursor: "pointer"
+ }}
+ onClick={() =>
+ copytoclipboard(
+ `"page":${coord?.page}, "x": ${coord.x}, "y": ${coord.y}, "w": ${coord.width}, "h": ${coord.height}`
+ )
+ }
+ >
+ <i className="fa-solid fa-copy"></i>
+ </span>
+ <span
+ style={{
+ borderRadius: 4,
+ padding: "3px 5px",
+ border: "1px solid gray",
+ fontSize: 12,
+ margin: 2,
+ cursor: "pointer"
+ }}
+ onClick={() => handleDelete(coord.key)}
+ >
+ <i className="fa-solid fa-trash-can"></i>
+ </span>
+ </div>
+ </li>
+ ))}
+ </ul>
+ </div>
+ </div>
+ )}
+ <ModalUi title={"Select PDF"} isOpen={isModal}>
+ <form onSubmit={handleSubmit} style={{ margin: "10px" }}>
+ <input
+ type="file"
+ onChange={(e) => handleFileChange(e.target.files)}
+ style={{
+ width: "100%",
+ border: "1px solid grey",
+ borderRadius: "4px",
+ padding: "5px",
+ fontSize: 12
+ }}
+ accept=".pdf"
+ required
+ />
+ <div
+ style={{ borderTop: "1px solid grey", margin: "10px 0" }}
+ ></div>
+ <button
+ style={{
+ background: "#32a3ac",
+ borderRadius: "2px",
+ boxShadow:
+ "0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18)",
+ border: "none",
+ textTransform: "uppercase",
+ fontSize: "13px",
+ fontWeight: "600",
+ padding: "0.375rem 0.75rem",
+ textAlign: "center",
+ color: "#ffffff",
+ outline: "none"
+ }}
+ type="submit"
+ >
+ Submit
+ </button>
+ </form>
+ </ModalUi>
+ </>
+ )}
+ </div>
+ );
+};
+
+export default DebugPdf;
diff --git a/apps/OpenSign/src/routes/Form.js b/apps/OpenSign/src/routes/Form.js
index d6c30fc35..563e7f413 100644
--- a/apps/OpenSign/src/routes/Form.js
+++ b/apps/OpenSign/src/routes/Form.js
@@ -74,8 +74,11 @@ const Forms = (props) => {
};
const handleFileUpload = async (file) => {
- Parse.serverURL = process.env.REACT_APP_SERVERURL;
- Parse.initialize(process.env.REACT_APP_APPID);
+ const url = process.env.REACT_APP_SERVERURL
+ ? process.env.REACT_APP_SERVERURL
+ : window.location.origin + "/api/app";
+ Parse.serverURL = url;
+ Parse.initialize("opensign");
setfileload(true);
const fileName = file.name;
const name = sanitizeFileName(fileName);
@@ -195,9 +198,7 @@ const Forms = (props) => {
});
setFileUpload([]);
setpercentage(0);
- navigate(
- `/asmf/remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/${props?.redirectRoute}/${res.id}`
- );
+ navigate(`/${props?.redirectRoute}/${res.id}`);
}
} catch (err) {
console.log("err ", err);
@@ -280,7 +281,8 @@ const Forms = (props) => {
<div className="flex gap-2 justify-center items-center">
<div className="flex justify-between items-center px-2 py-2 w-full font-bold rounded border-[1px] border-[#ccc] text-gray-500 bg-white text-[13px]">
<div className="break-all">
- file selected : {fileupload?.split("/")?.pop()?.split("_")[1]}
+ file selected :{" "}
+ {fileupload?.split("/")?.pop()?.split("_")[1]}
</div>
<div
onClick={() => {
diff --git a/apps/OpenSign/src/routes/GuestLogin.js b/apps/OpenSign/src/routes/GuestLogin.js
new file mode 100644
index 000000000..5b7d3e331
--- /dev/null
+++ b/apps/OpenSign/src/routes/GuestLogin.js
@@ -0,0 +1,281 @@
+import React, { useState, useEffect } from "react";
+import { useNavigate, useParams } from "react-router-dom";
+import "../styles/loginPage.css";
+import loader from "../assets/images/loader2.gif";
+import axios from "axios";
+import { themeColor } from "../constant/const";
+
+function GuestLogin() {
+ const { id, userMail, contactBookId, serverUrl } = useParams();
+ let navigate = useNavigate();
+ const [email, setEmail] = useState(userMail);
+ const [OTP, setOTP] = useState("");
+ const [EnterOTP, setEnterOtp] = useState(false);
+ const [loading, setLoading] = useState(false);
+ const [isLoading, setIsLoading] = useState(true);
+
+ useEffect(() => {
+ handleServerUrl();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ //function generate serverUrl and parseAppId from url and save it in local storage
+ const handleServerUrl = () => {
+ //split url in array from '&'
+ localStorage.clear();
+ const checkSplit = serverUrl.split("&");
+ const server = checkSplit[0];
+ const parseId = checkSplit[1];
+ const appName = checkSplit[2];
+
+ const newServer = server.replaceAll("%2F", "/");
+ localStorage.setItem("baseUrl", newServer);
+ localStorage.setItem("parseAppId", parseId);
+ localStorage.setItem("_appName", appName);
+ setIsLoading(false);
+ };
+
+ const handleChange = (event) => {
+ const { value } = event.target;
+ setOTP(value);
+ };
+
+ //send email OTP function
+ const SendOtp = async (e) => {
+ const serverUrl =
+ localStorage.getItem("baseUrl") && localStorage.getItem("baseUrl");
+ const parseId =
+ localStorage.getItem("parseAppId") && localStorage.getItem("parseAppId");
+ if (serverUrl && localStorage) {
+ setLoading(true);
+ e.preventDefault();
+ setEmail(email);
+
+ try {
+ let url = `${serverUrl}functions/SendOTPMailV1/`;
+ const headers = {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": parseId
+ };
+ let body = {
+ email: email.toString()
+ };
+ let Otp = await axios.post(url, body, { headers: headers });
+
+ if (Otp) {
+ setLoading(false);
+ setEnterOtp(true);
+ }
+ } catch (error) {
+ alert("something went wrong!");
+ }
+ } else {
+ alert("something went wrong!");
+ }
+ };
+
+ //verify OTP send on via email
+ const VerifyOTP = async (e) => {
+ e.preventDefault();
+ const serverUrl =
+ localStorage.getItem("baseUrl") && localStorage.getItem("baseUrl");
+ const parseId =
+ localStorage.getItem("parseAppId") && localStorage.getItem("parseAppId");
+ if (OTP) {
+ setLoading(true);
+ try {
+ let url = `${serverUrl}functions/AuthLoginAsMail/`;
+ const headers = {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": parseId
+ };
+ let body = {
+ email: email,
+ otp: OTP
+ };
+ let user = await axios.post(url, body, { headers: headers });
+ if (user.data.result === "Invalid Otp") {
+ alert("Invalid Otp");
+ setLoading(false);
+ } else if (user.data.result === "user not found!") {
+ alert("User not found!");
+ setLoading(false);
+ } else {
+ let _user = user.data.result;
+ const parseId = localStorage.getItem("parseAppId");
+ localStorage.setItem("UserInformation", JSON.stringify(_user));
+ localStorage.setItem(
+ `Parse/${parseId}/currentUser`,
+ JSON.stringify(_user)
+ );
+ localStorage.setItem("username", _user.name);
+ localStorage.setItem("accesstoken", _user.sessionToken);
+ //save isGuestSigner true in local to handle login flow header in mobile view
+ localStorage.setItem("isGuestSigner", true);
+ setLoading(false);
+ navigate(`/load/recipientSignPdf/${id}/${contactBookId}`);
+ }
+ } catch (error) {
+ console.log("err ", error);
+ }
+ } else {
+ alert("Please Enter OTP!");
+ }
+ };
+
+ return (
+ <div style={{ padding: "2rem" }}>
+ {isLoading ? (
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100vh",
+ flexDirection: "column"
+ }}
+ >
+ <img
+ alt="no img"
+ src={loader}
+ style={{ width: "80px", height: "80px" }}
+ />
+ <span style={{ fontSize: "13px", color: "gray" }}>
+ {isLoading.message}
+ </span>
+ </div>
+ ) : (
+ <div
+ style={{
+ margin: "10px",
+ border: "0.5px solid #c5c7c9",
+ padding: "30px",
+ boxShadow: "rgba(99, 99, 99, 0.2) 0px 2px 8px 0px"
+ }}
+ >
+ <div className="main_head">
+ <div className="main-logo">
+ <img
+ alt="sign img"
+ src="https://qikinnovation.ams3.digitaloceanspaces.com/logo.png"
+ width="100%"
+ />
+ </div>
+ </div>
+
+ {!EnterOTP ? (
+ <div className="row">
+ <div className="col-sm-6 KLO">
+ <span className="welcomeText">Welcome Back !</span>
+ <br />
+ <span className="KNLO">
+ Verification code is sent to your email
+ </span>
+ <div className="card card-box" style={{ borderRadius: "0px" }}>
+ <div className="card-body">
+ <input
+ type="email"
+ name="mobile"
+ value={email}
+ disabled
+ className="loginInput"
+ />
+ <br />
+ </div>
+ </div>
+ <div className="btnContainer">
+ {loading ? (
+ <button
+ type="button"
+ style={{
+ background: themeColor,
+ color: "white"
+ }}
+ className="verifyBtn"
+ disabled
+ >
+ <span
+ className="spinner-border spinner-border-sm "
+ role="status"
+ aria-hidden="true"
+ ></span>
+ Loading...
+ </button>
+ ) : (
+ <button
+ className="verifyBtn"
+ style={{
+ background: themeColor,
+ color: "white",
+ marginLeft: "0px !important"
+ }}
+ onClick={(e) => SendOtp(e)}
+ >
+ Send OTP
+ </button>
+ )}
+ </div>
+ </div>
+ </div>
+ ) : (
+ <div className="row">
+ <div className="col-sm-6 KLO">
+ <span className="welcomeText">Welcome Back !</span>
+ <br />
+ <span className="KNLO">You will get a OTP via Email</span>
+ <div className="card card-box">
+ <div className="card-body">
+ <label>Enter Verification Code</label>
+ <input
+ type="number"
+ className="loginInput"
+ name="OTP"
+ value={OTP}
+ onChange={handleChange}
+ />
+
+ <br />
+ </div>
+ </div>
+ <div>
+ {loading ? (
+ <button
+ style={{
+ background: themeColor,
+ color: "white"
+ }}
+ className="verifyBtn"
+ type="button"
+ disabled
+ >
+ <span
+ className="spinner-border spinner-border-sm "
+ role="status"
+ aria-hidden="true"
+ ></span>
+ Loading...
+ </button>
+ ) : (
+ <button
+ type="button"
+ onClick={(e) => VerifyOTP(e)}
+ style={{
+ background: themeColor,
+ color: "white"
+ }}
+ className="verifyBtn"
+ >
+ Verify
+ </button>
+ )}
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ )}
+ </div>
+ );
+}
+
+export default GuestLogin;
diff --git a/apps/OpenSign/src/routes/LoadMf.js b/apps/OpenSign/src/routes/LoadMf.js
deleted file mode 100644
index aac217d98..000000000
--- a/apps/OpenSign/src/routes/LoadMf.js
+++ /dev/null
@@ -1,84 +0,0 @@
-import { Suspense } from "react";
-import { useParams } from "react-router-dom";
-import useFederatedComponent from "mf-cra";
-import React from "react";
-import Title from "../components/Title";
-function RemoteApp({ app }) {
- // console.log("app ", app);
- const { Component: RemoteComponent } = useFederatedComponent(app);
- // console.log("RemoteComponent ", RemoteComponent);
- return (
- <>
- <Title title={app.remoteName} />
- <Suspense
- fallback={
- <div style={{ height: "300px" }}>
- <div
- style={{
- marginLeft: "45%",
- marginTop: "150px",
- fontSize: "45px",
- color: "#3dd3e0"
- }}
- className="loader-37"
- ></div>
- </div>
- }
- >
- <div
- style={{
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.33)",
- backgroundColor: "#ffffff",
- width: "100%",
- borderRadius: 3,
- height: "100%",
- minHeight: "100vh"
- }}
- >
- {RemoteComponent && <RemoteComponent />}
- </div>
- </Suspense>
- </>
- );
-}
-function checkObjectProperties(obj) {
- // Check if all three properties exist in the object
- if (
- obj &&
- obj.remoteName !== undefined &&
- obj.remoteUrl !== undefined &&
- obj.moduleToLoad !== undefined
- ) {
- return true; // All properties are present
- } else {
- return false; // At least one property is missing
- }
-}
-export default function RemoteAppContainer() {
- const { remoteApp } = useParams();
-
- const obj = {
- remoteUrl: window.location.origin + "/mfbuild/remoteEntry.js",
- moduleToLoad: "./AppRoutes",
- remoteName: remoteApp
- };
- // console.log("obj ", obj);
- const isMf = checkObjectProperties(obj);
- if (isMf) {
- const appToLoad = obj;
- return <RemoteApp app={appToLoad} />;
- } else {
- return (
- <div className="flex items-center justify-center h-screen w-full bg-white rounded">
- <div className="text-center">
- <h1 className="text-[60px] lg:text-[120px] font-semibold text-black">
- 404
- </h1>
- <p className="text-[30px] lg:text-[50px] text-black">
- Page Not Found
- </p>
- </div>
- </div>
- );
- }
-}
diff --git a/apps/OpenSign/src/routes/Managesign.js b/apps/OpenSign/src/routes/Managesign.js
new file mode 100644
index 000000000..e4cd4ee0f
--- /dev/null
+++ b/apps/OpenSign/src/routes/Managesign.js
@@ -0,0 +1,690 @@
+import React, { useState, useRef, useEffect } from "react";
+import SignatureCanvas from "react-signature-canvas";
+import redPen from "../assets/images/redPen.png";
+import bluePen from "../assets/images/bluePen.png";
+import blackPen from "../assets/images/blackPen.png";
+import "../styles/managesign.css";
+import "../styles/signature.css";
+import axios from "axios";
+import { toDataUrl } from "../constant/Utils";
+
+const ManageSign = () => {
+ let appName;
+ const [penColor, setPenColor] = useState("blue");
+ const [initialPen, setInitialPen] = useState("blue");
+ const [image, setImage] = useState();
+ const [signName, setSignName] = useState("");
+ const [signature, setSignature] = useState("");
+ const [warning, setWarning] = useState(false);
+ const [nameWarning, setNameWarning] = useState(false);
+ const [isvalue, setIsValue] = useState(false);
+ const allColor = [bluePen, redPen, blackPen];
+ const [isLoader, setIsLoader] = useState(true);
+ const [isSuccess, setIsSuccess] = useState(false);
+ const [Initials, setInitials] = useState("");
+ const [isInitials, setIsInitials] = useState(false);
+ const [id, setId] = useState("");
+ const canvasRef = useRef(null);
+ const imageRef = useRef(null);
+ const initailsRef = useRef(null);
+ useEffect(() => {
+ getLocalStorageValue();
+ // eslint-disable-next-line
+ }, []);
+ //function for get localstorage value first and than call another function.
+ const getLocalStorageValue = () => {
+ let User = JSON.parse(
+ localStorage.getItem(
+ "Parse/" + localStorage.getItem("parseAppId") + "/currentUser"
+ )
+ );
+ appName =
+ localStorage.getItem("_appName") && localStorage.getItem("_appName");
+ if (User) {
+ fetchUserSign(User);
+ }
+ };
+
+ const fetchUserSign = async (User) => {
+ const userId = {
+ __type: "Pointer",
+ className: "_User",
+ objectId: User.objectId
+ };
+ const strObj = JSON.stringify(userId);
+ const url =
+ localStorage.getItem("baseUrl") +
+ `classes/${appName}_Signature?where={"UserId":${strObj}}&limit=1`;
+
+ const headers = {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId")
+ // "X-Parse-Session-Token": localStorage.getItem("accesstoken"),
+ };
+ const res = await axios
+ .get(url, { headers: headers })
+ .then((res) => {
+ if (res.data.results.length > 0) {
+ setId(res.data.results[0].objectId);
+ setSignName(res.data.results[0].SignatureName);
+ setImage(res.data.results[0].ImageURL);
+ if (res.data.results[0] && res.data.results[0].Initials) {
+ setInitials(res.data.results[0].Initials);
+ setIsInitials(true);
+ }
+ }
+ setIsLoader(false);
+ return res;
+ })
+ .catch((error) => {
+ console.log(error);
+ alert(`${error.message}`);
+ });
+ return res;
+ };
+ const handleSignatureChange = () => {
+ if (imageRef.current) {
+ imageRef.current.value = "";
+ }
+ setImage("");
+ setSignature(canvasRef.current.toDataURL());
+ setIsValue(true);
+ };
+ const handleClear = () => {
+ if (canvasRef.current) {
+ canvasRef.current.clear();
+ }
+ if (imageRef.current) {
+ imageRef.current.value = "";
+ }
+ setImage("");
+ setSignature("");
+ setIsValue(false);
+ };
+
+ const handleClearInitials = () => {
+ if (initailsRef.current) {
+ initailsRef.current.clear();
+ }
+ setInitials("");
+ setIsValue(true);
+ setIsInitials(false);
+ };
+
+ // const handleReset = () => {
+ // if (canvasRef.current) {
+ // canvasRef.current.clear();
+ // }
+ // if (imageRef.current) {
+ // imageRef.current.value = "";
+ // }
+ // setImage("");
+ // setSignature("");
+ // setIsValue(false);
+ // setSignName("");
+ // };
+ const onImageChange = async (event) => {
+ if (canvasRef.current) {
+ canvasRef.current.clear();
+ }
+ setSignature("");
+ if (event.target.files && event.target.files[0]) {
+ const file = event.target.files[0];
+ const base64Img = await toDataUrl(file);
+ setImage(base64Img);
+ setIsValue(true);
+ }
+ };
+ const handleSubmit = async (e) => {
+ e.preventDefault();
+ const isUrl = image.includes("https");
+
+ if (!signName) {
+ setNameWarning(true);
+ } else if (!isvalue) {
+ setWarning(true);
+ setTimeout(() => setWarning(false), 1000);
+ } else {
+ setIsLoader(true);
+ const replaceSpace = signName.replace(/ /g, "_");
+ let file;
+ if (signature) {
+ file = base64StringtoFile(signature, `${replaceSpace}.png`);
+ } else {
+ if (!isUrl) {
+ file = base64StringtoFile(image, `${replaceSpace}.png`);
+ }
+ }
+ // console.log("isUrl ", isUrl);
+ let imgUrl;
+ if (!isUrl) {
+ imgUrl = await uploadFile(file);
+ } else {
+ imgUrl = { data: { imageUrl: image } };
+ }
+ let initialsUrl = "";
+ if (Initials) {
+ const initialsImg = base64StringtoFile(Initials, `${replaceSpace}.png`);
+ initialsUrl = await uploadFile(initialsImg);
+ }
+ if (imgUrl.data && imgUrl.data.imageUrl) {
+ await saveEntry({
+ name: signName,
+ url: imgUrl.data.imageUrl,
+ initialsUrl: initialsUrl
+ });
+ }
+ }
+ };
+ function base64StringtoFile(base64String, filename) {
+ var arr = base64String.split(","),
+ mime = arr[0].match(/:(.*?);/)[1],
+ bstr = atob(arr[1]),
+ n = bstr.length,
+ u8arr = new Uint8Array(n);
+ while (n--) {
+ u8arr[n] = bstr.charCodeAt(n);
+ }
+ return new File([u8arr], filename, { type: mime });
+ }
+
+ const uploadFile = async (file) => {
+ let parseBaseUrl = localStorage.getItem("baseUrl");
+ parseBaseUrl = parseBaseUrl.slice(0, -4);
+ const url = parseBaseUrl + `file_upload`;
+ const formData = new FormData();
+ formData.append("file", file);
+ const config = {
+ headers: {
+ "content-type": "multipart/form-data",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId")
+ }
+ };
+ const response = await axios
+ .post(url, formData, config)
+ .then((res) => {
+ if (res.data.status === "Error") {
+ alert(res.data.message);
+ }
+ return res;
+ })
+ .catch((error) => {
+ console.log(error);
+ setIsLoader(false);
+ alert(`${error.message}`);
+ });
+ return response;
+ };
+
+ const saveEntry = async (obj) => {
+ if (id) {
+ const User = JSON.parse(
+ localStorage.getItem(
+ "Parse/" + localStorage.getItem("parseAppId") + "/currentUser"
+ )
+ );
+ const url =
+ localStorage.getItem("baseUrl") +
+ `classes/${localStorage.getItem("_appName")}_Signature/${id}`;
+ const body = {
+ Initials: obj.initialsUrl ? obj.initialsUrl.data.imageUrl : "",
+ ImageURL: obj.url,
+ SignatureName: obj.name,
+ UserId: {
+ __type: "Pointer",
+ className: "_User",
+ objectId: User.objectId
+ }
+ };
+ const headers = {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId")
+ // "X-Parse-Session-Token": localStorage.getItem("accesstoken"),
+ };
+ const res = await axios
+ .put(url, body, { headers: headers })
+ .then((res) => {
+ // handleReset();
+ setIsLoader(false);
+ setIsSuccess(true);
+ return res;
+ })
+ .catch((error) => {
+ console.log(error);
+ setIsLoader(false);
+ alert(`${error.message}`);
+ });
+ return res;
+ } else {
+ const User = JSON.parse(
+ localStorage.getItem(
+ "Parse/" + localStorage.getItem("parseAppId") + "/currentUser"
+ )
+ );
+ const url =
+ localStorage.getItem("baseUrl") +
+ `classes/${localStorage.getItem("_appName")}_Signature`;
+ const body = {
+ Initials: obj.initialsUrl ? obj.initialsUrl.data.imageUrl : "",
+ ImageURL: obj.url,
+ SignatureName: obj.name,
+ UserId: {
+ __type: "Pointer",
+ className: "_User",
+ objectId: User.objectId
+ }
+ };
+ const headers = {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId")
+ // "X-Parse-Session-Token": localStorage.getItem("accesstoken"),
+ };
+ const res = await axios
+ .post(url, body, { headers: headers })
+ .then((res) => {
+ // handleReset();
+ setIsLoader(false);
+ setIsSuccess(true);
+ return res;
+ })
+ .catch((error) => {
+ console.log(error);
+ setIsLoader(false);
+ alert(`${error.message}`);
+ });
+ return res;
+ }
+ };
+ const handleSignatureBtn = () => {
+ if (imageRef.current) {
+ imageRef.current.value = "";
+ }
+ setImage("");
+ };
+ const handleUploadBtn = () => {
+ imageRef.current.click();
+ };
+ const handleInitialsChange = () => {
+ setInitials(initailsRef.current.toDataURL());
+ setIsValue(true);
+ };
+ return (
+ <div
+ style={{
+ backgroundColor: "white",
+ maxHeight: "500px",
+ overflow: "auto"
+ }}
+ >
+ {isSuccess && (
+ <div
+ className="alert alert-success successBox"
+ role="alert"
+ onAnimationEnd={() => setIsSuccess(false)}
+ >
+ Signature saved successfully!
+ </div>
+ )}
+
+ <div
+ className="mainDiv"
+ style={{
+ width: "100%",
+ paddingRight: "10px"
+ }}
+ >
+ <div style={{ margin: 20 }}>
+ <div
+ style={{
+ fontWeight: "700",
+ fontSize: 15,
+ color: "#000",
+ paddingBottom: 8
+ }}
+ >
+ Manage Signature
+ </div>
+ <div style={{ display: "flex", flexDirection: "column" }}>
+ <label
+ htmlFor="signName"
+ style={{
+ fontSize: 12,
+ position: "relative",
+ paddingBottom: 5
+ }}
+ >
+ Signer&apos;s Name
+ {nameWarning && (
+ <div
+ className="warning nameWarning"
+ style={{ fontSize: 12 }}
+ onAnimationEnd={() => setNameWarning(false)}
+ >
+ <i
+ className="fas fa-exclamation-circle"
+ style={{ color: "#fab005", fontSize: 15 }}
+ ></i>{" "}
+ Please fill input field
+ </div>
+ )}
+ </label>
+ <input
+ id="signName"
+ className="signInputManage"
+ value={signName}
+ style={{
+ border: "1px solid #ccc",
+ borderRadius: 4,
+
+ height: 35,
+ padding: "6px 12px",
+ marginBottom: 10,
+ fontSize: 12
+ }}
+ required
+ onFocus={() => setNameWarning(false)}
+ onChange={(e) => setSignName(e.target.value)}
+ />
+
+ <label
+ htmlFor="imgoverview"
+ style={{
+ fontSize: 12,
+ paddingBottom: 5
+ }}
+ >
+ Signature/Image
+ </label>
+ </div>
+ <div className="signBlock">
+ <div>
+ <div style={{ position: "relative" }}>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between",
+ width: "50%",
+ paddingLeft: 10
+ }}
+ >
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-around",
+ alignItems: "center",
+ gap: 10,
+ marginBottom: 10
+ }}
+ >
+ <>
+ <span
+ onClick={() => handleSignatureBtn()}
+ className="signature"
+ >
+ Signature
+ </span>
+ </>
+
+ <span
+ onClick={() => handleUploadBtn()}
+ className="imgupload"
+ >
+ Upload Image
+ </span>
+ <input
+ type="file"
+ onChange={onImageChange}
+ className="filetype"
+ accept="image/*"
+ ref={imageRef}
+ hidden
+ />
+ </div>
+ </div>
+ <div style={{ position: "relative" }}>
+ <div>
+ {image ? (
+ <div
+ style={{
+ position: "relative",
+
+ border: "2px solid #888",
+ marginBottom: 6
+ }}
+ className="signatureCanvas"
+ >
+ <img
+ alt="preview image"
+ src={image}
+ style={{
+ width: "100%",
+ height: "100%",
+ objectFit: "contain"
+ }}
+ />
+ </div>
+ ) : (
+ <SignatureCanvas
+ ref={canvasRef}
+ penColor={penColor}
+ canvasProps={{
+ width: "456px",
+ height: "180px",
+ className: "signatureCanvas"
+ }}
+ backgroundColor="rgb(255, 255, 255)"
+ onEnd={() =>
+ handleSignatureChange(canvasRef.current.toDataURL())
+ }
+ dotSize={1}
+ />
+ )}
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between"
+ // width: 460,
+ }}
+ className="penContainerDefault"
+ >
+ <div>
+ {!image && (
+ <div
+ style={{ display: "flex", flexDirection: "row" }}
+ >
+ {allColor.map((data, key) => {
+ return (
+ <img
+ alt="black img"
+ style={{
+ border: "none",
+ margin: "5px",
+ borderBottom:
+ key === 0 && penColor === "blue"
+ ? "2px solid blue"
+ : key === 1 && penColor === "red"
+ ? "2px solid red"
+ : key === 2 && penColor === "black"
+ ? "2px solid black"
+ : "2px solid white"
+ }}
+ onClick={() => {
+ if (key === 0) {
+ setPenColor("blue");
+ } else if (key === 1) {
+ setPenColor("red");
+ } else if (key === 2) {
+ setPenColor("black");
+ }
+ }}
+ key={key}
+ src={data}
+ width={20}
+ height={20}
+ />
+ );
+ })}
+ </div>
+ )}
+ </div>
+ <div>
+ <div
+ type="button"
+ className="clearbtn"
+ onClick={() => handleClear()}
+ >
+ Clear
+ </div>
+ </div>
+ </div>
+ </div>
+ {warning && (
+ <div
+ className="warning signWarning"
+ style={{ fontSize: 12 }}
+ >
+ <i
+ className="fas fa-exclamation-circle"
+ style={{ color: "#fab005", fontSize: 15 }}
+ ></i>{" "}
+ Please upload signature/Image
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ <div style={{ position: "relative" }}>
+ <div style={{ margin: "6px 5px 18px" }}>
+ <span
+ // onClick={() => handleSignatureBtn()}
+ className="signature"
+ >
+ Initials
+ </span>
+ </div>
+ <div>
+ {isInitials ? (
+ <div
+ style={{
+ position: "relative",
+
+ border: "2px solid #888",
+ marginBottom: 6
+ }}
+ className="intialSignature"
+ >
+ <img
+ alt="preview image"
+ src={Initials}
+ style={{
+ width: "100%",
+ height: "100%",
+ objectFit: "contain"
+ }}
+ />
+ </div>
+ ) : (
+ <SignatureCanvas
+ ref={initailsRef}
+ penColor={initialPen}
+ canvasProps={{
+ className: "intialSignature"
+ }}
+ backgroundColor="rgb(255, 255, 255)"
+ onEnd={() =>
+ handleInitialsChange(initailsRef.current.toDataURL())
+ }
+ dotSize={1}
+ />
+ )}
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ justifyContent: "space-between"
+ }}
+ className="penContainerInitial"
+ >
+ <div>
+ {!isInitials && (
+ <div style={{ display: "flex", flexDirection: "row" }}>
+ {allColor.map((data, key) => {
+ return (
+ <img
+ alt="pen"
+ style={{
+ border: "none",
+ margin: "5px",
+ borderBottom:
+ key === 0 && initialPen === "blue"
+ ? "2px solid blue"
+ : key === 1 && initialPen === "red"
+ ? "2px solid red"
+ : key === 2 && initialPen === "black"
+ ? "2px solid black"
+ : "2px solid white"
+ }}
+ onClick={() => {
+ if (key === 0) {
+ setInitialPen("blue");
+ } else if (key === 1) {
+ setInitialPen("red");
+ } else if (key === 2) {
+ setInitialPen("black");
+ }
+ }}
+ key={key}
+ src={data}
+ width={20}
+ height={20}
+ />
+ );
+ })}
+ </div>
+ )}
+ </div>
+ <div>
+ <div
+ type="button"
+ className="clearbtn"
+ onClick={() => handleClearInitials()}
+ >
+ Clear
+ </div>
+ </div>
+ </div>
+ </div>
+ {/* {!warning && (
+ <div className="warning signWarning" style={{ fontSize: 12 }}>
+ <i
+ className="fas fa-exclamation-circle"
+ style={{ color: "#fab005", fontSize: 15 }}
+ ></i>{" "}
+ Please upload signature/Image
+ </div>
+ )} */}
+ </div>
+ </div>
+ <div style={{ paddingTop: 10 }}>
+ <button
+ className="customBtn successBtn"
+ onClick={(e) => handleSubmit(e)}
+ >
+ save
+ </button>
+ </div>
+ </div>
+ {isLoader && (
+ <div className="loaderContainer">
+ <div className="loader"></div>
+ </div>
+ )}
+ </div>
+ </div>
+ );
+};
+
+export default ManageSign;
diff --git a/apps/OpenSign/src/routes/Opensigndrive.js b/apps/OpenSign/src/routes/Opensigndrive.js
new file mode 100644
index 000000000..84f67e407
--- /dev/null
+++ b/apps/OpenSign/src/routes/Opensigndrive.js
@@ -0,0 +1,757 @@
+import React, { useEffect, useState, useRef } from "react";
+import "../styles/opensigndrive.css";
+import loader from "../assets/images/loader2.gif";
+import DriveBody from "../components/opensigndrive/DriveBody";
+import { themeColor, iconColor } from "../constant/const";
+import { getDrive } from "../constant/Utils";
+import { useNavigate } from "react-router-dom";
+import Title from "../components/Title";
+import Parse from "parse";
+import ModalUi from "../primitives/ModalUi";
+
+function Opensigndrive() {
+ const navigate = useNavigate();
+ const scrollRef = useRef(null);
+ const [isList, setIsList] = useState(false);
+ const [selectedSort, setSelectedSort] = useState("Date");
+ const [sortingOrder, setSortingOrder] = useState("Decending");
+ const [pdfData, setPdfData] = useState([]);
+ const [isFolder, setIsFolder] = useState(false);
+ const [newFolderName, setNewFolderName] = useState();
+ const [error, setError] = useState();
+ const [folderLoader, setIsFolderLoader] = useState(false);
+ const [isShowSort, setIsShowSort] = useState(false);
+ const [isLoading, setIsLoading] = useState({
+ isLoad: true,
+ message: "This might take some time"
+ });
+ const [docId, setDocId] = useState();
+ const [handleError, setHandleError] = useState("");
+ const [folderName, setFolderName] = useState([]);
+ const [isAlert, setIsAlert] = useState({ isShow: false, alertMessage: "" });
+ const [isNewFol, setIsNewFol] = useState(false);
+ const currentUser =
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ ) &&
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ );
+ const jsonCurrentUser = JSON.parse(currentUser);
+
+ useEffect(() => {
+ if (docId) {
+ getPdfFolderDocumentList();
+ } else {
+ getPdfDocumentList();
+ }
+ // eslint-disable-next-line
+ }, [docId]);
+
+ //function for get all pdf document list
+ const getPdfDocumentList = async () => {
+ const load = {
+ isLoad: true,
+ message: "This might take some time"
+ };
+ let driveDetails;
+ setIsLoading(load);
+ try {
+ driveDetails = await getDrive();
+ if (driveDetails) {
+ if (driveDetails.length > 0) {
+ setPdfData(driveDetails);
+ sortApps(null, null, driveDetails);
+ }
+ const data = [
+ {
+ name: "OpenSignâ„¢ Drive",
+ objectId: ""
+ }
+ ];
+ setFolderName(data);
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ } else if (driveDetails === "Error: Something went wrong!") {
+ const loadObj = {
+ isLoad: false
+ };
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ }
+ } catch (e) {
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong"
+ });
+ }
+ };
+ //function for get parent folder document list
+ const getPdfFolderDocumentList = async () => {
+ const load = {
+ isLoad: true,
+ message: "This might take some time"
+ };
+ setIsLoading(load);
+ let driveDetails;
+ try {
+ driveDetails = await getDrive(docId);
+
+ if (driveDetails) {
+ if (driveDetails.length > 0) {
+ setPdfData(driveDetails);
+ sortApps(null, null, driveDetails);
+ } else {
+ setPdfData([]);
+ }
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ } else if (driveDetails === "Error: Something went wrong!") {
+ const loadObj = {
+ isLoad: false
+ };
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ }
+ } catch (e) {
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong!"
+ });
+ }
+ };
+
+ //function for get all pdf document list
+ const getParentFolder = async () => {
+ setIsFolder(true);
+ };
+ //function for handle folder name path
+ const handleRoute = (index) => {
+ const updateFolderName = folderName.filter((x, i) => {
+ if (i <= index) {
+ return x;
+ }
+ });
+
+ setFolderName(updateFolderName);
+ const getLastId = updateFolderName[updateFolderName.length - 1];
+ setDocId(getLastId.objectId);
+ };
+
+ //function for add new folder name
+ const handleFolderName = (e) => {
+ setError();
+ const value = e.target.value;
+ setNewFolderName(value);
+ };
+ //function for create folder
+ const handleAddFolder = async () => {
+ if (newFolderName) {
+ setIsFolderLoader(true);
+ const getParentObjId = folderName[folderName.length - 1];
+ const parentId = getParentObjId && getParentObjId.objectId;
+ const foldercls = `${localStorage.getItem("_appName")}_Document`;
+ const folderPtr = {
+ __type: "Pointer",
+ className: foldercls,
+ objectId: parentId
+ };
+ const CreatedBy = {
+ __type: "Pointer",
+ className: "_User",
+ objectId: jsonCurrentUser.objectId
+ };
+
+ try {
+ const exsitQuery = new Parse.Query(foldercls);
+ exsitQuery.equalTo("Name", newFolderName);
+ exsitQuery.equalTo("Type", "Folder");
+ if (parentId) {
+ exsitQuery.equalTo("Folder", folderPtr);
+ }
+ const templExist = await exsitQuery.first();
+ if (templExist) {
+ setError("Folder already exist!");
+ setIsFolderLoader(false);
+ } else {
+ const template = new Parse.Object(foldercls);
+ template.set("Name", newFolderName);
+ template.set("Type", "Folder");
+
+ if (parentId) {
+ template.set("Folder", folderPtr);
+ }
+ template.set("CreatedBy", CreatedBy);
+ const res = await template.save();
+ if (res) {
+ const result = JSON.parse(JSON.stringify(res));
+
+ setPdfData((prev) => [...prev, result]);
+ setNewFolderName();
+ setIsFolderLoader(false);
+ setIsFolder(false);
+ }
+ }
+ } catch (e) {
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong!"
+ });
+ }
+ } else {
+ setError("Please fill out this field");
+ }
+ };
+
+ const sortingApp = (appInfo, type, order) => {
+ if (type === "Name") {
+ if (order === "Accending") {
+ return appInfo.sort((a, b) => (a.Name > b.Name ? 1 : -1));
+ } else if (order === "Decending") {
+ return appInfo.sort((a, b) => (a.Name > b.Name ? -1 : 1));
+ }
+ } else if (type === "Date") {
+ if (order === "Accending") {
+ return appInfo.sort((a, b) => (a.createdAt > b.createdAt ? 1 : -1));
+ } else if (order === "Decending") {
+ return appInfo.sort((a, b) => (a.createdAt > b.createdAt ? -1 : 1));
+ }
+ }
+ };
+
+ const sortApps = (type, order, driveDetails) => {
+ const selectedSortType = type ? type : selectedSort ? selectedSort : "Date";
+ const sortOrder = order ? order : sortingOrder ? sortingOrder : "Decending";
+
+ let sortingData = driveDetails;
+ if (selectedSortType === "Name") {
+ sortingApp(sortingData, "Name", sortOrder);
+ } else if (selectedSortType === "Date") {
+ sortingApp(sortingData, "Date", sortOrder);
+ }
+
+ setPdfData(sortingData);
+ };
+
+ //function for handle auto scroll on folder path
+ const handleMouseEnter = (e) => {
+ let side = "";
+ const container = scrollRef.current;
+ const containerRect = container.getBoundingClientRect();
+ const cursorX = e.clientX;
+ const containerX = containerRect.left;
+ const containerWidth = containerRect.width;
+
+ // Define a threshold (e.g., 10 pixels) for the start and end points
+ const threshold = 10;
+
+ if (cursorX - containerX <= threshold) {
+ side = "start";
+ } else if (containerX + containerWidth - cursorX <= threshold) {
+ side = "end";
+ } else {
+ side = "";
+ }
+
+ const scrollSpeed = 10;
+ let scrollAmount = 0;
+
+ const scroll = () => {
+ if (side === "start" && container.scrollLeft > 0) {
+ container.scrollLeft -= scrollAmount;
+ requestAnimationFrame(scroll);
+ } else if (
+ side === "end" &&
+ container.scrollLeft < container.scrollWidth - container.clientWidth
+ ) {
+ container.scrollLeft += scrollAmount;
+ requestAnimationFrame(scroll);
+ }
+ };
+
+ container.addEventListener("mousemove", (e) => {
+ const rect = container.getBoundingClientRect();
+ const x = e.clientX - rect.left;
+ const containerWidth = rect.width;
+
+ // Calculate the scroll amount based on the cursor's position
+ scrollAmount = (x / containerWidth) * scrollSpeed;
+ });
+
+ scroll();
+ };
+
+ //handle to close drop down menu onclick screen
+ useEffect(() => {
+ const closeMenuOnOutsideClick = (e) => {
+ if (isShowSort && !e.target.closest("#menu-container")) {
+ setIsShowSort(!isShowSort);
+ } else if (isNewFol && !e.target.closest("#folder-menu")) {
+ setIsNewFol(!isNewFol);
+ }
+ };
+
+ document.addEventListener("click", closeMenuOnOutsideClick);
+
+ return () => {
+ // Cleanup the event listener when the component unmounts
+ document.removeEventListener("click", closeMenuOnOutsideClick);
+ };
+ }, [isShowSort, isNewFol]);
+
+ const handleFolderTab = (folderData) => {
+ return folderData.map((data, id) => {
+ return (
+ <React.Fragment key={id}>
+ <span
+ onClick={() => handleRoute(id)}
+ style={{
+ color: "#a64b4e",
+ fontWeight: "400",
+ cursor: "pointer"
+ }}
+ >
+ {data.name}
+ <span
+ style={{
+ color: "#a64b4e",
+ fontWeight: "200",
+ cursor: "pointer",
+ margin: "0 4px"
+ }}
+ >
+ &gt;
+ </span>
+ </span>
+ </React.Fragment>
+ );
+ });
+ };
+ const oncloseFolder = () => {
+ setIsFolder(false);
+ setNewFolderName("");
+ setError("");
+ };
+ return (
+ <div style={{ backgroundColor: "white" }} className="folderComponent">
+ <Title title={"OpenSignâ„¢ Drive"} drive={true} />
+ <div>
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={isAlert.isShow}
+ title={"Alert"}
+ handleClose={() => {
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>{isAlert.alertMessage}</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ onClick={() =>
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ })
+ }
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Close
+ </button>
+ </div>
+ </ModalUi>
+ <ModalUi
+ isOpen={isFolder}
+ title={"Add New Folder"}
+ handleClose={oncloseFolder}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ {folderLoader ? (
+ <div
+ style={{
+ height: "200px",
+ display: "flex",
+ flexDirection: "column",
+ justifyContent: "center",
+ alignItems: "center"
+ }}
+ >
+ <img
+ alt="loader img"
+ src={loader}
+ style={{ width: "50px", height: "50px" }}
+ />
+ <span style={{ fontSize: "13px", color: "gray" }}>
+ Loading...
+ </span>
+ </div>
+ ) : (
+ <form
+ onSubmit={(e) => {
+ e.preventDefault();
+ handleAddFolder();
+ }}
+ style={{ display: "flex", flexDirection: "column" }}
+ >
+ <label
+ style={{
+ margin: "10px 0px 10px 0px",
+ fontSize: "15px",
+ fontWeight: "400"
+ }}
+ >
+ Name
+ <span style={{ color: "red" }}>*</span>
+ </label>
+
+ <input
+ required
+ className="form-control inputStyle"
+ type="text"
+ value={newFolderName}
+ onChange={(e) => handleFolderName(e)}
+ // className="addFolderInput"
+ />
+ <span
+ style={{ color: "red", fontSize: "12px", marginTop: "6px" }}
+ >
+ {error}
+ </span>
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <div style={{ display: "flex", flexDirection: "row" }}>
+ <button
+ style={{ background: themeColor }}
+ type="submit"
+ className="finishBtn"
+ >
+ Add
+ </button>
+ <button
+ type="button"
+ className="finishBtn cancelBtn"
+ onClick={oncloseFolder}
+ >
+ Close
+ </button>
+ </div>
+ </form>
+ )}
+ </div>
+ </ModalUi>
+
+ {isLoading.isLoad ? (
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100vh",
+ width: "100%",
+ flexDirection: "column"
+ }}
+ >
+ <img
+ alt="loader img"
+ src={loader}
+ style={{ width: "80px", height: "80px" }}
+ />
+ <span style={{ fontSize: "13px", color: "gray" }}>
+ {isLoading.message}
+ </span>
+ </div>
+ ) : handleError ? (
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100vh",
+ width: "100%"
+ }}
+ >
+ <span style={{ fontSize: "20px", color: "gray" }}>
+ {handleError}
+ </span>
+ </div>
+ ) : (
+ <>
+ <div className="folderContainer">
+ <div
+ onMouseEnter={(e) => handleMouseEnter(e)}
+ ref={scrollRef}
+ style={{
+ width: "100%"
+ }}
+ className="folderPath"
+ >
+ {handleFolderTab(folderName)}
+ </div>
+ <div className="dropMenuBD">
+ <div
+ id="folder-menu"
+ className={
+ isNewFol ? "dropdown show dropDownStyle" : "dropdown"
+ }
+ onClick={() => setIsNewFol(!isNewFol)}
+ >
+ <div className="sort">
+ <i
+ className="fa fa-plus-square"
+ aria-hidden="true"
+ style={{ fontSize: "25px", color: `${iconColor}` }}
+ ></i>
+ </div>
+ <div
+ className={
+ isNewFol ? "dropdown-menu show" : "dropdown-menu"
+ }
+ aria-labelledby="dropdownMenuButton"
+ aria-expanded={isNewFol ? "true" : "false"}
+ >
+ {" "}
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column"
+ }}
+ >
+ <span
+ className="dropdown-item itemColor"
+ onClick={() => getParentFolder()}
+ >
+ <i
+ style={{ marginRight: "5px" }}
+ className="fa fa-plus"
+ aria-hidden="true"
+ ></i>
+ Create folder
+ </span>
+ <span
+ className="dropdown-item itemColor"
+ onClick={() => navigate("/form/sHAnZphf69")}
+ >
+ <i
+ style={{ marginRight: "5px" }}
+ className="fas fa-pen-nib"
+ ></i>
+ Sign Yourself
+ </span>
+ <span
+ className="dropdown-item itemColor"
+ onClick={() => navigate("/form/8mZzFxbG1z")}
+ >
+ {" "}
+ <i
+ style={{ marginRight: "5px" }}
+ className="fa fa-file-signature"
+ ></i>
+ Request Signatures{" "}
+ </span>
+ </div>
+ </div>
+ </div>
+ <div
+ id="menu-container"
+ className={isShowSort ? "dropdown show" : "dropdown"}
+ onClick={() => setIsShowSort(!isShowSort)}
+ >
+ <div className=" sort " data-toggle="dropdown">
+ <i
+ className="fa fa-sort-amount-asc"
+ aria-hidden="true"
+ style={{
+ marginRight: "5px",
+ fontSize: "14px",
+ color: `${iconColor}`
+ }}
+ ></i>
+ <span
+ style={{
+ fontSize: "15px",
+ color: `${iconColor}`
+ }}
+ >
+ {selectedSort}
+ </span>
+ </div>
+ <div
+ className={
+ isShowSort ? "dropdown-menu show" : "dropdown-menu"
+ }
+ aria-labelledby="dropdownMenuButton"
+ aria-expanded={isShowSort ? "true" : "false"}
+ >
+ <span
+ onClick={() => {
+ setSelectedSort("Name");
+ sortApps("Name", null, pdfData);
+ }}
+ className="dropdown-item itemColor"
+ >
+ {selectedSort !== "Name" ? (
+ <i
+ className="fa fa-arrow-up"
+ aria-hidden="true"
+ style={{ marginRight: "5px" }}
+ ></i>
+ ) : (
+ <i
+ className="fa fa-check"
+ aria-hidden="true"
+ style={{ marginRight: "5px" }}
+ ></i>
+ )}
+ Name
+ </span>
+ <span
+ onClick={() => {
+ setSelectedSort("Date");
+ sortApps("Date", null, pdfData);
+ }}
+ className="dropdown-item itemColor"
+ >
+ {selectedSort !== "Date" ? (
+ <i
+ className="fa fa-arrow-up"
+ aria-hidden="true"
+ style={{ marginRight: "5px" }}
+ ></i>
+ ) : (
+ <i
+ className="fa fa-check"
+ aria-hidden="true"
+ style={{ marginRight: "5px" }}
+ ></i>
+ )}
+ Date
+ </span>
+ <hr className="hrStyle" />
+ <span
+ onClick={() => {
+ setSortingOrder("Accending");
+ sortApps(null, "Accending", pdfData);
+ }}
+ className="dropdown-item itemColor"
+ >
+ {sortingOrder !== "Accending" ? (
+ <i
+ className="fa fa-arrow-up"
+ aria-hidden="true"
+ style={{ marginRight: "5px" }}
+ ></i>
+ ) : (
+ <i
+ className="fa fa-check"
+ aria-hidden="true"
+ style={{ marginRight: "5px" }}
+ ></i>
+ )}
+ Accending
+ </span>
+ <span
+ onClick={() => {
+ setSortingOrder("Decending");
+ sortApps(null, "Decending", pdfData);
+ }}
+ className="dropdown-item itemColor"
+ >
+ {sortingOrder !== "Decending" ? (
+ <i
+ className="fa fa-arrow-up"
+ aria-hidden="true"
+ style={{ marginRight: "5px" }}
+ ></i>
+ ) : (
+ <i
+ className="fa fa-check"
+ aria-hidden="true"
+ style={{ marginRight: "5px" }}
+ ></i>
+ )}
+ Decending
+ </span>
+ </div>
+ </div>
+
+ <div>
+ {isList ? (
+ <div className="sort" onClick={() => setIsList(!isList)}>
+ <i
+ onClick={() => setIsList(!isList)}
+ className="fa fa-th-large"
+ style={{ fontSize: "24px", color: `${iconColor}` }}
+ aria-hidden="true"
+ ></i>
+ </div>
+ ) : (
+ <div className="sort" onClick={() => setIsList(!isList)}>
+ <i
+ className="fa fa-list"
+ aria-hidden="true"
+ style={{ fontSize: "23px", color: `${iconColor}` }}
+ ></i>
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+
+ {pdfData && pdfData.length === 0 ? (
+ <div
+ style={{
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "50vh",
+ width: "100%"
+ }}
+ >
+ <span style={{ fontWeight: "bold" }}>No Data Found!</span>
+ </div>
+ ) : (
+ <DriveBody
+ pdfData={pdfData}
+ setFolderName={setFolderName}
+ setIsLoading={setIsLoading}
+ setDocId={setDocId}
+ getPdfFolderDocumentList={getPdfFolderDocumentList}
+ getPdfDocumentList={getPdfDocumentList}
+ isDocId={docId}
+ setPdfData={setPdfData}
+ isList={isList}
+ setIsAlert={setIsAlert}
+ />
+ )}
+ </>
+ )}
+ </div>
+ </div>
+ );
+}
+
+export default Opensigndrive;
diff --git a/apps/OpenSign/src/routes/PdfRequestFiles.js b/apps/OpenSign/src/routes/PdfRequestFiles.js
new file mode 100644
index 000000000..dd3ad2023
--- /dev/null
+++ b/apps/OpenSign/src/routes/PdfRequestFiles.js
@@ -0,0 +1,1453 @@
+import React, { useState, useRef, useEffect } from "react";
+import { themeColor } from "../constant/const";
+import { PDFDocument } from "pdf-lib";
+import "../styles/signature.css";
+import axios from "axios";
+import loader from "../assets/images/loader2.gif";
+import { DndProvider } from "react-dnd";
+import { HTML5Backend } from "react-dnd-html5-backend";
+import { useParams } from "react-router-dom";
+import SignPad from "../components/pdf/SignPad";
+import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
+import Tour from "reactour";
+import {
+ contractDocument,
+ multiSignEmbed,
+ embedDocId,
+ pdfNewWidthFun,
+ signPdfFun,
+ onImageSelect,
+ onSaveSign,
+ onSaveImage,
+ addDefaultSignatureImg
+} from "../constant/Utils";
+import Loader from "../components/pdf/Loader";
+import HandleError from "../primitives/HandleError";
+import Nodata from "../primitives/Nodata";
+import Header from "../components/pdf/Header";
+import RenderPdf from "../components/pdf/RenderPdf";
+import PdfDeclineModal from "../primitives/PdfDeclineModal";
+import Title from "../components/Title";
+import DefaultSignature from "../components/pdf/DefaultSignature";
+import ModalUi from "../primitives/ModalUi";
+
+function PdfRequestFiles() {
+ const { docId } = useParams();
+ const [pdfDetails, setPdfDetails] = useState([]);
+ const [signedSigners, setSignedSigners] = useState([]);
+ const [unsignedSigners, setUnSignedSigners] = useState([]);
+ const [isSignPad, setIsSignPad] = useState(false);
+ const [pdfUrl, setPdfUrl] = useState();
+ const [allPages, setAllPages] = useState(null);
+ const numPages = 1;
+ const [pageNumber, setPageNumber] = useState(1);
+ const [image, setImage] = useState(null);
+ const [isImageSelect, setIsImageSelect] = useState(false);
+ const [signature, setSignature] = useState();
+ const [isStamp, setIsStamp] = useState(false);
+ const [signKey, setSignKey] = useState();
+ const [imgWH, setImgWH] = useState({});
+ const imageRef = useRef(null);
+ const [handleError, setHandleError] = useState();
+ const [isLoading, setIsLoading] = useState({
+ isLoad: true,
+ message: "This might take some time"
+ });
+ const [defaultSignImg, setDefaultSignImg] = useState();
+ const [isDocId, setIsDocId] = useState(false);
+ const [pdfNewWidth, setPdfNewWidth] = useState();
+ const [pdfOriginalWidth, setPdfOriginalWidth] = useState();
+ const [signerPos, setSignerPos] = useState([]);
+ const [noData, setNoData] = useState(false);
+ const [signerObjectId, setSignerObjectId] = useState();
+ const [isUiLoading, setIsUiLoading] = useState(false);
+ const [isDecline, setIsDecline] = useState({ isDeclined: false });
+ const [currentSigner, setCurrentSigner] = useState(false);
+ const [isAlert, setIsAlert] = useState({ isShow: false, alertMessage: "" });
+ const [unSignedWidgetId, setUnSignedWidgetId] = useState("");
+ const [defaultSignAlert, setDefaultSignAlert] = useState({
+ isShow: false,
+ alertMessage: ""
+ });
+ const [isCompleted, setIsCompleted] = useState({
+ isCertificate: false,
+ isModal: false
+ });
+ const [myInitial, setMyInitial] = useState("");
+ const [isInitial, setIsInitial] = useState(false);
+ const [pdfLoadFail, setPdfLoadFail] = useState({
+ status: false,
+ type: "load"
+ });
+ const [isSigned, setIsSigned] = useState(false);
+ const [isExpired, setIsExpired] = useState(false);
+ const [alreadySign, setAlreadySign] = useState(false);
+ const [containerWH, setContainerWH] = useState({});
+ const [validateAlert, setValidateAlert] = useState(false);
+ const [widgetsTour, setWidgetsTour] = useState(false);
+ const [minRequiredCount, setminRequiredCount] = useState();
+ const [sendInOrder, setSendInOrder] = useState(false);
+ const divRef = useRef(null);
+ const isMobile = window.innerWidth < 767;
+ const rowLevel =
+ localStorage.getItem("rowlevel") &&
+ JSON.parse(localStorage.getItem("rowlevel"));
+
+ const objectId =
+ rowLevel && rowLevel.id
+ ? rowLevel.id
+ : rowLevel?.objectId && rowLevel.objectId;
+ const documentId = docId ? docId : objectId && objectId;
+
+ const senderUser =
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ ) &&
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ );
+ const jsonSender = JSON.parse(senderUser);
+
+ useEffect(() => {
+ if (documentId) {
+ getDocumentDetails();
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+ useEffect(() => {
+ if (divRef.current) {
+ const pdfWidth = pdfNewWidthFun(divRef);
+ setPdfNewWidth(pdfWidth);
+ setContainerWH({
+ width: divRef.current.offsetWidth,
+ height: divRef.current.offsetHeight
+ });
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [divRef.current]);
+
+ //function for get document details for perticular signer with signer'object id
+ const getDocumentDetails = async () => {
+ let currUserId;
+ //getting document details
+ const documentData = await contractDocument(documentId);
+ if (documentData && documentData.length > 0) {
+ const isCompleted =
+ documentData[0].IsCompleted && documentData[0].IsCompleted;
+ const expireDate = documentData[0].ExpiryDate.iso;
+ const declined = documentData[0].IsDeclined && documentData[0].IsDeclined;
+ const expireUpdateDate = new Date(expireDate).getTime();
+ const currDate = new Date().getTime();
+ const getSigners = documentData[0].Signers;
+ const getCurrentSigner =
+ getSigners &&
+ getSigners.filter(
+ (data) => data.UserId.objectId === jsonSender.objectId
+ );
+
+ currUserId = getCurrentSigner[0] ? getCurrentSigner[0].objectId : "";
+ setSignerObjectId(currUserId);
+ if (documentData[0].SignedUrl) {
+ setPdfUrl(documentData[0].SignedUrl);
+ } else {
+ setPdfUrl(documentData[0].URL);
+ }
+ if (isCompleted) {
+ setIsSigned(true);
+ const data = {
+ isCertificate: true,
+ isModal: true
+ };
+ setAlreadySign(true);
+ setIsCompleted(data);
+ } else if (declined) {
+ const currentDecline = {
+ currnt: "another",
+ isDeclined: true
+ };
+ setIsDecline(currentDecline);
+ } else if (currDate > expireUpdateDate) {
+ setIsExpired(true);
+ }
+
+ if (documentData.length > 0) {
+ const checkDocIdExist =
+ documentData[0].AuditTrail &&
+ documentData[0].AuditTrail.length > 0 &&
+ documentData[0].AuditTrail.filter(
+ (data) => data.Activity === "Signed"
+ );
+
+ const checkAlreadySign =
+ documentData[0].AuditTrail &&
+ documentData[0].AuditTrail.length > 0 &&
+ documentData[0].AuditTrail.filter(
+ (data) =>
+ data.UserPtr.objectId === currUserId && data.Activity === "Signed"
+ );
+ if (
+ checkAlreadySign &&
+ checkAlreadySign[0] &&
+ checkAlreadySign.length > 0
+ ) {
+ setAlreadySign(true);
+ } else {
+ const obj = documentData?.[0];
+ setSendInOrder(obj?.SendinOrder || false);
+ if (
+ obj &&
+ obj.Signers &&
+ obj.Signers.length > 0 &&
+ obj.Placeholders &&
+ obj.Placeholders.length > 0
+ ) {
+ const params = {
+ event: "viewed",
+ body: {
+ objectId: documentData?.[0].objectId,
+ file: documentData?.[0]?.SignedUrl || documentData?.[0]?.URL,
+ name: documentData?.[0].Name,
+ note: documentData?.[0].Note || "",
+ description: documentData?.[0].Description || "",
+ signers: documentData?.[0].Signers?.map((x) => ({
+ name: x?.Name,
+ email: x?.Email,
+ phone: x?.Phone
+ })),
+ viewedBy: jsonSender.email,
+ viewedAt: new Date(),
+ createdAt: documentData?.[0].createdAt
+ }
+ };
+
+ try {
+ await axios.post(
+ `${localStorage.getItem("baseUrl")}functions/callwebhook`,
+ params,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id":
+ localStorage.getItem("parseAppId"),
+ sessiontoken: localStorage.getItem("accesstoken")
+ }
+ }
+ );
+ } catch (err) {
+ console.log("Err ", err);
+ }
+ }
+ }
+
+ let signers = [];
+ let unSignedSigner = [];
+
+ //check document is signed or not
+ if (checkDocIdExist && checkDocIdExist.length > 0) {
+ setIsDocId(true);
+ const signerRes = documentData[0].Signers;
+ //comparison auditTrail user details with signers user details
+ for (let i = 0; i < signerRes.length; i++) {
+ const signerId = signerRes[i].objectId;
+
+ let isSignedSignature = false;
+ for (let j = 0; j < checkDocIdExist.length; j++) {
+ const signedExist =
+ checkDocIdExist[j] && checkDocIdExist[j].UserPtr.objectId;
+ //checking signerObjId and auditTrail User objId
+ // if match then add signed data in signer array and break loop
+
+ if (signerId === signedExist) {
+ signers.push({ ...signerRes[i], ...signerRes[i] });
+ isSignedSignature = true;
+ break;
+ }
+ // if does not match then add unsigned data in unSignedSigner array
+ }
+ if (!isSignedSignature) {
+ unSignedSigner.push({ ...signerRes[i], ...signerRes[i] });
+ }
+ }
+ setSignedSigners(signers);
+ setUnSignedSigners(unSignedSigner);
+
+ setSignerPos(documentData[0].Placeholders);
+ } else {
+ let unsigned = [];
+ for (let i = 0; i < documentData.length; i++) {
+ unsigned.push(documentData[i].Signers);
+ }
+ setUnSignedSigners(unsigned[0]);
+ setSignerPos(documentData[0].Placeholders);
+ }
+ setPdfDetails(documentData);
+ setIsUiLoading(false);
+ } else {
+ alert("No data found!");
+ }
+ } else if (
+ documentData === "Error: Something went wrong!" ||
+ (documentData.result && documentData.result.error)
+ ) {
+ const loadObj = {
+ isLoad: false
+ };
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ } else {
+ setNoData(true);
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ setIsUiLoading(false);
+ }
+ await axios
+ .get(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Signature?where={"UserId": {"__type": "Pointer","className": "_User", "objectId":"${
+ jsonSender.objectId
+ }"}}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then((Listdata) => {
+ const json = Listdata.data;
+ const res = json.results;
+
+ if (res[0] && res.length > 0) {
+ setDefaultSignImg(res[0].ImageURL);
+ setMyInitial(res[0]?.Initials);
+ }
+
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ })
+ .catch((err) => {
+ const loadObj = {
+ isLoad: false
+ };
+ console.log("Err ", err);
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ });
+ };
+
+ const checkSendInOrder = () => {
+ if (sendInOrder) {
+ const index = pdfDetails?.[0].Signers.findIndex(
+ (x) => x.Email === jsonSender.email
+ );
+ const newIndex = index - 1;
+ if (newIndex !== -1) {
+ const user = pdfDetails?.[0].Signers[newIndex];
+ const isPrevUserSigned =
+ pdfDetails?.[0].AuditTrail &&
+ pdfDetails?.[0].AuditTrail.some(
+ (x) =>
+ x.UserPtr.objectId === user.objectId && x.Activity === "Signed"
+ );
+ if (isPrevUserSigned) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return true;
+ }
+ } else {
+ return true;
+ }
+ };
+
+ //function for embed signature or image url in pdf
+ async function embedWidgetsData() {
+ const validateSigning = checkSendInOrder();
+ if (validateSigning) {
+ const checkUser = signerPos.filter(
+ (data) => data.signerObjId === signerObjectId
+ );
+ if (checkUser && checkUser.length > 0) {
+ let checkboxExist,
+ requiredRadio,
+ showAlert = false,
+ widgetKey,
+ radioExist,
+ requiredCheckbox;
+
+ for (let i = 0; i < checkUser[0].placeHolder.length; i++) {
+ checkboxExist = checkUser[0].placeHolder[i].pos.some(
+ (data) => data.type === "checkbox"
+ );
+ radioExist = checkUser[0].placeHolder[i].pos.some(
+ (data) => data.type === "radio"
+ );
+ if (checkboxExist) {
+ requiredCheckbox = checkUser[0].placeHolder[i].pos.filter(
+ (position) =>
+ !position.options?.isReadOnly && position.type === "checkbox"
+ );
+
+ if (requiredCheckbox && requiredCheckbox?.length > 0) {
+ for (let i = 0; i < requiredCheckbox.length; i++) {
+ const minCount =
+ requiredCheckbox[i].options?.validation?.minRequiredCount;
+ const parseMin = minCount && parseInt(minCount);
+ const maxCount =
+ requiredCheckbox[i].options?.validation?.maxRequiredCount;
+ const parseMax = maxCount && parseInt(maxCount);
+ const response = requiredCheckbox[i].options?.response?.length;
+ const defaultValue =
+ requiredCheckbox[i].options?.defaultValue?.length;
+ if (parseMin === 0 && parseMax === 0) {
+ if (!showAlert) {
+ showAlert = false;
+ }
+ } else if (parseMin === 0 && parseMax > 0) {
+ if (!showAlert) {
+ showAlert = false;
+ }
+ } else if (!response) {
+ if (!defaultValue) {
+ if (!showAlert) {
+ showAlert = true;
+ widgetKey = requiredCheckbox[i].key;
+ setminRequiredCount(parseMin);
+ }
+ }
+ } else if (parseMin > 0 && parseMin > response) {
+ if (!showAlert) {
+ showAlert = true;
+ widgetKey = requiredCheckbox[i].key;
+ setminRequiredCount(parseMin);
+ }
+ }
+ }
+ }
+ } else if (radioExist) {
+ requiredRadio = checkUser[0].placeHolder[i].pos.filter(
+ (position) =>
+ !position.options?.isReadOnly && position.type === "radio"
+ );
+
+ if (requiredRadio && requiredRadio?.length > 0) {
+ let checkSigned;
+ for (let i = 0; i < requiredRadio.length; i++) {
+ checkSigned = requiredRadio[i]?.options.response;
+ if (!checkSigned) {
+ let checkDefaultSigned =
+ requiredRadio[i]?.options.defaultValue;
+ if (!checkDefaultSigned) {
+ if (!showAlert) {
+ showAlert = true;
+ widgetKey = requiredRadio[i].key;
+ }
+ }
+ }
+ }
+ }
+ } else {
+ const requiredWidgets = checkUser[0].placeHolder[i].pos.filter(
+ (position) => !position.options?.isReadOnly
+ );
+ if (requiredWidgets && requiredCheckbox?.length > 0) {
+ let checkSigned;
+ for (let i = 0; i < requiredWidgets.length; i++) {
+ checkSigned = requiredWidgets[i]?.options?.response;
+ if (!checkSigned) {
+ const checkSignUrl = requiredWidgets[i]?.pos?.SignUrl;
+
+ let checkDefaultSigned =
+ requiredWidgets[i]?.options?.defaultValue;
+ if (!checkSignUrl) {
+ if (!checkDefaultSigned) {
+ if (!showAlert) {
+ showAlert = true;
+ widgetKey = requiredWidgets[i].key;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (checkboxExist && requiredCheckbox && showAlert) {
+ setUnSignedWidgetId(widgetKey);
+ setWidgetsTour(true);
+ } else if (radioExist && showAlert) {
+ setUnSignedWidgetId(widgetKey);
+ setWidgetsTour(true);
+ } else if (showAlert) {
+ setUnSignedWidgetId(widgetKey);
+ setWidgetsTour(true);
+ } else {
+ setIsUiLoading(true);
+ const pngUrl = checkUser[0].placeHolder;
+ // Load a PDFDocument from the existing PDF bytes
+ const existingPdfBytes = await fetch(pdfUrl).then((res) =>
+ res.arrayBuffer()
+ );
+ const pdfDoc = await PDFDocument.load(existingPdfBytes, {
+ ignoreEncryption: true
+ });
+ // let pdfBase64;
+
+ //checking if signature is only one then send image url in jpeg formate to server
+ // if (pngUrl.length === 1 && pngUrl[0].pos.length === 1) {
+ // if (isDocId) {
+ // try {
+ // pdfBase64 = await getBase64FromUrl(pdfUrl);
+ // } catch (err) {
+ // console.log(err);
+ // }
+ // } else {
+ // //embed document's object id to all pages in pdf document
+ // try {
+ // await embedDocId(pdfDoc, documentId, allPages);
+ // } catch (err) {
+ // console.log(err);
+ // }
+ // try {
+ // pdfBase64 = await pdfDoc.saveAsBase64({
+ // useObjectStreams: false
+ // });
+ // } catch (err) {
+ // console.log(err);
+ // }
+ // }
+ // for (let pngData of pngUrl) {
+ // const imgUrlList = pngData.pos;
+ // const pageNo = pngData.pageNumber;
+ // imgUrlList.map(async (data) => {
+ // //cheking signUrl is defau;t signature url of custom url
+ // let ImgUrl = data.SignUrl;
+ // const checkUrl = urlValidator(ImgUrl);
+ // //if default signature url then convert it in base 64
+ // if (checkUrl) {
+ // ImgUrl = await getBase64FromIMG(ImgUrl + "?get");
+ // }
+ // //function for called convert png signatre to jpeg in base 64
+ // convertPNGtoJPEG(ImgUrl)
+ // .then((jpegBase64Data) => {
+ // const removeBase64Fromjpeg = "data:image/jpeg;base64,";
+ // const newImgUrl = jpegBase64Data.replace(
+ // removeBase64Fromjpeg,
+ // ""
+ // );
+
+ // //function for call to embed signature in pdf and get digital signature pdf
+ // signPdfFun(
+ // newImgUrl,
+ // documentId,
+ // signerObjectId,
+ // pdfOriginalWidth,
+ // pngUrl,
+ // containerWH,
+ // setIsAlert,
+ // data,
+ // pdfBase64,
+ // pageNo
+ // )
+ // .then((res) => {
+ // if (res && res.status === "success") {
+ // setPdfUrl(res.data);
+ // setIsSigned(true);
+ // setSignedSigners([]);
+ // setUnSignedSigners([]);
+ // getDocumentDetails();
+ // } else {
+ // setIsAlert({
+ // isShow: true,
+ // alertMessage: "something went wrong"
+ // });
+ // }
+ // })
+ // .catch((err) => {
+ // setIsAlert({
+ // isShow: true,
+ // alertMessage: "something went wrong"
+ // });
+ // });
+ // })
+ // .catch((error) => {
+ // console.error("Error:", error);
+ // });
+ // });
+ // }
+ // }
+ // //else if signature is more than one then embed all sign with the use of pdf-lib
+ // else if (pngUrl.length > 0 && pngUrl[0].pos.length > 0) {
+ const flag = false;
+ const extUserPtr = pdfDetails[0].ExtUserPtr;
+ const HeaderDocId = extUserPtr?.HeaderDocId;
+ //embed document's object id to all pages in pdf document
+ if (!HeaderDocId) {
+ if (!isDocId) {
+ await embedDocId(pdfDoc, documentId, allPages);
+ }
+ }
+ //embed multi signature in pdf
+ const pdfBytes = await multiSignEmbed(
+ pngUrl,
+ pdfDoc,
+ pdfOriginalWidth,
+ flag,
+ containerWH
+ );
+
+ //function for call to embed signature in pdf and get digital signature pdf
+ try {
+ const res = await signPdfFun(
+ pdfBytes,
+ documentId,
+ signerObjectId,
+ setIsAlert
+ );
+ if (res && res.status === "success") {
+ setPdfUrl(res.data);
+ setIsSigned(true);
+ setSignedSigners([]);
+ setUnSignedSigners([]);
+ getDocumentDetails();
+ if (sendInOrder) {
+ const index = pdfDetails?.[0].Signers.findIndex(
+ (x) => x.Email === jsonSender.email
+ );
+ const newIndex = index + 1;
+ const user = pdfDetails?.[0].Signers[newIndex];
+ if (user) {
+ // console.log("pdfDetails", pdfDetails);
+ const expireDate = pdfDetails?.[0].ExpiryDate.iso;
+ const newDate = new Date(expireDate);
+ const localExpireDate = newDate.toLocaleDateString("en-US", {
+ day: "numeric",
+ month: "long",
+ year: "numeric"
+ });
+ let sender = pdfDetails?.[0].ExtUserPtr.Email;
+
+ try {
+ const imgPng =
+ "https://qikinnovation.ams3.digitaloceanspaces.com/logo.png";
+ let url = `${localStorage.getItem(
+ "baseUrl"
+ )}functions/sendmailv3/`;
+ const headers = {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id":
+ localStorage.getItem("parseAppId"),
+ sessionToken: localStorage.getItem("accesstoken")
+ };
+ const serverUrl = localStorage.getItem("baseUrl");
+ const newServer = serverUrl.replaceAll("/", "%2F");
+ const objectId = user.objectId;
+ const serverParams = `${newServer}&${localStorage.getItem(
+ "parseAppId"
+ )}&${localStorage.getItem("_appName")}`;
+ const hostUrl = window.location.origin;
+ let signPdf = `${hostUrl}/login/${pdfDetails?.[0].objectId}/${user.Email}/${objectId}/${serverParams}`;
+ const openSignUrl =
+ "https://www.opensignlabs.com/contact-us";
+ const orgName = pdfDetails[0]?.ExtUserPtr.Company
+ ? pdfDetails[0].ExtUserPtr.Company
+ : "";
+ const themeBGcolor = themeColor;
+ let params = {
+ recipient: user.Email,
+ subject: `${pdfDetails?.[0].ExtUserPtr.Name} has requested you to sign ${pdfDetails?.[0].Name}`,
+ from: sender,
+
+ html:
+ "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> </head> <body> <div style='background-color: #f5f5f5; padding: 20px'=> <div style=' box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;background: white;padding-bottom: 20px;'> <div style='padding:10px 10px 0 10px'><img src=" +
+ imgPng +
+ " height='50' style='padding: 20px,width:170px,height:40px' /></div> <div style=' padding: 2px;font-family: system-ui;background-color:" +
+ themeBGcolor +
+ ";'><p style='font-size: 20px;font-weight: 400;color: white;padding-left: 20px;' > Digital Signature Request</p></div><div><p style='padding: 20px;font-family: system-ui;font-size: 14px; margin-bottom: 10px;'> " +
+ pdfDetails?.[0].ExtUserPtr.Name +
+ " has requested you to review and sign <strong> " +
+ pdfDetails?.[0].Name +
+ "</strong>.</p><div style='padding: 5px 0px 5px 25px;display: flex;flex-direction: row;justify-content: space-around;'><table> <tr> <td style='font-weight:bold;font-family:sans-serif;font-size:15px'>Sender</td> <td> </td> <td style='color:#626363;font-weight:bold'>" +
+ sender +
+ "</td></tr><tr><td style='font-weight:bold;font-family:sans-serif;font-size:15px'>Organization</td> <td> </td><td style='color:#626363;font-weight:bold'> " +
+ orgName +
+ "</td></tr> <tr> <td style='font-weight:bold;font-family:sans-serif;font-size:15px'>Expires on</td><td> </td> <td style='color:#626363;font-weight:bold'>" +
+ localExpireDate +
+ "</td></tr><tr> <td></td> <td> </td></tr></table> </div> <div style='margin-left:70px'><a href=" +
+ signPdf +
+ "> <button style='padding: 12px 12px 12px 12px;background-color: #d46b0f;color: white; border: 0px;box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px,rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;font-weight:bold;margin-top:30px'>Sign here</button></a> </div> <div style='display: flex; justify-content: center;margin-top: 10px;'> </div></div></div><div><p> This is an automated email from OpenSignâ„¢. For any queries regarding this email, please contact the sender " +
+ sender +
+ " directly.If you think this email is inappropriate or spam, you may file a complaint with OpenSignâ„¢ <a href= " +
+ openSignUrl +
+ " target=_blank>here</a>.</p> </div></div></body> </html>"
+ };
+ await axios.post(url, params, {
+ headers: headers
+ });
+ } catch (error) {
+ console.log("error", error);
+ }
+ }
+ }
+ } else {
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong"
+ });
+ }
+ } catch (err) {
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong"
+ });
+ }
+ }
+ setIsSignPad(false);
+ } else {
+ setIsAlert({
+ isShow: true,
+ alertMessage: "something went wrong"
+ });
+ }
+ } else {
+ setIsAlert({
+ isShow: true,
+ alertMessage:
+ "Please wait for your turn to sign this document, as it has been set up by the creator to be signed in a specific order; you'll be notified when it's your turn."
+ });
+ }
+ }
+ //function for update TourStatus
+ const closeTour = async () => {
+ setWidgetsTour(false);
+ };
+
+ const tourConfig = [
+ {
+ selector: '[data-tut="IsSigned"]',
+ content: minRequiredCount
+ ? `Please confirm that you have selected at least ${minRequiredCount} checkboxes.`
+ : "Ensure this field is accurately filled and meets all requirements.",
+ position: "top",
+ style: { fontSize: "13px" }
+ }
+ ];
+
+ //function for get pdf page details
+ const pageDetails = async (pdf) => {
+ const load = {
+ status: true
+ };
+ setPdfLoadFail(load);
+ pdf.getPage(1).then((pdfPage) => {
+ const pageWidth = pdfPage.view[2];
+
+ setPdfOriginalWidth(pageWidth);
+ });
+ };
+
+ //function for change page
+ function changePage(offset) {
+ setPageNumber((prevPageNumber) => prevPageNumber + offset);
+ }
+
+ const getFirstLetter = (name) => {
+ const firstLetter = name.charAt(0);
+ return firstLetter;
+ };
+ //function for image upload or update
+ const onImageChange = (event) => {
+ if (event.target.files && event.target.files[0]) {
+ onImageSelect(event, setImgWH, setImage);
+ }
+ };
+ //function for upload stamp image
+ const saveImage = () => {
+ //get current signers placeholder position data
+ const currentSigner = signerPos.filter(
+ (data) => data.signerObjId === signerObjectId
+ );
+ //get current pagenumber placeholder index
+ const getIndex = currentSigner[0].placeHolder.findIndex((object) => {
+ return object.pageNumber === pageNumber;
+ });
+ //get current signer placeholder position data
+ const placeholderPosition = currentSigner[0].placeHolder;
+ //function of save image and get updated position with image url
+ const getUpdatePosition = onSaveImage(
+ placeholderPosition,
+ getIndex,
+ signKey,
+ imgWH,
+ image
+ );
+
+ //replace updated placeholder position with old data
+ placeholderPosition.splice(
+ 0,
+ placeholderPosition.length,
+ ...getUpdatePosition
+ );
+ //get current signers placeholder position data index number in array
+ const indexofSigner = signerPos.findIndex((object) => {
+ return object.signerObjId === signerObjectId;
+ });
+ //update current signers data with new placeholder position array data
+ setSignerPos((prevState) => {
+ const newState = [...prevState]; // Create a copy of the state
+ newState.splice(indexofSigner, 1, ...currentSigner); // Modify the copy
+ return newState; // Update the state with the modified copy
+ });
+ };
+
+ //function for save button to save signature or image url
+ const saveSign = (isDefaultSign, width, height) => {
+ const isTypeText = width && height ? true : false;
+ const signatureImg = isDefaultSign
+ ? isDefaultSign === "initials"
+ ? myInitial
+ : defaultSignImg
+ : signature;
+ let imgWH = { width: width ? width : "", height: height ? height : "" };
+ setIsSignPad(false);
+ setIsImageSelect(false);
+ setImage();
+
+ //get current signers placeholder position data
+ const currentSigner = signerPos.filter(
+ (data) => data.signerObjId === signerObjectId
+ );
+ //get current pagenumber placeholder index
+ const getIndex = currentSigner[0].placeHolder.findIndex((object) => {
+ return object.pageNumber === pageNumber;
+ });
+
+ //set default signature image width and height
+ if (isDefaultSign) {
+ const img = new Image();
+ img.src = defaultSignImg;
+ if (img.complete) {
+ imgWH = {
+ width: img.width,
+ height: img.height
+ };
+ }
+ }
+ //get current signer placeholder position data
+ const placeholderPosition = currentSigner[0].placeHolder;
+ //function of save signature image and get updated position with signature image url
+ const getUpdatePosition = onSaveSign(
+ placeholderPosition,
+ getIndex,
+ signKey,
+ signatureImg,
+ imgWH,
+ isDefaultSign,
+ isTypeText
+ );
+
+ const updateSignerData = currentSigner.map((obj) => {
+ if (obj.signerObjId === signerObjectId) {
+ return { ...obj, placeHolder: getUpdatePosition };
+ }
+ return obj;
+ });
+
+ const index = signerPos.findIndex(
+ (data) => data.signerObjId === signerObjectId
+ );
+ setSignerPos((prevState) => {
+ const newState = [...prevState];
+ newState.splice(index, 1, ...updateSignerData);
+ return newState;
+ });
+ };
+
+ const checkSignerBackColor = (obj) => {
+ const data = signerPos.filter((data) => data.signerObjId === obj.objectId);
+ return data && data.length > 0 && data[0].blockColor;
+ };
+
+ //function for set decline true on press decline button
+ const declineDoc = async () => {
+ setIsDecline({ isDeclined: false });
+ const data = {
+ IsDeclined: true
+ };
+ setIsUiLoading(true);
+
+ await axios
+ .put(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Document/${documentId}`,
+ data,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then(async (result) => {
+ const res = result.data;
+ if (res) {
+ const currentDecline = {
+ currnt: "YouDeclined",
+ isDeclined: true
+ };
+ setIsDecline(currentDecline);
+ setIsUiLoading(false);
+ const params = {
+ event: "declined",
+ body: {
+ objectId: pdfDetails?.[0].objectId,
+ file: pdfDetails?.[0]?.SignedUrl || pdfDetails?.[0]?.URL,
+ name: pdfDetails?.[0].Name,
+ note: pdfDetails?.[0].Note || "",
+ description: pdfDetails?.[0].Description || "",
+ signers: pdfDetails?.[0].Signers?.map((x) => ({
+ name: x?.Name,
+ email: x?.Email,
+ phone: x?.Phone
+ })),
+ declinedBy: jsonSender.email,
+ declinedAt: new Date(),
+ createdAt: pdfDetails?.[0].createdAt
+ }
+ };
+
+ try {
+ await axios.post(
+ `${localStorage.getItem("baseUrl")}functions/callwebhook`,
+ params,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessiontoken: localStorage.getItem("accesstoken")
+ }
+ }
+ );
+ } catch (err) {
+ console.log("Err ", err);
+ }
+ }
+ })
+ .catch((err) => {
+ console.log("error updating field is decline ", err);
+ });
+ };
+ //function to add default signature for all requested placeholder of sign
+ const addDefaultSignature = () => {
+ //get current signers placeholder position data
+ const currentSignerPosition = signerPos.filter(
+ (data) => data.signerObjId === signerObjectId
+ );
+ //function for save default signature url for all placeholder position
+ const updatePlace = addDefaultSignatureImg(
+ currentSignerPosition[0].placeHolder,
+ defaultSignImg
+ );
+
+ const updatesignerPos = signerPos.map((x) =>
+ x.signerObjId === signerObjectId ? { ...x, placeHolder: updatePlace } : x
+ );
+ setSignerPos(updatesignerPos);
+ setDefaultSignAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ };
+
+ return (
+ <DndProvider backend={HTML5Backend}>
+ <Title title={"Request Sign"} />
+ {isLoading.isLoad ? (
+ <Loader isLoading={isLoading} />
+ ) : handleError ? (
+ <HandleError handleError={handleError} />
+ ) : noData ? (
+ <Nodata />
+ ) : (
+ <div>
+ {isUiLoading && (
+ <div
+ style={{
+ position: "absolute",
+ height: "100vh",
+ width: "100%",
+ display: "flex",
+ justifyContent: "center",
+ flexDirection: "column",
+ alignItems: "center",
+ zIndex: "999",
+ backgroundColor: "#e6f2f2",
+ opacity: 0.8
+ }}
+ >
+ <img
+ alt="no img"
+ src={loader}
+ style={{ width: "100px", height: "100px" }}
+ />
+ <span style={{ fontSize: "13px", fontWeight: "bold" }}>
+ This might take some time
+ </span>
+ </div>
+ )}
+
+ <div className="signatureContainer" ref={divRef}>
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={isAlert.isShow}
+ title={"Alert message"}
+ handleClose={() => {
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>{isAlert.alertMessage}</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+
+ <button
+ onClick={() => {
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Ok
+ </button>
+ </div>
+ </ModalUi>
+
+ <Tour
+ showNumber={false}
+ showNavigation={false}
+ showNavigationNumber={false}
+ onRequestClose={closeTour}
+ steps={tourConfig}
+ isOpen={widgetsTour}
+ rounded={5}
+ closeWithMask={false}
+ />
+
+ {/* this modal is used to show decline alert */}
+ <PdfDeclineModal
+ containerWH={containerWH}
+ show={isDecline.isDeclined}
+ headMsg="Document Declined"
+ bodyMssg={
+ isDecline.currnt === "Sure"
+ ? "Are you sure want to decline this document ?"
+ : isDecline.currnt === "YouDeclined"
+ ? "You have declined this document!"
+ : isDecline.currnt === "another" &&
+ "You cannot sign this document as it has been declined by one or more person(s)."
+ }
+ footerMessage={isDecline.currnt === "Sure"}
+ declineDoc={declineDoc}
+ setIsDecline={setIsDecline}
+ />
+ {/* this modal is used for show expired alert */}
+ <PdfDeclineModal
+ containerWH={containerWH}
+ show={isExpired}
+ headMsg="Document Expired!"
+ bodyMssg="This Document is no longer available."
+ />
+
+ <ModalUi
+ headerColor={defaultSignImg ? themeColor : "#dc3545"}
+ isOpen={defaultSignAlert.isShow}
+ title={"Auto sign"}
+ handleClose={() => {
+ setDefaultSignAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>{defaultSignAlert.alertMessage}</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ {defaultSignImg ? (
+ <>
+ <button
+ onClick={() => addDefaultSignature()}
+ style={{
+ background: themeColor
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Yes
+ </button>
+ <button
+ onClick={() => {
+ setDefaultSignAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Close
+ </button>
+ </>
+ ) : (
+ <button
+ onClick={() => {
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Ok
+ </button>
+ )}
+ </div>
+ </ModalUi>
+ {/* this component used to render all pdf pages in left side */}
+ <RenderAllPdfPage
+ signPdfUrl={pdfDetails[0].URL}
+ allPages={allPages}
+ setAllPages={setAllPages}
+ setPageNumber={setPageNumber}
+ pageNumber={pageNumber}
+ />
+
+ {/* pdf render view */}
+ <div
+ style={{
+ marginLeft: !isMobile && pdfOriginalWidth > 500 && "20px",
+ marginRight: !isMobile && pdfOriginalWidth > 500 && "20px"
+ }}
+ >
+ {/* this modal is used show this document is already sign */}
+ <ModalUi
+ isOpen={isCompleted.isModal}
+ title={"Sign Documents"}
+ handleClose={() => {
+ setIsCompleted({ isModal: false, isCertificate: true });
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>This document has been signed by all Signers.</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ type="button"
+ className="finishBtn cancelBtn"
+ onClick={() =>
+ setIsCompleted({ isModal: false, isCertificate: true })
+ }
+ >
+ Close
+ </button>
+ </div>
+ </ModalUi>
+
+ {/* this component is used for signature pad modal */}
+ <SignPad
+ isSignPad={isSignPad}
+ isStamp={isStamp}
+ setIsImageSelect={setIsImageSelect}
+ setIsSignPad={setIsSignPad}
+ setImage={setImage}
+ isImageSelect={isImageSelect}
+ imageRef={imageRef}
+ onImageChange={onImageChange}
+ setSignature={setSignature}
+ image={image}
+ onSaveImage={saveImage}
+ onSaveSign={saveSign}
+ defaultSign={defaultSignImg}
+ myInitial={myInitial}
+ isInitial={isInitial}
+ setIsInitial={setIsInitial}
+ setIsStamp={setIsStamp}
+ />
+ {/* pdf header which contain funish back button */}
+ <Header
+ isPdfRequestFiles={true}
+ pageNumber={pageNumber}
+ allPages={allPages}
+ changePage={changePage}
+ pdfDetails={pdfDetails}
+ signerPos={signerPos}
+ isSigned={isSigned}
+ isCompleted={isCompleted}
+ embedWidgetsData={embedWidgetsData}
+ isShowHeader={true}
+ setIsDecline={setIsDecline}
+ decline={true}
+ currentSigner={currentSigner}
+ pdfUrl={pdfUrl}
+ alreadySign={alreadySign}
+ />
+ {containerWH && (
+ <RenderPdf
+ pageNumber={pageNumber}
+ pdfOriginalWidth={pdfOriginalWidth}
+ pdfNewWidth={pdfNewWidth}
+ setIsSignPad={setIsSignPad}
+ setIsStamp={setIsStamp}
+ setSignKey={setSignKey}
+ pdfDetails={pdfDetails}
+ signerPos={signerPos}
+ successEmail={false}
+ pdfUrl={pdfUrl}
+ numPages={numPages}
+ pageDetails={pageDetails}
+ pdfRequest={true}
+ signerObjectId={signerObjectId}
+ signedSigners={signedSigners}
+ setCurrentSigner={setCurrentSigner}
+ setPdfLoadFail={setPdfLoadFail}
+ pdfLoadFail={pdfLoadFail}
+ setSignerPos={setSignerPos}
+ containerWH={containerWH}
+ setIsInitial={setIsInitial}
+ setValidateAlert={setValidateAlert}
+ unSignedWidgetId={unSignedWidgetId}
+ />
+ )}
+ </div>
+ <div>
+ <div className="signerComponent">
+ <div
+ style={{ maxHeight: window.innerHeight - 70 + "px" }}
+ className="autoSignScroll"
+ >
+ {signedSigners.length > 0 && (
+ <>
+ <div
+ style={{
+ background: themeColor
+ }}
+ className="signedStyle"
+ >
+ Signed by
+ </div>
+ <div style={{ marginTop: "2px" }}>
+ {signedSigners.map((obj, ind) => {
+ return (
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center",
+ padding: "10px 0",
+ background: checkSignerBackColor(obj)
+ }}
+ key={ind}
+ >
+ <div
+ className="signerStyle"
+ style={{
+ background: "#abd1d0",
+ width: 30,
+ height: 30,
+ display: "flex",
+ borderRadius: 30 / 2,
+ justifyContent: "center",
+ alignItems: "center",
+ margin: "0 10px 0 5px"
+ }}
+ >
+ <span
+ style={{
+ fontSize: "12px",
+ textAlign: "center",
+ fontWeight: "bold",
+ color: "black",
+ textTransform: "uppercase"
+ }}
+ >
+ {getFirstLetter(obj.Name)}
+ </span>
+ </div>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column"
+ }}
+ >
+ <span className="userName">{obj.Name}</span>
+ <span className="useEmail">{obj.Email}</span>
+ </div>
+ </div>
+ );
+ })}
+ </div>
+ </>
+ )}
+
+ {unsignedSigners.length > 0 && (
+ <>
+ <div
+ style={{
+ background: themeColor,
+ color: "white",
+ padding: "5px",
+ fontFamily: "sans-serif",
+ marginTop: signedSigners.length > 0 && "20px"
+ }}
+ >
+ Yet to sign
+ </div>
+ <div style={{ marginTop: "5px" }}>
+ {unsignedSigners.map((obj, ind) => {
+ return (
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "row",
+ alignItems: "center",
+ padding: "10px 0",
+ background: checkSignerBackColor(obj)
+ }}
+ key={ind}
+ >
+ <div
+ className="signerStyle"
+ style={{
+ background: "#abd1d0",
+ width: 30,
+ height: 30,
+ display: "flex",
+ borderRadius: 30 / 2,
+ justifyContent: "center",
+ alignItems: "center",
+ margin: "0 10px 0 5px"
+ }}
+ >
+ <span
+ style={{
+ fontSize: "12px",
+ textAlign: "center",
+ fontWeight: "bold",
+ color: "black",
+ textTransform: "uppercase"
+ }}
+ >
+ {getFirstLetter(obj.Name)}
+ </span>
+ </div>
+ <div
+ style={{
+ display: "flex",
+ flexDirection: "column"
+ }}
+ >
+ <span className="userName">{obj.Name}</span>
+ <span className="useEmail">{obj.Email}</span>
+ </div>
+ <hr />
+ </div>
+ );
+ })}
+ </div>
+ </>
+ )}
+ {defaultSignImg && !alreadySign && (
+ <DefaultSignature
+ defaultSignImg={defaultSignImg}
+ setDefaultSignImg={setDefaultSignImg}
+ userObjectId={signerObjectId}
+ setIsLoading={setIsLoading}
+ xyPostion={signerPos}
+ setDefaultSignAlert={setDefaultSignAlert}
+ />
+ )}
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ )}
+
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={validateAlert}
+ title={"Validation alert"}
+ handleClose={() => {
+ setValidateAlert(false);
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>
+ The input does not meet the criteria set by the regular expression.
+ </p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ onClick={() => setValidateAlert(false)}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Close
+ </button>
+ </div>
+ </ModalUi>
+ </DndProvider>
+ );
+}
+
+export default PdfRequestFiles;
diff --git a/apps/OpenSign/src/routes/PlaceHolderSign.js b/apps/OpenSign/src/routes/PlaceHolderSign.js
new file mode 100644
index 000000000..eba378d28
--- /dev/null
+++ b/apps/OpenSign/src/routes/PlaceHolderSign.js
@@ -0,0 +1,1755 @@
+import React, { useState, useRef, useEffect } from "react";
+import axios from "axios";
+import Parse from "parse";
+import "../styles/signature.css";
+import { PDFDocument } from "pdf-lib";
+import { themeColor } from "../constant/const";
+import { DndProvider } from "react-dnd";
+import { HTML5Backend } from "react-dnd-html5-backend";
+import { useDrag, useDrop } from "react-dnd";
+import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
+import WidgetComponent from "../components/pdf/WidgetComponent";
+import Tour from "reactour";
+import loader from "../assets/images/loader2.gif";
+import { useLocation, useParams } from "react-router-dom";
+import Loader from "../components/pdf/Loader";
+import HandleError from "../primitives/HandleError";
+import Nodata from "../primitives/Nodata";
+import SignerListPlace from "../components/pdf/SignerListPlace";
+import Header from "../components/pdf/Header";
+import {
+ pdfNewWidthFun,
+ contractDocument,
+ contractUsers,
+ addZIndex,
+ randomId,
+ defaultWidthHeight,
+ multiSignEmbed,
+ addWidgetOptions
+} from "../constant/Utils";
+import RenderPdf from "../components/pdf/RenderPdf";
+import { useNavigate } from "react-router-dom";
+import PlaceholderCopy from "../components/pdf/PlaceholderCopy";
+import LinkUserModal from "../primitives/LinkUserModal";
+import Title from "../components/Title";
+import TourContentWithBtn from "../primitives/TourContentWithBtn";
+import ModalUi from "../primitives/ModalUi";
+import DropdownWidgetOption from "../components/pdf/DropdownWidgetOption";
+import WidgetNameModal from "../components/pdf/WidgetNameModal";
+
+function PlaceHolderSign() {
+ const navigate = useNavigate();
+ const { state } = useLocation();
+ const [pdfDetails, setPdfDetails] = useState([]);
+ const [isMailSend, setIsMailSend] = useState(false);
+ const [allPages, setAllPages] = useState(null);
+ const numPages = 1;
+ const [pageNumber, setPageNumber] = useState(1);
+ const [signBtnPosition, setSignBtnPosition] = useState([]);
+ const [xySignature, setXYSignature] = useState({});
+ const [dragKey, setDragKey] = useState();
+ const [signersdata, setSignersData] = useState();
+ const [signerObjId, setSignerObjId] = useState();
+ const [signerPos, setSignerPos] = useState([]);
+ const [isSelectListId, setIsSelectId] = useState();
+ const [isSendAlert, setIsSendAlert] = useState({});
+ const [isSend, setIsSend] = useState(false);
+ const [isLoading, setIsLoading] = useState({
+ isLoad: true,
+ message: "This might take some time"
+ });
+ const [handleError, setHandleError] = useState();
+ const [currentId, setCurrentId] = useState("");
+ const [pdfNewWidth, setPdfNewWidth] = useState();
+ const [placeholderTour, setPlaceholderTour] = useState(true);
+ const [checkTourStatus, setCheckTourStatus] = useState(false);
+ const [tourStatus, setTourStatus] = useState([]);
+ const [signerUserId, setSignerUserId] = useState();
+ const [noData, setNoData] = useState(false);
+ const [pdfOriginalWidth, setPdfOriginalWidth] = useState();
+ const [contractName, setContractName] = useState("");
+ const [containerWH, setContainerWH] = useState();
+ const { docId } = useParams();
+ const signRef = useRef(null);
+ const dragRef = useRef(null);
+ const divRef = useRef(null);
+ const [isShowEmail, setIsShowEmail] = useState(false);
+ const [selectedEmail, setSelectedEmail] = useState(false);
+ const [isResize, setIsResize] = useState(false);
+ const [zIndex, setZIndex] = useState(1);
+ const [signKey, setSignKey] = useState();
+ const [pdfLoadFail, setPdfLoadFail] = useState({
+ status: false,
+ type: "load"
+ });
+ const [isPageCopy, setIsPageCopy] = useState(false);
+ const [uniqueId, setUniqueId] = useState("");
+ const [roleName, setRoleName] = useState("");
+ const [isAddUser, setIsAddUser] = useState({});
+ const [signerExistModal, setSignerExistModal] = useState(false);
+ const [isDontShow, setIsDontShow] = useState(false);
+ const [isDragging, setIsDragging] = useState(false);
+ const [showDropdown, setShowDropdown] = useState(false);
+ const [widgetType, setWidgetType] = useState("");
+ const [isUiLoading, setIsUiLoading] = useState(false);
+ const [isRadio, setIsRadio] = useState(false);
+ const [currWidgetsDetails, setCurrWidgetsDetails] = useState([]);
+ const [selectWidgetId, setSelectWidgetId] = useState("");
+ const [isCheckbox, setIsCheckbox] = useState(false);
+ const [isNameModal, setIsNameModal] = useState(false);
+ const [widgetName, setWidgetName] = useState(false);
+ const [mailStatus, setMailStatus] = useState("");
+ const color = [
+ "#93a3db",
+ "#e6c3db",
+ "#c0e3bc",
+ "#bce3db",
+ "#b8ccdb",
+ "#ceb8db",
+ "#ffccff",
+ "#99ffcc",
+ "#cc99ff",
+ "#ffcc99",
+ "#66ccff",
+ "#ffffcc"
+ ];
+
+ const isMobile = window.innerWidth < 767;
+ const [, drop] = useDrop({
+ accept: "BOX",
+ drop: (item, monitor) => addPositionOfSignature(item, monitor),
+ collect: (monitor) => ({
+ isOver: !!monitor.isOver()
+ })
+ });
+
+ const [{ isDragSign }, dragSignature] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 1,
+ text: "signature"
+ },
+
+ collect: (monitor) => ({
+ isDragSign: !!monitor.isDragging()
+ })
+ });
+ const [{ isDragStamp }, dragStamp] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 2,
+ text: "stamp"
+ },
+
+ collect: (monitor) => ({
+ isDragStamp: !!monitor.isDragging()
+ })
+ });
+
+ const rowLevel =
+ localStorage.getItem("rowlevel") &&
+ JSON.parse(localStorage.getItem("rowlevel"));
+ const objectId =
+ rowLevel && rowLevel.id
+ ? rowLevel.id
+ : rowLevel?.objectId && rowLevel.objectId;
+
+ const documentId = docId ? docId : objectId && objectId;
+ const senderUser =
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ ) &&
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ );
+ const jsonSender = JSON.parse(senderUser);
+
+ useEffect(() => {
+ if (documentId) {
+ getDocumentDetails();
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ useEffect(() => {
+ if (divRef.current) {
+ const pdfWidth = pdfNewWidthFun(divRef);
+ setPdfNewWidth(pdfWidth);
+ setContainerWH({
+ width: divRef.current.offsetWidth,
+ height: divRef.current.offsetHeight
+ });
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [divRef.current]);
+
+ //function for get document details
+ const getDocumentDetails = async () => {
+ //getting document details
+ const documentData = await contractDocument(documentId);
+ if (documentData && documentData.length > 0) {
+ // const alreadyPlaceholder =
+ // documentData[0].Placeholders && documentData[0].Placeholders;
+ // if (alreadyPlaceholder && alreadyPlaceholder.length > 0) {
+ // setIsAlreadyPlace(true);
+ // }
+ // setSignersData(documentData[0]);
+ // setIsSelectId(0);
+ // setSignerObjId(documentData[0].Signers[0].objectId);
+ // setContractName(documentData[0].Signers[0].className);
+ setPdfDetails(documentData);
+
+ if (documentData[0].Signers && documentData[0].Signers.length > 0) {
+ const currEmail = documentData[0].ExtUserPtr.Email;
+ setCurrentId(currEmail);
+ setSignerObjId(documentData[0].Signers[0].objectId);
+ setContractName(documentData[0].Signers[0].className);
+ setIsSelectId(0);
+ if (
+ documentData[0].Placeholders &&
+ documentData[0].Placeholders.length > 0
+ ) {
+ setSignerPos(documentData[0].Placeholders);
+ let signers = [...documentData[0].Signers];
+ let updatedSigners = documentData[0].Placeholders.map((x) => {
+ let matchingSigner = signers.find(
+ (y) => x.signerObjId && x.signerObjId === y.objectId
+ );
+
+ if (matchingSigner) {
+ return {
+ ...matchingSigner,
+ Role: x.Role ? x.Role : matchingSigner.Role,
+ Id: x.Id,
+ blockColor: x.blockColor
+ };
+ } else {
+ return {
+ Role: x.Role,
+ Id: x.Id,
+ blockColor: x.blockColor
+ };
+ }
+ });
+ setSignersData(updatedSigners);
+ setUniqueId(updatedSigners[0].Id);
+ } else {
+ const updatedSigners = documentData[0].Signers.map((x, index) => ({
+ ...x,
+ Id: randomId(),
+ Role: "User " + (index + 1)
+ }));
+ setSignersData(updatedSigners);
+ setUniqueId(updatedSigners[0].Id);
+ }
+ } else {
+ setRoleName("User 1");
+ if (
+ documentData[0].Placeholders &&
+ documentData[0].Placeholders.length > 0
+ ) {
+ let updatedSigners = documentData[0].Placeholders.map((x) => {
+ return {
+ Role: x.Role,
+ Id: x.Id,
+ blockColor: x.blockColor
+ };
+ });
+
+ setSignerPos(documentData[0].Placeholders);
+ setSignersData(updatedSigners);
+ setIsSelectId(0);
+ setUniqueId(updatedSigners[0].Id);
+ }
+ }
+ } else if (
+ documentData === "Error: Something went wrong!" ||
+ (documentData.result && documentData.result.error)
+ ) {
+ const loadObj = {
+ isLoad: false
+ };
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ } else {
+ setNoData(true);
+
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ }
+ const res = await contractUsers(jsonSender.email);
+ if (res[0] && res.length) {
+ setSignerUserId(res[0].objectId);
+ const tourstatus = res[0].TourStatus && res[0].TourStatus;
+ if (tourstatus && tourstatus.length > 0) {
+ setTourStatus(tourstatus);
+ const checkTourRecipients = tourstatus.filter(
+ (data) => data.placeholder
+ );
+ if (checkTourRecipients && checkTourRecipients.length > 0) {
+ setCheckTourStatus(checkTourRecipients[0].placeholder);
+ }
+ }
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ } else if (res === "Error: Something went wrong!") {
+ const loadObj = {
+ isLoad: false
+ };
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ } else if (res.length === 0) {
+ setNoData(true);
+
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ }
+ };
+
+ //function for setting position after drop signature button over pdf
+ const addPositionOfSignature = (item, monitor) => {
+ if (item && item.text) {
+ setWidgetName(item.text);
+ }
+ getSignerPos(item, monitor);
+ };
+
+ const getSignerPos = (item, monitor) => {
+ // setSignerObjId("");
+ // setContractName("");
+ if (uniqueId) {
+ const posZIndex = zIndex + 1;
+ setZIndex(posZIndex);
+ const signer = signersdata.find((x) => x.Id === uniqueId);
+ const newWidth = containerWH.width;
+ const scale = pdfOriginalWidth / newWidth;
+ const key = randomId();
+ let dropData = [];
+ let placeHolder;
+ const dragTypeValue = item?.text ? item.text : monitor.type;
+
+ if (item === "onclick") {
+ const dropObj = {
+ //onclick put placeholder center on pdf
+ xPosition: window.innerWidth / 2 - 150,
+ yPosition: window.innerHeight / 2 - 60,
+ isStamp:
+ (dragTypeValue === "stamp" || dragTypeValue === "image") && true,
+ key: key,
+ isDrag: false,
+ scale: scale,
+ isMobile: isMobile,
+ zIndex: posZIndex,
+ type: dragTypeValue,
+ options: addWidgetOptions(dragTypeValue)
+ };
+ dropData.push(dropObj);
+ placeHolder = {
+ pageNumber: pageNumber,
+ pos: dropData
+ };
+ } else {
+ const offset = monitor.getClientOffset();
+ //adding and updating drop position in array when user drop signature button in div
+ const containerRect = document
+ .getElementById("container")
+ .getBoundingClientRect();
+ const x = offset.x - containerRect.left;
+ const y = offset.y - containerRect.top;
+ const dropObj = {
+ xPosition: signBtnPosition[0] ? x - signBtnPosition[0].xPos : x,
+ yPosition: signBtnPosition[0] ? y - signBtnPosition[0].yPos : y,
+ isStamp:
+ (dragTypeValue === "stamp" || dragTypeValue === "image") && true,
+ key: key,
+ scale: scale,
+ isMobile: isMobile,
+ zIndex: posZIndex,
+ type: dragTypeValue,
+ options: addWidgetOptions(dragTypeValue)
+ };
+
+ dropData.push(dropObj);
+ placeHolder = {
+ pageNumber: pageNumber,
+ pos: dropData
+ };
+ }
+
+ setSelectWidgetId(key);
+ if (signer) {
+ let filterSignerPos;
+ if (dragTypeValue === "label") {
+ filterSignerPos = signerPos.filter((data) => data.Role === "prefill");
+ } else {
+ filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
+ }
+
+ const { blockColor, Role } = signer;
+
+ //adding placholder in existing signer pos array (placaholder)
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+ const updatePlace = getPlaceHolder.filter(
+ (data) => data.pageNumber !== pageNumber
+ );
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ //add entry of position for same signer on multiple page
+ if (getPageNumer.length > 0) {
+ const getPos = getPageNumer[0].pos;
+ const newSignPos = getPos.concat(dropData);
+ let xyPos = {
+ pageNumber: pageNumber,
+ pos: newSignPos
+ };
+ updatePlace.push(xyPos);
+ let updatesignerPos;
+ if (dragTypeValue === "label") {
+ updatesignerPos = signerPos.map((x) =>
+ x.Role === "prefill" ? { ...x, placeHolder: updatePlace } : x
+ );
+ } else {
+ updatesignerPos = signerPos.map((x) =>
+ x.Id === uniqueId ? { ...x, placeHolder: updatePlace } : x
+ );
+ }
+
+ setSignerPos(updatesignerPos);
+ } else {
+ let updatesignerPos;
+ if (dragTypeValue === "label") {
+ updatesignerPos = signerPos.map((x) =>
+ x.Role === "prefill"
+ ? { ...x, placeHolder: [...x.placeHolder, placeHolder] }
+ : x
+ );
+ } else {
+ updatesignerPos = signerPos.map((x) =>
+ x.Id === uniqueId
+ ? { ...x, placeHolder: [...x.placeHolder, placeHolder] }
+ : x
+ );
+ }
+ setSignerPos(updatesignerPos);
+ }
+ } else {
+ //adding new placeholder for selected signer in pos array (placeholder)
+ // const signerData = signerPos;
+ let placeHolderPos;
+ if (dragTypeValue === "label") {
+ placeHolderPos = {
+ signerPtr: {},
+ signerObjId: "",
+ blockColor: "#f58f8c",
+ placeHolder: [placeHolder],
+ Role: "prefill",
+ Id: key
+ };
+ } else {
+ if (contractName) {
+ placeHolderPos = {
+ signerPtr: {
+ __type: "Pointer",
+ className: `${contractName}`,
+ objectId: signerObjId
+ },
+ signerObjId: signerObjId,
+ blockColor: blockColor ? blockColor : color[isSelectListId],
+ placeHolder: [placeHolder],
+ Role: Role ? Role : roleName,
+ Id: uniqueId
+ };
+ } else {
+ placeHolderPos = {
+ signerPtr: {},
+ signerObjId: "",
+ blockColor: blockColor ? blockColor : color[isSelectListId],
+ placeHolder: [placeHolder],
+ Role: Role ? Role : roleName,
+ Id: uniqueId
+ };
+ }
+ }
+ setSignerPos((prev) => [...prev, placeHolderPos]);
+ }
+ if (dragTypeValue === "dropdown") {
+ setShowDropdown(true);
+ } else if (dragTypeValue === "checkbox") {
+ setIsCheckbox(true);
+ } else if (dragTypeValue === "radio") {
+ setIsRadio(true);
+ } else if (dragTypeValue !== "label" && dragTypeValue !== "signature") {
+ setIsNameModal(true);
+ }
+ setWidgetType(dragTypeValue);
+ setSignKey(key);
+ }
+ }
+ };
+
+ //function for get pdf page details
+ const pageDetails = async (pdf) => {
+ const load = {
+ status: true
+ };
+ setPdfLoadFail(load);
+ pdf.getPage(1).then((pdfPage) => {
+ const pageWidth = pdfPage.view[2];
+
+ setPdfOriginalWidth(pageWidth);
+ });
+ };
+
+ //function for save x and y position and show signature tab on that position
+ const handleTabDrag = (key) => {
+ setDragKey(key);
+ setIsDragging(true);
+ };
+
+ //function for set and update x and y postion after drag and drop signature tab
+ const handleStop = (event, dragElement, signerId, key) => {
+ if (!isResize && isDragging) {
+ const dataNewPlace = addZIndex(signerPos, key, setZIndex);
+ let updateSignPos = [...signerPos];
+ updateSignPos.splice(0, updateSignPos.length, ...dataNewPlace);
+ // signerPos.splice(0, signerPos.length, ...dataNewPlace);
+ const containerRect = document
+ .getElementById("container")
+ .getBoundingClientRect();
+ const signId = signerId ? signerId : uniqueId; //? signerId : signerObjId;
+ const keyValue = key ? key : dragKey;
+ const ybottom = containerRect.height - dragElement.y;
+
+ if (keyValue >= 0) {
+ let filterSignerPos;
+ if (signId) {
+ filterSignerPos = updateSignPos.filter((data) => data.Id === signId);
+ } else {
+ filterSignerPos = updateSignPos.filter(
+ (data) => data.Role === "prefill"
+ );
+ }
+
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos;
+
+ const getPosData = getXYdata;
+ const addSignPos = getPosData.map((url) => {
+ if (url.key === keyValue) {
+ return {
+ ...url,
+ xPosition: dragElement.x,
+ yPosition: dragElement.y,
+ isDrag: true,
+ yBottom: ybottom
+ };
+ }
+ return url;
+ });
+
+ const newUpdateSignPos = getPlaceHolder.map((obj) => {
+ if (obj.pageNumber === pageNumber) {
+ return { ...obj, pos: addSignPos };
+ }
+ return obj;
+ });
+ const newUpdateSigner = updateSignPos.map((obj) => {
+ if (signId) {
+ if (obj.Id === signId) {
+ return { ...obj, placeHolder: newUpdateSignPos };
+ }
+ } else {
+ if (obj.Role === "prefill") {
+ return { ...obj, placeHolder: newUpdateSignPos };
+ }
+ }
+
+ return obj;
+ });
+
+ setSignerPos(newUpdateSigner);
+ }
+ }
+ }
+ }
+ setTimeout(() => {
+ setIsDragging(false);
+ }, 200);
+ };
+
+ //function for delete signature block
+ const handleDeleteSign = (key, Id) => {
+ const updateData = [];
+ const filterSignerPos = signerPos.filter((data) => data.Id === Id);
+
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos.filter(
+ (data) => data.key !== key
+ );
+
+ if (getXYdata.length > 0) {
+ updateData.push(getXYdata);
+ const newUpdatePos = getPlaceHolder.map((obj) => {
+ if (obj.pageNumber === pageNumber) {
+ return { ...obj, pos: updateData[0] };
+ }
+ return obj;
+ });
+
+ const newUpdateSigner = signerPos.map((obj) => {
+ if (obj.Id === Id) {
+ return { ...obj, placeHolder: newUpdatePos };
+ }
+ return obj;
+ });
+ setSignerPos(newUpdateSigner);
+ } else {
+ const updateFilter = signerPos.filter((data) => data.Id !== Id);
+ const getRemainPage = filterSignerPos[0].placeHolder.filter(
+ (data) => data.pageNumber !== pageNumber
+ );
+
+ if (getRemainPage && getRemainPage.length > 0) {
+ const newUpdatePos = filterSignerPos.map((obj) => {
+ if (obj.Id === Id) {
+ return { ...obj, placeHolder: getRemainPage };
+ }
+ return obj;
+ });
+ let signerupdate = [];
+ signerupdate = signerPos.filter((data) => data.Id !== Id);
+ signerupdate.push(newUpdatePos[0]);
+
+ setSignerPos(signerupdate);
+ } else {
+ setSignerPos(updateFilter);
+ }
+ }
+ }
+ }
+ };
+
+ //function for change page
+ function changePage(offset) {
+ setSignBtnPosition([]);
+ setPageNumber((prevPageNumber) => prevPageNumber + offset);
+ }
+
+ //function for capture position on hover signature button
+ const handleDivClick = (e) => {
+ const divRect = e.currentTarget.getBoundingClientRect();
+ const mouseX = e.clientX - divRect.left;
+ const mouseY = e.clientY - divRect.top;
+
+ const xyPosition = {
+ xPos: mouseX,
+ yPos: mouseY
+ };
+
+ setXYSignature(xyPosition);
+ };
+
+ //function for capture position of x and y on hover signature button last position
+ const handleMouseLeave = () => {
+ setSignBtnPosition([xySignature]);
+ };
+
+ function sanitizeFileName(fileName) {
+ // Remove spaces and invalid characters
+ return fileName.replace(/[^a-zA-Z0-9._-]/g, "");
+ }
+ //embed prefill label widget data
+ const embedPrefilllData = async () => {
+ const prefillExist = signerPos.filter((data) => data.Role === "prefill");
+ if (prefillExist && prefillExist.length > 0) {
+ const placeholder = prefillExist[0].placeHolder;
+ const pdfUrl = pdfDetails[0].URL;
+ const existingPdfBytes = await fetch(pdfUrl).then((res) =>
+ res.arrayBuffer()
+ );
+ const pdfDoc = await PDFDocument.load(existingPdfBytes, {
+ ignoreEncryption: true
+ });
+
+ const flag = false;
+ try {
+ const pdfBytes = await multiSignEmbed(
+ placeholder,
+ pdfDoc,
+ pdfOriginalWidth,
+ flag,
+ containerWH
+ );
+
+ const parseBaseUrl = localStorage.getItem("baseUrl");
+ const parseAppId = localStorage.getItem("parseAppId");
+ Parse.initialize(parseAppId);
+ Parse.serverURL = parseBaseUrl;
+ Parse.initialize(parseAppId);
+ const fileName = sanitizeFileName(pdfDetails[0].Name) + ".pdf";
+ const pdfFile = new Parse.File(fileName, { base64: pdfBytes });
+
+ // Save the Parse File if needed
+ const pdfData = await pdfFile.save();
+ const pdfUrl = pdfData.url();
+ return pdfUrl;
+ } catch (e) {
+ console.log("error", e);
+ }
+ } else {
+ return pdfDetails[0].URL;
+ }
+ };
+
+ const alertSendEmail = async () => {
+ const filterPrefill = signerPos.filter((data) => data.Role !== "prefill");
+ if (filterPrefill.length === signersdata.length) {
+ const IsSignerNotExist = filterPrefill?.some((x) => !x.signerObjId);
+ if (IsSignerNotExist) {
+ setSignerExistModal(true);
+ } else {
+ const alert = {
+ mssg: "confirm",
+ alert: true
+ };
+ setIsSendAlert(alert);
+ }
+ } else {
+ const alert = {
+ mssg: "sure",
+ alert: true
+ };
+ setIsSendAlert(alert);
+ }
+ };
+
+ const sendEmailToSigners = async () => {
+ setIsUiLoading(true);
+ const pdfUrl = await embedPrefilllData();
+ setIsSendAlert({});
+ let sendMail;
+ const expireDate = pdfDetails?.[0].ExpiryDate.iso;
+ const newDate = new Date(expireDate);
+ const localExpireDate = newDate.toLocaleDateString("en-US", {
+ day: "numeric",
+ month: "long",
+ year: "numeric"
+ });
+ let sender = pdfDetails?.[0].ExtUserPtr.Email;
+ let signerMail = signersdata.slice();
+
+ if (pdfDetails?.[0]?.SendinOrder && pdfDetails?.[0]?.SendinOrder === true) {
+ signerMail.splice(1);
+ }
+ for (let i = 0; i < signerMail.length; i++) {
+ try {
+ const imgPng =
+ "https://qikinnovation.ams3.digitaloceanspaces.com/logo.png";
+ let url = `${localStorage.getItem("baseUrl")}functions/sendmailv3/`;
+ const headers = {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessionToken: localStorage.getItem("accesstoken")
+ };
+ const serverUrl = localStorage.getItem("baseUrl");
+ const newServer = serverUrl.replaceAll("/", "%2F");
+ const objectId = signerMail[i].objectId;
+ const serverParams = `${newServer}&${localStorage.getItem(
+ "parseAppId"
+ )}&${localStorage.getItem("_appName")}`;
+
+ const hostUrl = window.location.origin;
+ let signPdf = `${hostUrl}/login/${pdfDetails?.[0].objectId}/${signerMail[i].Email}/${objectId}/${serverParams}`;
+ const openSignUrl = "https://www.opensignlabs.com/";
+ const orgName = pdfDetails[0]?.ExtUserPtr.Company
+ ? pdfDetails[0].ExtUserPtr.Company
+ : "";
+ const themeBGcolor = themeColor;
+ let params = {
+ recipient: signerMail[i].Email,
+ subject: `${pdfDetails?.[0].ExtUserPtr.Name} has requested you to sign ${pdfDetails?.[0].Name}`,
+ from: sender,
+ html:
+ "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' /> </head> <body> <div style='background-color: #f5f5f5; padding: 20px'=> <div style=' box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;background: white;padding-bottom: 20px;'> <div style='padding:10px 10px 0 10px'><img src=" +
+ imgPng +
+ " height='50' style='padding: 20px,width:170px,height:40px' /></div> <div style=' padding: 2px;font-family: system-ui;background-color:" +
+ themeBGcolor +
+ ";'><p style='font-size: 20px;font-weight: 400;color: white;padding-left: 20px;' > Digital Signature Request</p></div><div><p style='padding: 20px;font-family: system-ui;font-size: 14px; margin-bottom: 10px;'> " +
+ pdfDetails?.[0].ExtUserPtr.Name +
+ " has requested you to review and sign <strong> " +
+ pdfDetails?.[0].Name +
+ "</strong>.</p><div style='padding: 5px 0px 5px 25px;display: flex;flex-direction: row;justify-content: space-around;'><table> <tr> <td style='font-weight:bold;font-family:sans-serif;font-size:15px'>Sender</td> <td> </td> <td style='color:#626363;font-weight:bold'>" +
+ sender +
+ "</td></tr><tr><td style='font-weight:bold;font-family:sans-serif;font-size:15px'>Organization</td> <td> </td><td style='color:#626363;font-weight:bold'> " +
+ orgName +
+ "</td></tr> <tr> <td style='font-weight:bold;font-family:sans-serif;font-size:15px'>Expire on</td><td> </td> <td style='color:#626363;font-weight:bold'>" +
+ localExpireDate +
+ "</td></tr><tr> <td></td> <td> </td></tr></table> </div> <div style='margin-left:70px'><a href=" +
+ signPdf +
+ "> <button style='padding: 12px 12px 12px 12px;background-color: #d46b0f;color: white; border: 0px;box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px,rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;font-weight:bold;margin-top:30px'>Sign here</button></a> </div> <div style='display: flex; justify-content: center;margin-top: 10px;'> </div></div></div><div><p> This is an automated email from OpenSignâ„¢. For any queries regarding this email, please contact the sender " +
+ sender +
+ " directly.If you think this email is inappropriate or spam, you may file a complaint with OpenSignâ„¢ <a href= " +
+ openSignUrl +
+ " target=_blank>here</a>.</p> </div></div></body> </html>"
+ };
+ sendMail = await axios.post(url, params, { headers: headers });
+ } catch (error) {
+ console.log("error", error);
+ }
+ }
+
+ if (sendMail.data.result.status === "success") {
+ setMailStatus("success");
+ const signers = signersdata?.map((x) => {
+ return {
+ __type: "Pointer",
+ className: "contracts_Contactbook",
+ objectId: x.objectId
+ };
+ });
+ const addExtraDays = pdfDetails[0]?.TimeToCompleteDays
+ ? pdfDetails[0].TimeToCompleteDays
+ : 15;
+ const currentUser = signersdata.find((x) => x.Email === currentId);
+ setCurrentId(currentUser?.objectId);
+ let updateExpiryDate, data;
+ updateExpiryDate = new Date();
+ updateExpiryDate.setDate(updateExpiryDate.getDate() + addExtraDays);
+ //filter label widgets after add label widgets data on pdf
+ const filterPrefill = signerPos.filter((data) => data.Role !== "prefill");
+
+ try {
+ if (updateExpiryDate) {
+ data = {
+ Placeholders: filterPrefill,
+ SignedUrl: pdfUrl,
+ Signers: signers,
+ ExpiryDate: {
+ iso: updateExpiryDate,
+ __type: "Date"
+ }
+ };
+ } else {
+ data = {
+ Placeholders: filterPrefill,
+ SignedUrl: pdfUrl,
+ Signers: signers
+ };
+ }
+
+ await axios
+ .put(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Document/${documentId}`,
+ data,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then(() => {
+ setIsSend(true);
+ setIsMailSend(true);
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ setIsUiLoading(false);
+ })
+ .catch((err) => {
+ console.log("axois err ", err);
+ });
+ } catch (e) {
+ console.log("error", e);
+ }
+ } else {
+ setMailStatus("failed");
+ const signers = signersdata?.map((x) => {
+ return {
+ __type: "Pointer",
+ className: "contracts_Contactbook",
+ objectId: x.objectId
+ };
+ });
+ const addExtraDays = pdfDetails[0]?.TimeToCompleteDays
+ ? pdfDetails[0].TimeToCompleteDays
+ : 15;
+ const currentUser = signersdata.find((x) => x.Email === currentId);
+ setCurrentId(currentUser?.objectId);
+ let updateExpiryDate, data;
+ updateExpiryDate = new Date();
+ updateExpiryDate.setDate(updateExpiryDate.getDate() + addExtraDays);
+ const filterPrefill = signerPos.filter((data) => data.Role !== "prefill");
+
+ try {
+ if (updateExpiryDate) {
+ data = {
+ Placeholders: filterPrefill,
+ SignedUrl: pdfUrl,
+ Signers: signers,
+ ExpiryDate: {
+ iso: updateExpiryDate,
+ __type: "Date"
+ }
+ };
+ } else {
+ data = {
+ Placeholders: filterPrefill,
+ SignedUrl: pdfUrl,
+ Signers: signers
+ };
+ }
+
+ await axios
+ .put(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Document/${documentId}`,
+ data,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then(() => {
+ setIsSend(true);
+ setIsMailSend(true);
+ setIsUiLoading(false);
+ })
+ .catch((err) => {
+ console.log("axois err ", err);
+ });
+ } catch (e) {
+ console.log("error", e);
+ }
+ }
+ };
+ const handleDontShow = (isChecked) => {
+ setIsDontShow(isChecked);
+ };
+ //here you can add your messages in content and selector is key of particular steps
+
+ const tourConfig = [
+ {
+ selector: '[data-tut="reactourFirst"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Select a recipient from this list to add a place-holder where he is supposed to sign.The placeholder will appear in the same colour as the recipient name once you drop it on the document.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ },
+ {
+ selector: '[data-tut="reactourSecond"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Drag the signature or stamp placeholder onto the PDF to choose your desired signing location.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ },
+ {
+ selector: '[data-tut="reactourThird"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`The PDF content area already displays the template's existing placeholders. For your convenience, these placeholders will match the color of the recipient's name, making them easily identifiable.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ },
+ {
+ selector: '[data-tut="reactourLinkUser"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Use this icon to assign a new signer or change the existing one for the placeholder.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ },
+ {
+ selector: '[data-tut="reactourFour"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Clicking "Send" button will share the document with all the recipients.It will also send out emails to everyone on the recipients list.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ }
+ ];
+
+ const handleSaveWidgetsOptions = (
+ dropdownName,
+ dropdownOptions,
+ minCount,
+ maxCount,
+ isReadOnly,
+ addOption,
+ deleteOption,
+ status,
+ defaultValue
+ ) => {
+ const filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos;
+
+ const getPosData = getXYdata;
+ const addSignPos = getPosData.map((position) => {
+ if (position.key === signKey) {
+ if (widgetType === "radio") {
+ if (addOption) {
+ return {
+ ...position,
+ Height: position.Height
+ ? position.Height + 15
+ : defaultWidthHeight(widgetType).height + 15
+ };
+ } else if (deleteOption) {
+ return {
+ ...position,
+ Height: position.Height
+ ? position.Height - 15
+ : defaultWidthHeight(widgetType).height - 15
+ };
+ } else {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: dropdownName,
+ values: dropdownOptions,
+ isReadOnly: isReadOnly,
+ defaultValue: defaultValue
+ }
+ };
+ }
+ } else if (widgetType === "checkbox") {
+ if (addOption) {
+ return {
+ ...position,
+ Height: position.Height
+ ? position.Height + 15
+ : defaultWidthHeight(widgetType).height + 15
+ };
+ } else if (deleteOption) {
+ return {
+ ...position,
+ Height: position.Height
+ ? position.Height - 15
+ : defaultWidthHeight(widgetType).height - 15
+ };
+ } else {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: dropdownName,
+ values: dropdownOptions,
+ validation: {
+ minRequiredCount: minCount,
+ maxRequiredCount: maxCount
+ },
+ defaultValue: defaultValue,
+ isReadOnly: isReadOnly
+ }
+ };
+ }
+ } else {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: dropdownName,
+ status: status,
+ values: dropdownOptions,
+ defaultValue: defaultValue
+ }
+ };
+ }
+ }
+ return position;
+ });
+
+ const newUpdateSignPos = getPlaceHolder.map((obj) => {
+ if (obj.pageNumber === pageNumber) {
+ return { ...obj, pos: addSignPos };
+ }
+ return obj;
+ });
+ const newUpdateSigner = signerPos.map((obj) => {
+ if (obj.Id === uniqueId) {
+ return { ...obj, placeHolder: newUpdateSignPos };
+ }
+ return obj;
+ });
+
+ setSignerPos(newUpdateSigner);
+ }
+ }
+ };
+
+ const handleWidgetdefaultdata = (defaultdata) => {
+ const options = ["email", "number", "text"];
+ let inputype;
+ if (defaultdata.textvalidate) {
+ inputype = options.includes(defaultdata.textvalidate)
+ ? defaultdata.textvalidate
+ : "regex";
+ } else {
+ inputype = "text";
+ }
+
+ const filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos;
+ const getPosData = getXYdata;
+ const addSignPos = getPosData.map((position) => {
+ if (position.key === signKey) {
+ if (position.type === "text") {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: defaultdata?.name || "text",
+ status: defaultdata?.status || "required",
+ hint: defaultdata?.hint || "",
+ defaultValue: defaultdata?.defaultValue || "",
+ validation: {
+ type: inputype,
+ pattern:
+ inputype === "regex" ? defaultdata.textvalidate : ""
+ }
+ }
+ };
+ } else {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: defaultdata.name,
+ status: defaultdata.status,
+ defaultValue: defaultdata.defaultValue
+ }
+ };
+ }
+ }
+ return position;
+ });
+
+ const newUpdateSignPos = getPlaceHolder.map((obj) => {
+ if (obj.pageNumber === pageNumber) {
+ return { ...obj, pos: addSignPos };
+ }
+ return obj;
+ });
+ const newUpdateSigner = signerPos.map((obj) => {
+ if (obj.Id === uniqueId) {
+ return { ...obj, placeHolder: newUpdateSignPos };
+ }
+ return obj;
+ });
+ setSignerPos(newUpdateSigner);
+ }
+ }
+ setCurrWidgetsDetails({});
+ handleNameModal();
+ };
+
+ const handleNameModal = () => {
+ setIsNameModal(!isNameModal);
+ setCurrWidgetsDetails({});
+ };
+ //function for update TourStatus
+ const closeTour = async () => {
+ setPlaceholderTour(false);
+ if (isDontShow) {
+ const extUserClass = localStorage.getItem("extended_class");
+ let updatedTourStatus = [];
+ if (tourStatus.length > 0) {
+ updatedTourStatus = [...tourStatus];
+ const placeholderIndex = tourStatus.findIndex(
+ (obj) => obj["placeholder"] === false || obj["placeholder"] === true
+ );
+ if (placeholderIndex !== -1) {
+ updatedTourStatus[placeholderIndex] = { placeholder: true };
+ } else {
+ updatedTourStatus.push({ placeholder: true });
+ }
+ } else {
+ updatedTourStatus = [{ placeholder: true }];
+ }
+ await axios
+ .put(
+ `${localStorage.getItem(
+ "baseUrl"
+ )}classes/${extUserClass}/${signerUserId}`,
+ {
+ TourStatus: updatedTourStatus
+ },
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessionToken: localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then(() => {
+ // const json = Listdata.data;
+ // const res = json.results;
+ })
+ .catch((err) => {
+ console.log("axois err ", err);
+ });
+ }
+ };
+ const handleRecipientSign = () => {
+ navigate(`/recipientSignPdf/${documentId}/${currentId}`);
+ };
+
+ const handleLinkUser = (id) => {
+ setIsAddUser({ [id]: true });
+ };
+ const handleAddUser = (data) => {
+ if (data && data.objectId) {
+ const signerPtr = {
+ __type: "Pointer",
+ className: "contracts_Contactbook",
+ objectId: data.objectId
+ };
+ const updatePlaceHolder = signerPos.map((x) => {
+ if (x.Id === uniqueId) {
+ return { ...x, signerPtr: signerPtr, signerObjId: data.objectId };
+ }
+ return { ...x };
+ });
+
+ setSignerPos(updatePlaceHolder);
+
+ const updateSigner = signersdata.map((x) => {
+ if (x.Id === uniqueId) {
+ return { ...x, ...data, className: "contracts_Contactbook" };
+ }
+ return { ...x };
+ });
+ if (updateSigner && updateSigner.length > 0) {
+ const currEmail = pdfDetails[0].ExtUserPtr.Email;
+ const getCurrentUserDeatils = updateSigner.filter(
+ (x) => x.Email === currEmail
+ );
+ if (getCurrentUserDeatils && getCurrentUserDeatils.length > 0) {
+ setCurrentId(getCurrentUserDeatils[0].Email);
+ }
+ }
+
+ setSignersData(updateSigner);
+ const index = signersdata.findIndex((x) => x.Id === uniqueId);
+ setIsSelectId(index);
+ }
+ };
+
+ const closePopup = () => {
+ setIsAddUser({});
+ };
+
+ return (
+ <>
+ <Title title={state?.title ? state.title : "New Document"} />
+ <DndProvider backend={HTML5Backend}>
+ {isLoading.isLoad ? (
+ <Loader isLoading={isLoading} />
+ ) : handleError ? (
+ <HandleError handleError={handleError} />
+ ) : noData ? (
+ <Nodata />
+ ) : (
+ <div className="signatureContainer" ref={divRef}>
+ {isUiLoading && (
+ <div
+ style={{
+ position: "absolute",
+ height: "100vh",
+ width: "100%",
+ display: "flex",
+ justifyContent: "center",
+ flexDirection: "column",
+ alignItems: "center",
+ zIndex: "999",
+ backgroundColor: "#e6f2f2",
+ opacity: 0.8
+ }}
+ >
+ <img
+ alt="no img"
+ src={loader}
+ style={{ width: "100px", height: "100px" }}
+ />
+ <span style={{ fontSize: "13px", fontWeight: "bold" }}>
+ This might take some time
+ </span>
+ </div>
+ )}
+ {/* this component used for UI interaction and show their functionality */}
+ {!checkTourStatus && (
+ //this tour component used in your html component where you want to put
+ //onRequestClose function to close tour
+ //steps is defined what will be your messages and style also
+ //isOpen is takes boolean value to open
+ <Tour
+ onRequestClose={closeTour}
+ steps={tourConfig}
+ isOpen={placeholderTour}
+ rounded={5}
+ closeWithMask={false}
+ />
+ )}
+ {/* this component used to render all pdf pages in left side */}
+ <RenderAllPdfPage
+ signPdfUrl={pdfDetails[0].URL}
+ allPages={allPages}
+ setAllPages={setAllPages}
+ setPageNumber={setPageNumber}
+ setSignBtnPosition={setSignBtnPosition}
+ pageNumber={pageNumber}
+ />
+
+ {/* pdf render view */}
+ <div
+ style={{
+ marginLeft: !isMobile && pdfOriginalWidth > 500 && "20px",
+ marginRight: !isMobile && pdfOriginalWidth > 500 && "20px"
+ }}
+ >
+ {/* this modal is used show alert set placeholder for all signers before send mail */}
+
+ <ModalUi
+ headerColor={
+ isSendAlert.mssg === "sure"
+ ? "#dc3545"
+ : isSendAlert.mssg === "confirm" && themeColor
+ }
+ isOpen={isSendAlert.alert}
+ title={
+ isSendAlert.mssg === "sure"
+ ? "Fields required"
+ : isSendAlert.mssg === "confirm" && "Send Mail"
+ }
+ handleClose={() => setIsSendAlert({})}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ {isSendAlert.mssg === "sure" ? (
+ <p>Please add field for all recipients.</p>
+ ) : (
+ isSendAlert.mssg === "confirm" && (
+ <p>
+ Are you sure you want to send out this document for
+ signatures?
+ </p>
+ )
+ )}
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+
+ {isSendAlert.mssg === "confirm" && (
+ <button
+ onClick={() => sendEmailToSigners()}
+ style={{
+ background: themeColor
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Yes
+ </button>
+ )}
+ <button
+ onClick={() => setIsSendAlert({})}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Close
+ </button>
+ </div>
+ </ModalUi>
+
+ {/* this modal is used show send mail message and after send mail success message */}
+ <ModalUi
+ isOpen={isSend}
+ title={"Mails Sent"}
+ handleClose={() => {
+ setIsSend(false);
+ setSignerPos([]);
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ {mailStatus === "success" ? (
+ <p>You have successfully sent mails to all recipients!</p>
+ ) : (
+ <p>Please setup mail adapter to send mail!</p>
+ )}
+ {currentId && (
+ <p>Do you want to sign documents right now ?</p>
+ )}
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ {currentId ? (
+ <>
+ <button
+ onClick={() => {
+ handleRecipientSign();
+ }}
+ style={{
+ background: themeColor,
+ color: "white"
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Yes
+ </button>
+ <button
+ onClick={() => {
+ setIsSend(false);
+ setSignerPos([]);
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ No
+ </button>
+ </>
+ ) : (
+ <button
+ onClick={() => {
+ setIsSend(false);
+ setSignerPos([]);
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Close
+ </button>
+ )}
+ </div>
+ </ModalUi>
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={isShowEmail}
+ title={"signers alert"}
+ handleClose={() => {
+ setIsShowEmail(false);
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>Please select signer for add placeholder!</p>
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ onClick={() => {
+ setIsShowEmail(false);
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Ok
+ </button>
+ </div>
+ </ModalUi>
+ <PlaceholderCopy
+ isPageCopy={isPageCopy}
+ setIsPageCopy={setIsPageCopy}
+ xyPostion={signerPos}
+ setXyPostion={setSignerPos}
+ allPages={allPages}
+ pageNumber={pageNumber}
+ signKey={signKey}
+ // signerObjId={signerObjId}
+ Id={uniqueId}
+ />
+ <DropdownWidgetOption
+ type="radio"
+ title="Radio group"
+ showDropdown={isRadio}
+ setShowDropdown={setIsRadio}
+ handleSaveWidgetsOptions={handleSaveWidgetsOptions}
+ currWidgetsDetails={currWidgetsDetails}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ />
+ <DropdownWidgetOption
+ type="checkbox"
+ title="Checkbox"
+ showDropdown={isCheckbox}
+ setShowDropdown={setIsCheckbox}
+ handleSaveWidgetsOptions={handleSaveWidgetsOptions}
+ currWidgetsDetails={currWidgetsDetails}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ />
+ <DropdownWidgetOption
+ type="dropdown"
+ title="Dropdown options"
+ showDropdown={showDropdown}
+ setShowDropdown={setShowDropdown}
+ handleSaveWidgetsOptions={handleSaveWidgetsOptions}
+ currWidgetsDetails={currWidgetsDetails}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ />
+
+ {/* pdf header which contain funish back button */}
+ <Header
+ isPlaceholder={true}
+ pageNumber={pageNumber}
+ allPages={allPages}
+ changePage={changePage}
+ pdfDetails={pdfDetails}
+ signerPos={signerPos}
+ signersdata={signersdata}
+ isMailSend={isMailSend}
+ alertSendEmail={alertSendEmail}
+ isShowHeader={true}
+ currentSigner={true}
+ dataTut4="reactourFour"
+ />
+ <div data-tut="reactourThird">
+ {containerWH && (
+ <RenderPdf
+ pageNumber={pageNumber}
+ pdfOriginalWidth={pdfOriginalWidth}
+ pdfNewWidth={pdfNewWidth}
+ pdfDetails={pdfDetails}
+ signerPos={signerPos}
+ successEmail={false}
+ numPages={numPages}
+ pageDetails={pageDetails}
+ placeholder={true}
+ drop={drop}
+ handleDeleteSign={handleDeleteSign}
+ handleTabDrag={handleTabDrag}
+ handleStop={handleStop}
+ setPdfLoadFail={setPdfLoadFail}
+ pdfLoadFail={pdfLoadFail}
+ setSignerPos={setSignerPos}
+ containerWH={containerWH}
+ setIsResize={setIsResize}
+ setZIndex={setZIndex}
+ setIsPageCopy={setIsPageCopy}
+ signersdata={signersdata}
+ setSignKey={setSignKey}
+ setSignerObjId={setSignerObjId}
+ handleLinkUser={handleLinkUser}
+ setUniqueId={setUniqueId}
+ isDragging={isDragging}
+ setShowDropdown={setShowDropdown}
+ setWidgetType={setWidgetType}
+ setIsRadio={setIsRadio}
+ setIsCheckbox={setIsCheckbox}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ setSelectWidgetId={setSelectWidgetId}
+ selectWidgetId={selectWidgetId}
+ handleNameModal={handleNameModal}
+ />
+ )}
+ </div>
+ </div>
+
+ {/* signature button */}
+ {isMobile ? (
+ <div>
+ <WidgetComponent
+ dataTut="reactourFirst"
+ dataTut2="reactourSecond"
+ pdfUrl={isMailSend}
+ dragSignature={dragSignature}
+ signRef={signRef}
+ handleDivClick={handleDivClick}
+ handleMouseLeave={handleMouseLeave}
+ isDragSign={isDragSign}
+ themeColor={themeColor}
+ dragStamp={dragStamp}
+ dragRef={dragRef}
+ isDragStamp={isDragStamp}
+ isSignYourself={false}
+ addPositionOfSignature={addPositionOfSignature}
+ signerPos={signerPos}
+ signersdata={signersdata}
+ isSelectListId={isSelectListId}
+ setSignerObjId={setSignerObjId}
+ setIsSelectId={setIsSelectId}
+ setContractName={setContractName}
+ isSigners={true}
+ setIsShowEmail={setIsShowEmail}
+ isMailSend={isMailSend}
+ setSelectedEmail={setSelectedEmail}
+ selectedEmail={selectedEmail}
+ setUniqueId={setUniqueId}
+ setRoleName={setRoleName}
+ initial={true}
+ />
+ </div>
+ ) : (
+ <div>
+ <div className="signerComponent">
+ <div
+ style={{ maxHeight: window.innerHeight - 70 + "px" }}
+ className="autoSignScroll"
+ >
+ <SignerListPlace
+ signerPos={signerPos}
+ signersdata={signersdata}
+ isSelectListId={isSelectListId}
+ setSignerObjId={setSignerObjId}
+ setIsSelectId={setIsSelectId}
+ setContractName={setContractName}
+ setUniqueId={setUniqueId}
+ setRoleName={setRoleName}
+ // handleAddSigner={handleAddSigner}
+ />
+ <div data-tut="reactourSecond">
+ <WidgetComponent
+ pdfUrl={isMailSend}
+ dragSignature={dragSignature}
+ signRef={signRef}
+ handleDivClick={handleDivClick}
+ handleMouseLeave={handleMouseLeave}
+ isDragSign={isDragSign}
+ themeColor={themeColor}
+ dragStamp={dragStamp}
+ dragRef={dragRef}
+ isDragStamp={isDragStamp}
+ isSignYourself={false}
+ addPositionOfSignature={addPositionOfSignature}
+ initial={true}
+ />
+ </div>
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ )}
+ </DndProvider>
+ <div>
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={signerExistModal}
+ title={"Users required"}
+ handleClose={() => {
+ setSignerExistModal(false);
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>Please assign signers to all placeholders</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ onClick={() => setSignerExistModal(false)}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Close
+ </button>
+ </div>
+ </ModalUi>
+
+ <LinkUserModal
+ handleAddUser={handleAddUser}
+ isAddUser={isAddUser}
+ uniqueId={uniqueId}
+ closePopup={closePopup}
+ />
+ <WidgetNameModal
+ widgetName={widgetName}
+ defaultdata={currWidgetsDetails}
+ isOpen={isNameModal}
+ handleClose={handleNameModal}
+ handleData={handleWidgetdefaultdata}
+ />
+ </div>
+ </>
+ );
+}
+
+export default PlaceHolderSign;
diff --git a/apps/OpenSign/src/routes/RemoteApp.js b/apps/OpenSign/src/routes/RemoteApp.js
deleted file mode 100644
index 08c2943c0..000000000
--- a/apps/OpenSign/src/routes/RemoteApp.js
+++ /dev/null
@@ -1,87 +0,0 @@
-import { Suspense } from "react";
-import { useParams } from "react-router-dom";
-import useFederatedComponent from "mf-cra";
-import React from "react";
-import Title from "../components/Title";
-function RemoteApp({ app }) {
- // console.log("app ", app);
- const { Component: RemoteComponent } = useFederatedComponent(app);
- // console.log("RemoteComponent ", RemoteComponent);
- return (
- <>
- <Title title={app.remoteName} />
- <Suspense
- fallback={
- <div style={{ height: "300px" }}>
- <div
- style={{
- marginLeft: "45%",
- marginTop: "150px",
- fontSize: "45px",
- color: "#3dd3e0"
- }}
- className="loader-37"
- ></div>
- </div>
- }
- >
- <div
- style={{
- boxShadow: "0 1px 3px 0 rgba(0, 0, 0, 0.33)",
- backgroundColor: "#ffffff",
- width: "100%",
- overflow: "hidden",
- borderRadius: 3,
- minHeight: "70vh"
- }}
- >
- {RemoteComponent && <RemoteComponent />}
- </div>
- </Suspense>
- </>
- );
-}
-function checkObjectProperties(obj) {
- // Check if all three properties exist in the object
- if (
- obj &&
- obj.remoteName !== undefined &&
- obj.remoteUrl !== undefined &&
- obj.moduleToLoad !== undefined
- ) {
- return true; // All properties are present
- } else {
- return false; // At least one property is missing
- }
-}
-export default function RemoteAppContainer() {
- const { remoteApp } = useParams();
- // console.log("remoteApp ", remoteApp);
-
- let paramString = remoteApp;
- let queryString = new URLSearchParams(paramString);
- let obj = {};
- for (const [key, value] of queryString.entries()) {
- // console.log("value ", key + ":" + value);
-
- if (key === "remoteUrl") {
- const url = window.location.origin + "/mfbuild/remoteEntry.js";
- // console.log("atob(value) ", atob(value))
- obj = { ...obj, [key]: url };
- } else {
- if (key === "moduleToLoad") {
- obj = { ...obj, [key]: "./" + value };
- } else {
- obj = { ...obj, [key]: value };
- }
- }
- }
- // console.log("obj ", obj);
- const isMf = checkObjectProperties(obj);
- if (isMf) {
- const appToLoad = obj;
- return <RemoteApp app={appToLoad} />;
- } else {
- return <div>App not found</div>;
- }
-}
diff --git a/apps/OpenSign/src/routes/SignyourselfPdf.js b/apps/OpenSign/src/routes/SignyourselfPdf.js
new file mode 100644
index 000000000..3b0ca005b
--- /dev/null
+++ b/apps/OpenSign/src/routes/SignyourselfPdf.js
@@ -0,0 +1,1247 @@
+import React, { useState, useRef, useEffect } from "react";
+import { PDFDocument } from "pdf-lib";
+import "../styles/signature.css";
+import { themeColor } from "../constant/const";
+import axios from "axios";
+import moment from "moment";
+import Loader from "../components/pdf/Loader";
+import loader from "../assets/images/loader2.gif";
+import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
+import { DndProvider } from "react-dnd";
+import { HTML5Backend } from "react-dnd-html5-backend";
+import { useDrag, useDrop } from "react-dnd";
+import SignPad from "../components/pdf/SignPad";
+import EmailComponent from "../components/pdf/EmailComponent";
+import WidgetComponent from "../components/pdf/WidgetComponent";
+import {
+ contractDocument,
+ embedDocId,
+ multiSignEmbed,
+ pdfNewWidthFun,
+ onImageSelect,
+ calculateInitialWidthHeight,
+ defaultWidthHeight,
+ onSaveImage,
+ onSaveSign,
+ contractUsers,
+ contactBook
+} from "../constant/Utils";
+import { useParams } from "react-router-dom";
+import Tour from "reactour";
+import Signedby from "../components/pdf/Signedby";
+import HandleError from "../primitives/HandleError";
+import Nodata from "../primitives/Nodata";
+import Header from "../components/pdf/Header";
+import RenderPdf from "../components/pdf/RenderPdf";
+import PlaceholderCopy from "../components/pdf/PlaceholderCopy";
+import TourContentWithBtn from "../primitives/TourContentWithBtn";
+import Title from "../components/Title";
+import ModalUi from "../primitives/ModalUi";
+import DropdownWidgetOption from "../components/pdf/DropdownWidgetOption";
+
+//For signYourself inProgress section signer can add sign and complete doc sign.
+function SignYourSelf() {
+ const [pdfDetails, setPdfDetails] = useState([]);
+ const [isSignPad, setIsSignPad] = useState(false);
+ const [allPages, setAllPages] = useState(null);
+ const [pdfUrl, setPdfUrl] = useState();
+ const [xyPostion, setXyPostion] = useState([]);
+ const [defaultSignImg, setDefaultSignImg] = useState();
+ const numPages = 1;
+ const [pageNumber, setPageNumber] = useState(1);
+ const [image, setImage] = useState(null);
+ const [isImageSelect, setIsImageSelect] = useState(false);
+ const [signature, setSignature] = useState();
+ const [isStamp, setIsStamp] = useState(false);
+ const [isEmail, setIsEmail] = useState(false);
+ const [signBtnPosition, setSignBtnPosition] = useState([]);
+ const [xySignature, setXYSignature] = useState({});
+ const signRef = useRef(null);
+ const dragRef = useRef(null);
+ const [dragKey, setDragKey] = useState();
+ const [signKey, setSignKey] = useState();
+ const [imgWH, setImgWH] = useState({});
+ const [isCeleb, setIsCeleb] = useState(false);
+ const [pdfNewWidth, setPdfNewWidth] = useState();
+ const [pdfOriginalWidth, setPdfOriginalWidth] = useState();
+ const [successEmail, setSuccessEmail] = useState(false);
+ const imageRef = useRef(null);
+ const [documentStatus, setDocumentStatus] = useState({ isCompleted: false });
+ const [myInitial, setMyInitial] = useState("");
+ const [isInitial, setIsInitial] = useState(false);
+ const [isUiLoading, setIsUiLoading] = useState(false);
+ const [isLoading, setIsLoading] = useState({
+ isLoad: true,
+ message: "This might take some time"
+ });
+ const [handleError, setHandleError] = useState();
+ const [isDragging, setIsDragging] = useState(false);
+ const [signTour, setSignTour] = useState(true);
+ const { docId } = useParams();
+ const [checkTourStatus, setCheckTourStatus] = useState(false);
+ const [signerUserId, setSignerUserId] = useState();
+ const [tourStatus, setTourStatus] = useState([]);
+ const [noData, setNoData] = useState(false);
+ const [contractName, setContractName] = useState("");
+ const [containerWH, setContainerWH] = useState({});
+ const [isPageCopy, setIsPageCopy] = useState(false);
+ const [selectWidgetId, setSelectWidgetId] = useState("");
+ const [showAlreadySignDoc, setShowAlreadySignDoc] = useState({
+ status: false
+ });
+ const [currWidgetsDetails, setCurrWidgetsDetails] = useState([]);
+ const [isCheckbox, setIsCheckbox] = useState(false);
+ const [widgetType, setWidgetType] = useState("");
+ const [pdfLoadFail, setPdfLoadFail] = useState({
+ status: false,
+ type: "load"
+ });
+ const [isAlert, setIsAlert] = useState({ isShow: false, alertMessage: "" });
+ const [isDontShow, setIsDontShow] = useState(false);
+ const divRef = useRef(null);
+ const nodeRef = useRef(null);
+ const [, drop] = useDrop({
+ accept: "BOX",
+ drop: (item, monitor) => addPositionOfSignature(item, monitor),
+ collect: (monitor) => ({
+ isOver: !!monitor.isOver()
+ })
+ });
+ const isMobile = window.innerWidth < 767;
+
+ const pdfRef = useRef();
+
+ const [{ isDragSign }, dragSignature] = useDrag({
+ type: "BOX",
+ item: {
+ id: 1,
+ text: "signature"
+ },
+ collect: (monitor) => ({
+ isDragSign: !!monitor.isDragging()
+ })
+ });
+
+ const [{ isDragStamp }, dragStamp] = useDrag({
+ type: "BOX",
+ item: {
+ id: 2,
+ text: "stamp"
+ },
+
+ collect: (monitor) => ({
+ isDragStamp: !!monitor.isDragging()
+ })
+ });
+
+ const index = xyPostion.findIndex((object) => {
+ return object.pageNumber === pageNumber;
+ });
+ // rowlevel={JSON.parse(localStorage.getItem("rowlevel"))}
+
+ const rowLevel =
+ localStorage.getItem("rowlevel") &&
+ JSON.parse(localStorage.getItem("rowlevel"));
+
+ const signObjId =
+ rowLevel && rowLevel?.id
+ ? rowLevel.id
+ : rowLevel?.objectId && rowLevel.objectId;
+
+ const documentId = docId ? docId : signObjId && signObjId;
+ const senderUser =
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ ) &&
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ );
+ const jsonSender = JSON.parse(senderUser);
+
+ useEffect(() => {
+ getDocumentDetails(true);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
+ useEffect(() => {
+ if (divRef.current) {
+ const pdfWidth = pdfNewWidthFun(divRef);
+ setPdfNewWidth(pdfWidth);
+ setContainerWH({
+ width: divRef.current.offsetWidth,
+ height: divRef.current.offsetHeight
+ });
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [divRef.current]);
+
+ //function for get document details for perticular signer with signer'object id
+ const getDocumentDetails = async (showComplete) => {
+ //getting document details
+ const documentData = await contractDocument(documentId);
+
+ if (documentData && documentData.length > 0) {
+ setPdfDetails(documentData);
+
+ const isCompleted =
+ documentData[0].IsCompleted && documentData[0].IsCompleted;
+ if (isCompleted) {
+ const docStatus = {
+ isCompleted: isCompleted
+ };
+ setDocumentStatus(docStatus);
+ setPdfUrl(documentData[0].SignedUrl);
+ const alreadySign = {
+ status: true,
+ mssg: "You have successfully signed the document!"
+ };
+ if (showComplete) {
+ setShowAlreadySignDoc(alreadySign);
+ } else {
+ setIsUiLoading(false);
+ setIsSignPad(false);
+ setIsEmail(true);
+ setXyPostion([]);
+ setSignBtnPosition([]);
+ }
+ }
+ } else if (
+ documentData === "Error: Something went wrong!" ||
+ (documentData.result && documentData.result.error)
+ ) {
+ const loadObj = {
+ isLoad: false
+ };
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ } else {
+ setNoData(true);
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ }
+ await axios
+ .get(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Signature?where={"UserId": {"__type": "Pointer","className": "_User", "objectId":"${
+ jsonSender.objectId
+ }"}}`,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then((Listdata) => {
+ const json = Listdata.data;
+ const res = json.results;
+ if (res[0] && res.length > 0) {
+ setDefaultSignImg(res[0].ImageURL);
+ setMyInitial(res[0]?.Initials);
+ }
+ })
+ .catch((err) => {
+ console.log("Err ", err);
+ const loadObj = {
+ isLoad: false
+ };
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ });
+
+ const contractUsersRes = await contractUsers(jsonSender.email);
+
+ if (contractUsersRes[0] && contractUsersRes.length > 0) {
+ setContractName("_Users");
+ setSignerUserId(contractUsersRes[0].objectId);
+ const tourstatuss =
+ contractUsersRes[0].TourStatus && contractUsersRes[0].TourStatus;
+
+ if (tourstatuss && tourstatuss.length > 0) {
+ setTourStatus(tourstatuss);
+ const checkTourRecipients = tourstatuss.filter(
+ (data) => data.signyourself
+ );
+ if (checkTourRecipients && checkTourRecipients.length > 0) {
+ setCheckTourStatus(checkTourRecipients[0].signyourself);
+ }
+ }
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ } else if (contractUsersRes === "Error: Something went wrong!") {
+ const loadObj = {
+ isLoad: false
+ };
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ } else if (contractUsersRes.length === 0) {
+ const contractContactBook = await contactBook(jsonSender.objectId);
+ if (contractContactBook && contractContactBook.length > 0) {
+ setContractName("_Contactbook");
+ setSignerUserId(contractContactBook[0].objectId);
+ const tourstatuss =
+ contractContactBook[0].TourStatus &&
+ contractContactBook[0].TourStatus;
+ if (tourstatuss && tourstatuss.length > 0) {
+ setTourStatus(tourstatuss);
+ const checkTourRecipients = tourstatuss.filter(
+ (data) => data.signyourself
+ );
+ if (checkTourRecipients && checkTourRecipients.length > 0) {
+ setCheckTourStatus(checkTourRecipients[0].signyourself);
+ }
+ }
+ } else {
+ setNoData(true);
+ }
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ }
+ };
+
+ const getDate = () => {
+ const date = new Date();
+ const milliseconds = date.getTime();
+ const newDate = moment(milliseconds).format("MM/DD/YYYY");
+ return newDate;
+ };
+ const getWidgetValue = (type) => {
+ switch (type) {
+ case "name":
+ return pdfDetails[0].ExtUserPtr.Name;
+ case "company":
+ return pdfDetails[0].ExtUserPtr.Company;
+ case "job title":
+ return pdfDetails[0].ExtUserPtr.JobTitle;
+ case "email":
+ return pdfDetails[0].ExtUserPtr.Email;
+ case "checkbox":
+ return true;
+ case "date":
+ return getDate();
+ default:
+ return "";
+ }
+ };
+ const addWidgetOptions = (type) => {
+ let option = {};
+
+ switch (type) {
+ case "signature":
+ option = {
+ name: "",
+ values: [],
+ status: "",
+ response: "",
+ validation: {}
+ };
+ return option;
+
+ case "stamp":
+ option = {
+ name: "",
+ values: [],
+ status: "",
+ response: "",
+ validation: {}
+ };
+ return option;
+
+ case "checkbox":
+ option = {
+ name: "",
+ values: [],
+ response: true,
+ validation: {}
+ };
+ return option;
+ case "text":
+ option = {
+ name: "",
+ values: [],
+ status: "",
+ response: "",
+ validation: {}
+ };
+ return option;
+
+ case "initials":
+ option = {
+ name: "",
+ values: [],
+ status: "",
+ response: "",
+ validation: {}
+ };
+ return option;
+ case "name":
+ option = {
+ name: "",
+ values: [],
+ status: "",
+ response: getWidgetValue(type),
+ validation: {
+ type: "text",
+ pattern: ""
+ }
+ };
+ return option;
+
+ case "company":
+ option = {
+ name: "",
+ values: [],
+ status: "",
+ response: getWidgetValue(type),
+ validation: {
+ type: "text",
+ pattern: ""
+ }
+ };
+ return option;
+ case "job title":
+ option = {
+ name: "",
+ values: [],
+ status: "",
+ response: getWidgetValue(type),
+ validation: {
+ type: "text",
+ pattern: ""
+ }
+ };
+ return option;
+ case "date":
+ option = {
+ name: "",
+ values: [],
+ status: "",
+ response: getDate(),
+ validation: {
+ type: "text",
+ pattern: ""
+ }
+ };
+ return option;
+ case "image":
+ option = {
+ name: "",
+ values: [],
+ status: "",
+ response: "",
+ validation: {}
+ };
+ return option;
+ case "email":
+ option = {
+ name: "",
+ values: [],
+ status: "",
+ response: getWidgetValue(type),
+ validation: {
+ type: "email",
+ pattern: ""
+ }
+ };
+ return option;
+ }
+ };
+ //function for setting position after drop signature button over pdf
+ const addPositionOfSignature = (item, monitor) => {
+ const key = Math.floor(1000 + Math.random() * 9000);
+ let dropData = [];
+ let dropObj = {};
+ let filterDropPos = xyPostion.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+ const dragTypeValue = item?.text ? item.text : monitor.type;
+ const widgetValue = getWidgetValue(dragTypeValue);
+ const widgetWidth = defaultWidthHeight(dragTypeValue).width;
+ const widgetHeight = defaultWidthHeight(dragTypeValue).height;
+ const widgetTypeExist = ["name", "company", "job title", "email"].includes(
+ dragTypeValue
+ );
+ if (item === "onclick") {
+ dropObj = {
+ xPosition: containerWH.width / 2 - widgetWidth / 2,
+ yPosition: containerWH.height / 2 - widgetHeight / 2,
+ isDrag: false,
+ isStamp:
+ (dragTypeValue === "stamp" || dragTypeValue === "image") && true,
+ key: key,
+ type: dragTypeValue,
+ yBottom: window.innerHeight / 2 - 60,
+
+ Width: widgetTypeExist
+ ? calculateInitialWidthHeight(dragTypeValue, widgetValue).getWidth
+ : dragTypeValue === "initials"
+ ? defaultWidthHeight(dragTypeValue).width
+ : "",
+ Height: widgetTypeExist
+ ? calculateInitialWidthHeight(dragTypeValue, widgetValue).getHeight
+ : dragTypeValue === "initials"
+ ? defaultWidthHeight(dragTypeValue).height
+ : "",
+ options: addWidgetOptions(dragTypeValue)
+ };
+
+ dropData.push(dropObj);
+ } else {
+ const offset = monitor.getClientOffset();
+ //adding and updating drop position in array when user drop signature button in div
+ const containerRect = document
+ .getElementById("container")
+ .getBoundingClientRect();
+
+ const x = offset.x - containerRect.left;
+ const y = offset.y - containerRect.top;
+
+ dropObj = {
+ xPosition: signBtnPosition[0] ? x - signBtnPosition[0].xPos : x,
+ yPosition: signBtnPosition[0] ? y - signBtnPosition[0].yPos : y,
+ // isDrag: false,
+ isStamp:
+ (dragTypeValue === "stamp" || dragTypeValue === "image") && true,
+ key: key,
+ type: dragTypeValue,
+ Width: widgetTypeExist
+ ? calculateInitialWidthHeight(dragTypeValue, widgetValue).getWidth
+ : defaultWidthHeight(dragTypeValue).width,
+ Height: widgetTypeExist
+ ? calculateInitialWidthHeight(dragTypeValue, widgetValue).getHeight
+ : defaultWidthHeight(dragTypeValue).height,
+ options: addWidgetOptions(dragTypeValue)
+ };
+
+ dropData.push(dropObj);
+ }
+ if (filterDropPos.length > 0) {
+ const index = xyPostion.findIndex((object) => {
+ return object.pageNumber === pageNumber;
+ });
+ const updateData = filterDropPos[0].pos;
+
+ // if (updateData.length > dropData.length) {
+ const newSignPos = updateData.concat(dropData);
+ let xyPos = {
+ pageNumber: pageNumber,
+ pos: newSignPos
+ };
+ xyPostion.splice(index, 1, xyPos);
+
+ // }
+ } else {
+ const xyPos = {
+ pageNumber: pageNumber,
+ pos: dropData
+ };
+ setXyPostion((prev) => [...prev, xyPos]);
+ }
+
+ if (
+ dragTypeValue === "signature" ||
+ dragTypeValue === "stamp" ||
+ dragTypeValue === "image" ||
+ dragTypeValue === "initials"
+ ) {
+ setIsSignPad(true);
+ }
+
+ if (dragTypeValue === "stamp" || dragTypeValue === "image") {
+ setIsStamp(true);
+ } else if (dragTypeValue === "initials") {
+ setIsInitial(true);
+ } else if (dragTypeValue === "checkbox") {
+ setIsCheckbox(true);
+ }
+ setWidgetType(dragTypeValue);
+ setSelectWidgetId(key);
+ setSignKey(key);
+ };
+
+ //function for send placeholder's co-ordinate(x,y) position embed signature url or stamp url
+ async function embedWidgetsData() {
+ let checkSigned = 0;
+ let allXyPos = 0;
+
+ for (let i = 0; i < xyPostion.length; i++) {
+ const posWidgetData = xyPostion[i].pos.filter(
+ (pos) => pos.options.response
+ );
+
+ checkSigned = checkSigned + posWidgetData.length;
+ allXyPos = allXyPos + xyPostion[i].pos.length;
+ }
+ if (xyPostion.length === 0) {
+ setIsAlert({
+ isShow: true,
+ alertMessage: "Please complete your signature!"
+ });
+ return;
+ } else if (xyPostion.length > 0 && allXyPos !== checkSigned) {
+ setIsAlert({
+ isShow: true,
+ alertMessage: "Please complete your signature!"
+ });
+ return;
+ } else {
+ setIsCeleb(true);
+ setTimeout(() => {
+ setIsCeleb(false);
+ }, 3000);
+ setIsUiLoading(true);
+ const url = pdfDetails[0] && pdfDetails[0].URL;
+
+ const existingPdfBytes = await fetch(url).then((res) =>
+ res.arrayBuffer()
+ );
+
+ // Load a PDFDocument from the existing PDF bytes
+ const pdfDoc = await PDFDocument.load(existingPdfBytes, {
+ ignoreEncryption: true
+ });
+
+ const flag = true;
+
+ const extUserPtr = pdfDetails[0].ExtUserPtr;
+ const HeaderDocId = extUserPtr?.HeaderDocId;
+
+ //embed document's object id to all pages in pdf document
+ if (!HeaderDocId) {
+ await embedDocId(pdfDoc, documentId, allPages);
+ }
+ //embed multi signature in pdf
+ const pdfBytes = await multiSignEmbed(
+ xyPostion,
+ pdfDoc,
+ pdfOriginalWidth,
+ flag,
+ containerWH
+ );
+ // console.log(pdfBytes)
+ //function for call to embed signature in pdf and get digital signature pdf
+ await signPdfFun(pdfBytes, documentId);
+ }
+ }
+
+ //function for get digital signature
+ const signPdfFun = async (base64Url, documentId) => {
+ let singleSign = {
+ pdfFile: base64Url,
+ docId: documentId
+ };
+
+ await axios
+ .post(`${localStorage.getItem("baseUrl")}functions/signPdf`, singleSign, {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessionToken: localStorage.getItem("accesstoken")
+ }
+ })
+ .then((Listdata) => {
+ const json = Listdata.data;
+
+ setPdfUrl(json.result.data);
+ if (json.result.data) {
+ getDocumentDetails(false);
+ }
+ })
+ .catch((err) => {
+ console.log("axois err ", err);
+ });
+ };
+
+ //function for save x and y position and show signature tab on that position
+ const handleTabDrag = (key) => {
+ setDragKey(key);
+ setIsDragging(true);
+ };
+
+ //function for set and update x and y postion after drag and drop signature tab
+ const handleStop = (event, dragElement) => {
+ if (isDragging && dragElement) {
+ event.preventDefault();
+ const containerRect = document
+ .getElementById("container")
+ .getBoundingClientRect();
+
+ const ybottom = containerRect.height - dragElement.y;
+
+ if (dragKey >= 0) {
+ const filterDropPos = xyPostion.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ if (filterDropPos.length > 0) {
+ const getXYdata = xyPostion[index].pos;
+ const getPosData = getXYdata;
+ const addSign = getPosData.map((url) => {
+ if (url.key === dragKey) {
+ return {
+ ...url,
+ xPosition: dragElement.x,
+ yPosition: dragElement.y,
+ isDrag: true,
+ yBottom: ybottom
+ };
+ }
+ return url;
+ });
+
+ const newUpdateUrl = xyPostion.map((obj, ind) => {
+ if (ind === index) {
+ return { ...obj, pos: addSign };
+ }
+ return obj;
+ });
+ setXyPostion(newUpdateUrl);
+ }
+ }
+ }
+ setTimeout(() => {
+ setIsDragging(false);
+ }, 200);
+ };
+
+ //function for get pdf page details
+ const pageDetails = async (pdf) => {
+ const load = {
+ status: true
+ };
+ setPdfLoadFail(load);
+ pdf.getPage(1).then((pdfPage) => {
+ const pageWidth = pdfPage.view[2];
+
+ setPdfOriginalWidth(pageWidth);
+ });
+ };
+
+ //function for change page numver of pdf
+ function changePage(offset) {
+ setSignBtnPosition([]);
+ setPageNumber((prevPageNumber) => prevPageNumber + offset);
+ }
+
+ //function for image upload or update
+ const onImageChange = (event) => {
+ if (event.target.files && event.target.files[0]) {
+ onImageSelect(event, setImgWH, setImage);
+ }
+ };
+
+ //function for upload stamp or image
+ const saveImage = () => {
+ const getImage = onSaveImage(xyPostion, index, signKey, imgWH, image);
+ setXyPostion(getImage);
+ };
+
+ //function for save button to save signature or image url
+ const saveSign = (isDefaultSign, width, height) => {
+ const isTypeText = width && height ? true : false;
+ const signatureImg = isDefaultSign
+ ? isDefaultSign === "initials"
+ ? myInitial
+ : defaultSignImg
+ : signature;
+ let imgWH = { width: width ? width : "", height: height ? height : "" };
+ setIsSignPad(false);
+ setIsImageSelect(false);
+ setImage();
+
+ if (isDefaultSign) {
+ const img = new Image();
+ img.src = defaultSignImg;
+ if (img.complete) {
+ imgWH = {
+ width: img.width,
+ height: img.height
+ };
+ }
+ }
+ const getUpdatePosition = onSaveSign(
+ xyPostion,
+ index,
+ signKey,
+ signatureImg,
+ imgWH,
+ isDefaultSign,
+ isTypeText
+ );
+
+ setXyPostion(getUpdatePosition);
+ };
+ //function for capture position on hover signature button
+ const handleDivClick = (e) => {
+ const divRect = e.currentTarget.getBoundingClientRect();
+ const mouseX = e.clientX - divRect.left;
+ const mouseY = e.clientY - divRect.top;
+
+ const xyPosition = {
+ xPos: mouseX,
+ yPos: mouseY
+ };
+
+ setXYSignature(xyPosition);
+ };
+
+ //function for capture position of x and y on hover signature button last position
+ const handleMouseLeave = () => {
+ setSignBtnPosition([xySignature]);
+ };
+
+ const handleAllDelete = () => {
+ setXyPostion([]);
+ };
+
+ //function for delete signature block
+ const handleDeleteSign = (key) => {
+ const updateResizeData = [];
+
+ let filterData = xyPostion[index].pos.filter((data) => data.key !== key);
+
+ //delete and update block position
+ if (filterData.length > 0) {
+ updateResizeData.push(filterData);
+ const newUpdatePos = xyPostion.map((obj, ind) => {
+ if (ind === index) {
+ return { ...obj, pos: updateResizeData[0] };
+ }
+ return obj;
+ });
+
+ setXyPostion(newUpdatePos);
+ } else {
+ const getRemainPage = xyPostion.filter(
+ (data) => data.pageNumber !== pageNumber
+ );
+
+ if (getRemainPage && getRemainPage.length > 0) {
+ setXyPostion(getRemainPage);
+ } else {
+ setXyPostion([]);
+ }
+ }
+ };
+
+ const handleDontShow = (isChecked) => {
+ setIsDontShow(isChecked);
+ };
+ const tourConfig = [
+ {
+ selector: '[data-tut="reactourFirst"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Drag the signature or stamp placeholder onto the PDF to choose your desired signing location.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ },
+ {
+ selector: '[data-tut="reactourSecond"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Drag and drop anywhere in this area. You can resize and move it later.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ }
+ ];
+
+ //function for update TourStatus
+ const closeTour = async () => {
+ setSignTour(false);
+ if (isDontShow) {
+ let updatedTourStatus = [];
+ if (tourStatus.length > 0) {
+ updatedTourStatus = [...tourStatus];
+ const signyourselfIndex = tourStatus.findIndex(
+ (obj) => obj["signyourself"] === false || obj["signyourself"] === true
+ );
+ if (signyourselfIndex !== -1) {
+ updatedTourStatus[signyourselfIndex] = { signyourself: true };
+ } else {
+ updatedTourStatus.push({ signyourself: true });
+ }
+ } else {
+ updatedTourStatus = [{ signyourself: true }];
+ }
+ await axios
+ .put(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}${contractName}/${signerUserId}`,
+ {
+ TourStatus: updatedTourStatus
+ },
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessionToken: localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then(() => {
+ // const json = Listdata.data;
+ })
+ .catch((err) => {
+ console.log("axois err ", err);
+ });
+ }
+ };
+
+ const handleSaveWidgetsOptions = (
+ dropdownName,
+ dropdownOptions,
+ minCount,
+ maxCount,
+ isReadOnly,
+ addOption,
+ deleteOption
+ ) => {
+ const getPageNumer = xyPostion.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos;
+ const getPosData = getXYdata;
+ const addSignPos = getPosData.map((position) => {
+ if (position.key === signKey) {
+ if (addOption) {
+ return {
+ ...position,
+ Height: position.Height
+ ? position.Height + 15
+ : defaultWidthHeight(widgetType).height + 15
+ };
+ } else if (deleteOption) {
+ return {
+ ...position,
+ Height: position.Height
+ ? position.Height - 15
+ : defaultWidthHeight(widgetType).height - 15
+ };
+ } else {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: dropdownName,
+ values: dropdownOptions,
+ isReadOnly: isReadOnly,
+ response: []
+ }
+ };
+ }
+ }
+ return position;
+ });
+ const updateXYposition = xyPostion.map((obj, ind) => {
+ if (ind === index) {
+ return { ...obj, pos: addSignPos };
+ }
+ return obj;
+ });
+ setXyPostion(updateXYposition);
+ }
+ };
+
+ return (
+ <DndProvider backend={HTML5Backend}>
+ <Title title={"Self Sign"} />
+ {isLoading.isLoad ? (
+ <Loader isLoading={isLoading} />
+ ) : handleError ? (
+ <HandleError handleError={handleError} />
+ ) : noData ? (
+ <Nodata />
+ ) : (
+ <div>
+ {isUiLoading && (
+ <div
+ style={{
+ position: "absolute",
+ height: "100vh",
+ width: "100%",
+ display: "flex",
+ justifyContent: "center",
+ flexDirection: "column",
+ alignItems: "center",
+ zIndex: "999",
+ backgroundColor: "#e6f2f2",
+ opacity: 0.8
+ }}
+ >
+ <img
+ alt="no img"
+ src={loader}
+ style={{ width: "100px", height: "100px" }}
+ />
+ <span style={{ fontSize: "13px", fontWeight: "bold" }}>
+ This might take some time
+ </span>
+ </div>
+ )}
+
+ <div className="signatureContainer" ref={divRef}>
+ {/* this component used for UI interaction and show their functionality */}
+ {pdfLoadFail && !checkTourStatus && (
+ <Tour
+ onRequestClose={closeTour}
+ steps={tourConfig}
+ isOpen={signTour}
+ rounded={5}
+ closeWithMask={false}
+ />
+ )}
+
+ {/* this component used to render all pdf pages in left side */}
+
+ <RenderAllPdfPage
+ pdfUrl={pdfUrl}
+ signPdfUrl={pdfDetails[0] && pdfDetails[0].URL}
+ allPages={allPages}
+ setAllPages={setAllPages}
+ setPageNumber={setPageNumber}
+ setSignBtnPosition={setSignBtnPosition}
+ pageNumber={pageNumber}
+ />
+
+ {/* pdf render view */}
+ <div
+ style={{
+ marginLeft: !isMobile && pdfOriginalWidth > 500 && "20px",
+ marginRight: !isMobile && pdfOriginalWidth > 500 && "20px"
+ }}
+ >
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={isAlert.isShow}
+ title={"Alert"}
+ handleClose={() => {
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>{isAlert.alertMessage}</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ onClick={() => {
+ setIsAlert({
+ isShow: false,
+ alertMessage: ""
+ });
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Ok
+ </button>
+ </div>
+ </ModalUi>
+
+ {/* this modal is used show this document is already sign */}
+ <ModalUi
+ isOpen={showAlreadySignDoc.status}
+ title={"Sign Documents"}
+ handleClose={() => {
+ setShowAlreadySignDoc({ status: false });
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>{showAlreadySignDoc.mssg}</p>
+
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ className="finishBtn cancelBtn"
+ onClick={() => setShowAlreadySignDoc({ status: false })}
+ >
+ Close
+ </button>
+ </div>
+ </ModalUi>
+ <DropdownWidgetOption
+ type="checkbox"
+ title="Checkbox"
+ showDropdown={isCheckbox}
+ setShowDropdown={setIsCheckbox}
+ handleSaveWidgetsOptions={handleSaveWidgetsOptions}
+ currWidgetsDetails={currWidgetsDetails}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ isSignYourself={true}
+ />
+ <PlaceholderCopy
+ isPageCopy={isPageCopy}
+ setIsPageCopy={setIsPageCopy}
+ xyPostion={xyPostion}
+ setXyPostion={setXyPostion}
+ allPages={allPages}
+ pageNumber={pageNumber}
+ signKey={signKey}
+ />
+ {/* this is modal of signature pad */}
+ <SignPad
+ isSignPad={isSignPad}
+ isStamp={isStamp}
+ setIsImageSelect={setIsImageSelect}
+ setIsSignPad={setIsSignPad}
+ setImage={setImage}
+ isImageSelect={isImageSelect}
+ imageRef={imageRef}
+ onImageChange={onImageChange}
+ setSignature={setSignature}
+ image={image}
+ onSaveImage={saveImage}
+ onSaveSign={saveSign}
+ defaultSign={defaultSignImg}
+ myInitial={myInitial}
+ isInitial={isInitial}
+ setIsInitial={setIsInitial}
+ setIsStamp={setIsStamp}
+ widgetType={widgetType}
+ />
+ {/*render email component to send email after finish signature on document */}
+ <EmailComponent
+ isEmail={isEmail}
+ pdfUrl={pdfUrl}
+ isCeleb={isCeleb}
+ setIsEmail={setIsEmail}
+ pdfName={pdfDetails[0] && pdfDetails[0].Name}
+ setSuccessEmail={setSuccessEmail}
+ sender={jsonSender}
+ setIsAlert={setIsAlert}
+ />
+ {/* pdf header which contain funish back button */}
+ <Header
+ pageNumber={pageNumber}
+ allPages={allPages}
+ changePage={changePage}
+ pdfUrl={pdfUrl}
+ documentStatus={documentStatus}
+ embedWidgetsData={embedWidgetsData}
+ pdfDetails={pdfDetails}
+ isShowHeader={true}
+ currentSigner={true}
+ alreadySign={pdfUrl ? true : false}
+ isSignYourself={true}
+ setIsEmail={setIsEmail}
+ />
+
+ <div data-tut="reactourSecond">
+ {containerWH && (
+ <RenderPdf
+ pageNumber={pageNumber}
+ pdfOriginalWidth={pdfOriginalWidth}
+ pdfNewWidth={pdfNewWidth}
+ drop={drop}
+ successEmail={successEmail}
+ nodeRef={nodeRef}
+ handleTabDrag={handleTabDrag}
+ handleStop={handleStop}
+ isDragging={isDragging}
+ setIsSignPad={setIsSignPad}
+ setIsStamp={setIsStamp}
+ handleDeleteSign={handleDeleteSign}
+ setSignKey={setSignKey}
+ pdfDetails={pdfDetails}
+ setIsDragging={setIsDragging}
+ xyPostion={xyPostion}
+ pdfRef={pdfRef}
+ pdfUrl={pdfUrl}
+ numPages={numPages}
+ pageDetails={pageDetails}
+ setPdfLoadFail={setPdfLoadFail}
+ pdfLoadFail={pdfLoadFail}
+ setXyPostion={setXyPostion}
+ index={index}
+ containerWH={containerWH}
+ setIsPageCopy={setIsPageCopy}
+ setIsInitial={setIsInitial}
+ setWidgetType={setWidgetType}
+ setSelectWidgetId={setSelectWidgetId}
+ selectWidgetId={selectWidgetId}
+ setIsCheckbox={setIsCheckbox}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ />
+ )}
+ </div>
+ </div>
+
+ {/*if document is not completed then render signature and stamp button in the right side */}
+ {/*else document is completed then render signed by signer name in the right side */}
+ <div
+ style={{
+ maxHeight: window.innerHeight - 70 + "px",
+ backgroundColor: "white"
+ }}
+ className="autoSignScroll"
+ >
+ {!documentStatus.isCompleted ? (
+ <div>
+ <WidgetComponent
+ dataTut="reactourFirst"
+ pdfUrl={pdfUrl}
+ dragSignature={dragSignature}
+ signRef={signRef}
+ handleDivClick={handleDivClick}
+ handleMouseLeave={handleMouseLeave}
+ isDragSign={isDragSign}
+ themeColor={themeColor}
+ dragStamp={dragStamp}
+ dragRef={dragRef}
+ isDragStamp={isDragStamp}
+ handleAllDelete={handleAllDelete}
+ xyPostion={xyPostion}
+ isSignYourself={true}
+ addPositionOfSignature={addPositionOfSignature}
+ isMailSend={false}
+ />
+ </div>
+ ) : (
+ <div>
+ <Signedby pdfDetails={pdfDetails[0]} />
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ )}
+ </DndProvider>
+ );
+}
+
+export default SignYourSelf;
diff --git a/apps/OpenSign/src/routes/TemplatePlaceholder.js b/apps/OpenSign/src/routes/TemplatePlaceholder.js
new file mode 100644
index 000000000..6a1a855ec
--- /dev/null
+++ b/apps/OpenSign/src/routes/TemplatePlaceholder.js
@@ -0,0 +1,1529 @@
+import React, { useEffect, useState, useRef } from "react";
+import RenderAllPdfPage from "../components/pdf/RenderAllPdfPage";
+import { useParams, useNavigate } from "react-router-dom";
+import axios from "axios";
+import "../styles/signature.css";
+import { themeColor } from "../constant/const";
+import { DndProvider } from "react-dnd";
+import { HTML5Backend } from "react-dnd-html5-backend";
+import { useDrag, useDrop } from "react-dnd";
+import WidgetComponent from "../components/pdf/WidgetComponent";
+import Tour from "reactour";
+import Loader from "../components/pdf/Loader";
+import HandleError from "../primitives/HandleError";
+import Nodata from "../primitives/Nodata";
+import SignerListPlace from "../components/pdf/SignerListPlace";
+import Header from "../components/pdf/Header";
+import WidgetNameModal from "../components/pdf/WidgetNameModal";
+import {
+ pdfNewWidthFun,
+ contractUsers,
+ randomId,
+ addZIndex,
+ createDocument,
+ defaultWidthHeight,
+ addWidgetOptions
+} from "../constant/Utils";
+import RenderPdf from "../components/pdf/RenderPdf";
+import "../styles/AddUser.css";
+import Title from "../components/Title";
+import LinkUserModal from "../primitives/LinkUserModal";
+import EditTemplate from "../components/pdf/EditTemplate";
+import ModalUi from "../primitives/ModalUi";
+import AddRoleModal from "../primitives/AddRoleModal";
+import PlaceholderCopy from "../components/pdf/PlaceholderCopy";
+import TourContentWithBtn from "../primitives/TourContentWithBtn";
+import DropdownWidgetOption from "../components/pdf/DropdownWidgetOption";
+const TemplatePlaceholder = () => {
+ const navigate = useNavigate();
+ const { templateId } = useParams();
+ const [pdfDetails, setPdfDetails] = useState([]);
+ const [isMailSend, setIsMailSend] = useState(false);
+ const [allPages, setAllPages] = useState(null);
+ const numPages = 1;
+ const [pageNumber, setPageNumber] = useState(1);
+ const [signBtnPosition, setSignBtnPosition] = useState([]);
+ const [xySignature, setXYSignature] = useState({});
+ const [dragKey, setDragKey] = useState();
+ const [signersdata, setSignersData] = useState([]);
+ const [signerObjId, setSignerObjId] = useState();
+ const [signerPos, setSignerPos] = useState([]);
+ const [isSelectListId, setIsSelectId] = useState();
+ const [isSendAlert, setIsSendAlert] = useState(false);
+ const [isCreateDocModal, setIsCreateDocModal] = useState(false);
+ const [isLoading, setIsLoading] = useState({
+ isLoad: true,
+ message: "This might take some time"
+ });
+ const [handleError, setHandleError] = useState();
+ const [currentEmail, setCurrentEmail] = useState();
+ const [pdfNewWidth, setPdfNewWidth] = useState();
+ const [templateTour, setTemplateTour] = useState(true);
+ const [checkTourStatus, setCheckTourStatus] = useState(false);
+ const [tourStatus, setTourStatus] = useState([]);
+ const [signerUserId, setSignerUserId] = useState();
+ const [noData, setNoData] = useState(false);
+ const [pdfOriginalWidth, setPdfOriginalWidth] = useState();
+ const [contractName, setContractName] = useState("");
+ const [containerWH, setContainerWH] = useState();
+ const signRef = useRef(null);
+ const dragRef = useRef(null);
+ const divRef = useRef(null);
+ const [isShowEmail, setIsShowEmail] = useState(false);
+ const [selectedEmail, setSelectedEmail] = useState(false);
+ const [isResize, setIsResize] = useState(false);
+ const [isSigners, setIsSigners] = useState(false);
+ const [zIndex, setZIndex] = useState(1);
+ const [showDropdown, setShowDropdown] = useState(false);
+ const [widgetType, setWidgetType] = useState("");
+ const [isRadio, setIsRadio] = useState(false);
+ const [selectWidgetId, setSelectWidgetId] = useState("");
+ const [isNameModal, setIsNameModal] = useState(false);
+ const [pdfLoadFail, setPdfLoadFail] = useState({
+ status: false,
+ type: "load"
+ });
+ const color = [
+ "#93a3db",
+ "#e6c3db",
+ "#c0e3bc",
+ "#bce3db",
+ "#b8ccdb",
+ "#ceb8db",
+ "#ffccff",
+ "#99ffcc",
+ "#cc99ff",
+ "#ffcc99",
+ "#66ccff",
+ "#ffffcc"
+ ];
+ const isMobile = window.innerWidth < 767;
+ const [, drop] = useDrop({
+ accept: "BOX",
+ drop: (item, monitor) => addPositionOfSignature(item, monitor),
+ collect: (monitor) => ({
+ isOver: !!monitor.isOver()
+ })
+ });
+ const [{ isDragSign }, dragSignature] = useDrag({
+ type: "BOX",
+ item: {
+ type: "BOX",
+ id: 1,
+ text: "signature"
+ },
+ collect: (monitor) => ({
+ isDragSign: !!monitor.isDragging()
+ })
+ });
+ const [{ isDragStamp }, dragStamp] = useDrag({
+ type: "BOX",
+
+ item: {
+ type: "BOX",
+ id: 2,
+ text: "stamp"
+ },
+ collect: (monitor) => ({
+ isDragStamp: !!monitor.isDragging()
+ })
+ });
+ const [uniqueId, setUniqueId] = useState("");
+ const [isModalRole, setIsModalRole] = useState(false);
+ const [roleName, setRoleName] = useState("");
+ const [isAddUser, setIsAddUser] = useState({});
+ const [isCreateDoc, setIsCreateDoc] = useState(false);
+ const [isEditTemplate, setIsEditTemplate] = useState(false);
+ const [isPageCopy, setIsPageCopy] = useState(false);
+ const [signKey, setSignKey] = useState();
+ const [IsReceipent, setIsReceipent] = useState(true);
+ const [isDontShow, setIsDontShow] = useState(false);
+ const [isDragging, setIsDragging] = useState(false);
+ const [currWidgetsDetails, setCurrWidgetsDetails] = useState([]);
+ const [isCheckbox, setIsCheckbox] = useState(false);
+ const [widgetName, setWidgetName] = useState(false);
+ const senderUser =
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ ) &&
+ localStorage.getItem(
+ `Parse/${localStorage.getItem("parseAppId")}/currentUser`
+ );
+ const jsonSender = JSON.parse(senderUser);
+
+ useEffect(() => {
+ fetchTemplate();
+ // eslint-disable-next-line
+ }, []);
+
+ useEffect(() => {
+ if (divRef.current) {
+ const pdfWidth = pdfNewWidthFun(divRef);
+ setPdfNewWidth(pdfWidth);
+ setContainerWH({
+ width: divRef.current.offsetWidth,
+ height: divRef.current.offsetHeight
+ });
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [divRef.current]);
+
+ // `fetchTemplate` function in used to get Template from server and setPlaceholder ,setSigner if present
+ const fetchTemplate = async () => {
+ try {
+ const params = { templateId: templateId };
+ const templateDeatils = await axios.post(
+ `${localStorage.getItem("baseUrl")}functions/getTemplate`,
+ params,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessiontoken: localStorage.getItem("accesstoken")
+ }
+ }
+ );
+ const documentData =
+ templateDeatils.data && templateDeatils.data.result
+ ? [templateDeatils.data.result]
+ : [];
+
+ if (documentData && documentData.length > 0) {
+ setPdfDetails(documentData);
+ setIsSigners(true);
+ if (documentData[0].Signers && documentData[0].Signers.length > 0) {
+ setSignerObjId(documentData[0].Signers[0].objectId);
+ setContractName(documentData[0].Signers[0].className);
+ setIsSelectId(0);
+ if (
+ documentData[0].Placeholders &&
+ documentData[0].Placeholders.length > 0
+ ) {
+ setSignerPos(documentData[0].Placeholders);
+ let signers = [...documentData[0].Signers];
+ let updatedSigners = documentData[0].Placeholders.map((x) => {
+ let matchingSigner = signers.find(
+ (y) => x.signerObjId && x.signerObjId === y.objectId
+ );
+
+ if (matchingSigner) {
+ return {
+ ...matchingSigner,
+ Role: x.Role ? x.Role : matchingSigner.Role,
+ Id: x.Id,
+ blockColor: x.blockColor
+ };
+ } else {
+ return {
+ Role: x.Role,
+ Id: x.Id,
+ blockColor: x.blockColor
+ };
+ }
+ });
+ setSignersData(updatedSigners);
+ setUniqueId(updatedSigners[0].Id);
+ } else {
+ const updatedSigners = documentData[0].Signers.map((x, index) => ({
+ ...x,
+ Id: randomId(),
+ Role: "User " + (index + 1)
+ }));
+ setSignersData(updatedSigners);
+ setUniqueId(updatedSigners[0].Id);
+ }
+ } else {
+ setRoleName("User 1");
+ if (
+ documentData[0].Placeholders &&
+ documentData[0].Placeholders.length > 0
+ ) {
+ let updatedSigners = documentData[0].Placeholders.map((x) => {
+ return {
+ Role: x.Role,
+ Id: x.Id,
+ blockColor: x.blockColor
+ };
+ });
+ setSignerPos(documentData[0].Placeholders);
+ setUniqueId(updatedSigners[0].Id);
+ setSignersData(updatedSigners);
+ setIsSelectId(0);
+ }
+ }
+ } else if (
+ documentData === "Error: Something went wrong!" ||
+ (documentData.result && documentData.result.error)
+ ) {
+ const loadObj = {
+ isLoad: false
+ };
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ } else {
+ setNoData(true);
+
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ }
+ } catch (err) {
+ console.log("err ", err);
+ if (err?.response?.data?.code === 101) {
+ setHandleError("Error: Template not found!");
+ } else {
+ setHandleError("Error: Something went wrong!");
+ }
+ }
+ const res = await contractUsers(jsonSender.email);
+ if (res[0] && res.length) {
+ setSignerUserId(res[0].objectId);
+ setCurrentEmail(res[0].Email);
+ const tourstatus = res[0].TourStatus && res[0].TourStatus;
+ if (tourstatus && tourstatus.length > 0) {
+ setTourStatus(tourstatus);
+ const checkTourRecipients = tourstatus.filter(
+ (data) => data.templatetour
+ );
+ if (checkTourRecipients && checkTourRecipients.length > 0) {
+ setCheckTourStatus(checkTourRecipients[0].templatetour);
+ }
+ }
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ } else if (res === "Error: Something went wrong!") {
+ const loadObj = {
+ isLoad: false
+ };
+ setHandleError("Error: Something went wrong!");
+ setIsLoading(loadObj);
+ } else if (res.length === 0) {
+ setNoData(true);
+
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ }
+ };
+
+ //function for setting position after drop signature button over pdf
+ const addPositionOfSignature = (item, monitor) => {
+ if (item && item.text) {
+ setWidgetName(item.text);
+ }
+ getSignerPos(item, monitor);
+ };
+
+ // `getSignerPos` is used to get placeholder position when user place it and save it in array
+ const getSignerPos = (item, monitor) => {
+ if (uniqueId) {
+ const signer = signersdata.find((x) => x.Id === uniqueId);
+ if (signer) {
+ const posZIndex = zIndex + 1;
+ setZIndex(posZIndex);
+ const newWidth = containerWH.width;
+ const scale = pdfOriginalWidth / newWidth;
+ const key = randomId();
+ // let filterSignerPos = signerPos.filter(
+ // (data) => data.signerObjId === signerObjId
+ // );
+ let filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
+ const dragTypeValue = item?.text ? item.text : monitor.type;
+ let dropData = [];
+ let placeHolder;
+ if (item === "onclick") {
+ const dropObj = {
+ //onclick put placeholder center on pdf
+ xPosition: window.innerWidth / 2 - 150,
+ yPosition: window.innerHeight / 2 - 60,
+ isStamp:
+ (dragTypeValue === "stamp" || dragTypeValue === "image") && true,
+ key: key,
+ scale: scale,
+ isMobile: isMobile,
+ zIndex: posZIndex,
+ type: dragTypeValue,
+ options: addWidgetOptions(dragTypeValue)
+ };
+ dropData.push(dropObj);
+ placeHolder = {
+ pageNumber: pageNumber,
+ pos: dropData
+ };
+ } else {
+ const offset = monitor.getClientOffset();
+ //adding and updating drop position in array when user drop signature button in div
+ const containerRect = document
+ .getElementById("container")
+ .getBoundingClientRect();
+ const x = offset.x - containerRect.left;
+ const y = offset.y - containerRect.top;
+ const dropObj = {
+ xPosition: signBtnPosition[0] ? x - signBtnPosition[0].xPos : x,
+ yPosition: signBtnPosition[0] ? y - signBtnPosition[0].yPos : y,
+ isStamp:
+ (dragTypeValue === "stamp" || dragTypeValue === "image") && true,
+ key: key,
+ scale: scale,
+ isMobile: isMobile,
+ zIndex: posZIndex,
+ type: item.text,
+ options: addWidgetOptions(dragTypeValue)
+ };
+
+ dropData.push(dropObj);
+ placeHolder = {
+ pageNumber: pageNumber,
+ pos: dropData
+ };
+ }
+ const { blockColor, Role } = signer;
+ //adding placholder in existing signer pos array (placaholder)
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+ const updatePlace = getPlaceHolder.filter(
+ (data) => data.pageNumber !== pageNumber
+ );
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ //add entry of position for same signer on multiple page
+ if (getPageNumer.length > 0) {
+ const getPos = getPageNumer[0].pos;
+ const newSignPos = getPos.concat(dropData);
+ let xyPos = {
+ pageNumber: pageNumber,
+ pos: newSignPos
+ };
+ updatePlace.push(xyPos);
+ const updatesignerPos = signerPos.map((x) =>
+ x.Id === uniqueId ? { ...x, placeHolder: updatePlace } : x
+ );
+ setSignerPos(updatesignerPos);
+ } else {
+ const updatesignerPos = signerPos.map((x) =>
+ x.Id === uniqueId
+ ? { ...x, placeHolder: [...x.placeHolder, placeHolder] }
+ : x
+ );
+ setSignerPos(updatesignerPos);
+ }
+ } else {
+ //adding new placeholder for selected signer in pos array (placeholder)
+ let placeHolderPos;
+ if (contractName) {
+ placeHolderPos = {
+ signerPtr: {
+ __type: "Pointer",
+ className: `${contractName}`,
+ objectId: signerObjId
+ },
+ signerObjId: signerObjId,
+ blockColor: blockColor ? blockColor : color[isSelectListId],
+ placeHolder: [placeHolder],
+ Role: Role ? Role : roleName,
+ Id: uniqueId
+ };
+ } else {
+ placeHolderPos = {
+ signerPtr: {},
+ signerObjId: "",
+ blockColor: blockColor ? blockColor : color[isSelectListId],
+ placeHolder: [placeHolder],
+ Role: Role ? Role : roleName,
+ Id: uniqueId
+ };
+ }
+ setSignerPos((prev) => [...prev, placeHolderPos]);
+ }
+
+ if (dragTypeValue === "dropdown") {
+ setShowDropdown(true);
+ } else if (dragTypeValue === "checkbox") {
+ setIsCheckbox(true);
+ } else if (dragTypeValue === "radio") {
+ setIsRadio(true);
+ } else if (dragTypeValue !== "label" && dragTypeValue !== "signature") {
+ setIsNameModal(true);
+ }
+ setCurrWidgetsDetails("");
+ setWidgetType(dragTypeValue);
+ setSignKey(key);
+ setSelectWidgetId(key);
+
+ setIsMailSend(false);
+ } else {
+ setIsReceipent(false);
+ }
+ }
+ };
+
+ //function for get pdf page details
+ const pageDetails = async (pdf) => {
+ const load = {
+ status: true
+ };
+ setPdfLoadFail(load);
+ pdf.getPage(1).then((pdfPage) => {
+ const pageWidth = pdfPage.view[2];
+ setPdfOriginalWidth(pageWidth);
+ });
+ };
+ //function for save x and y position and show signature tab on that position
+ const handleTabDrag = (key) => {
+ setDragKey(key);
+ setIsDragging(true);
+ };
+
+ //function for set and update x and y postion after drag and drop signature tab
+ const handleStop = (event, dragElement, signerId, key) => {
+ if (!isResize && isDragging) {
+ const dataNewPlace = addZIndex(signerPos, key, setZIndex);
+ let updateSignPos = [...signerPos];
+ updateSignPos.splice(0, updateSignPos.length, ...dataNewPlace);
+ // signerPos.splice(0, signerPos.length, ...dataNewPlace);
+ const containerRect = document
+ .getElementById("container")
+ .getBoundingClientRect();
+ const signId = signerId; //? signerId : signerObjId;
+ const keyValue = key ? key : dragKey;
+ const ybottom = containerRect.height - dragElement.y;
+
+ if (keyValue >= 0) {
+ const filterSignerPos = updateSignPos.filter(
+ (data) => data.Id === signId
+ );
+
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos;
+
+ const getPosData = getXYdata;
+ const addSignPos = getPosData.map((url) => {
+ if (url.key === keyValue) {
+ return {
+ ...url,
+ xPosition: dragElement.x,
+ yPosition: dragElement.y,
+ isDrag: true,
+ yBottom: ybottom
+ };
+ }
+ return url;
+ });
+
+ const newUpdateSignPos = getPlaceHolder.map((obj) => {
+ if (obj.pageNumber === pageNumber) {
+ return { ...obj, pos: addSignPos };
+ }
+ return obj;
+ });
+ const newUpdateSigner = updateSignPos.map((obj) => {
+ if (obj.Id === signId) {
+ return { ...obj, placeHolder: newUpdateSignPos };
+ }
+ return obj;
+ });
+
+ setSignerPos(newUpdateSigner);
+ }
+ }
+ }
+ }
+ setIsMailSend(false);
+ setTimeout(() => {
+ setIsDragging(false);
+ }, 200);
+ };
+
+ //function for delete signature block
+ const handleDeleteSign = (key, Id) => {
+ const updateData = [];
+ // const filterSignerPos = signerPos.filter(
+ // (data) => data.signerObjId === signerId
+ // );
+
+ const filterSignerPos = signerPos.filter((data) => data.Id === Id);
+
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos.filter(
+ (data) => data.key !== key
+ );
+
+ if (getXYdata.length > 0) {
+ updateData.push(getXYdata);
+ const newUpdatePos = getPlaceHolder.map((obj) => {
+ if (obj.pageNumber === pageNumber) {
+ return { ...obj, pos: updateData[0] };
+ }
+ return obj;
+ });
+
+ const newUpdateSigner = signerPos.map((obj) => {
+ if (obj.Id === Id) {
+ return { ...obj, placeHolder: newUpdatePos };
+ }
+ return obj;
+ });
+
+ setSignerPos(newUpdateSigner);
+ } else {
+ const updateFilter = signerPos.filter((data) => data.Id !== Id);
+ const getRemainPage = filterSignerPos[0].placeHolder.filter(
+ (data) => data.pageNumber !== pageNumber
+ );
+
+ if (getRemainPage && getRemainPage.length > 0) {
+ const newUpdatePos = filterSignerPos.map((obj) => {
+ if (obj.Id === Id) {
+ return { ...obj, placeHolder: getRemainPage };
+ }
+ return obj;
+ });
+ let signerupdate = [];
+ signerupdate = signerPos.filter((data) => data.Id !== Id);
+ signerupdate.push(newUpdatePos[0]);
+
+ setSignerPos(signerupdate);
+ } else {
+ setSignerPos(updateFilter);
+ }
+ }
+ }
+ }
+ };
+
+ //function for change page
+ function changePage(offset) {
+ setSignBtnPosition([]);
+ setPageNumber((prevPageNumber) => prevPageNumber + offset);
+ }
+
+ //function for capture position on hover signature button
+ const handleDivClick = (e) => {
+ const divRect = e.currentTarget.getBoundingClientRect();
+ const mouseX = e.clientX - divRect.left;
+ const mouseY = e.clientY - divRect.top;
+
+ const xyPosition = {
+ xPos: mouseX,
+ yPos: mouseY
+ };
+
+ setXYSignature(xyPosition);
+ };
+
+ //function for capture position of x and y on hover signature button last position
+ const handleMouseLeave = () => {
+ setSignBtnPosition([xySignature]);
+ };
+
+ const alertSendEmail = async () => {
+ if (signerPos.length !== signersdata.length) {
+ setIsSendAlert(true);
+ } else {
+ handleSaveTemplate();
+ }
+ };
+ const handleSaveTemplate = async () => {
+ if (signersdata?.length) {
+ const loadObj = {
+ isLoad: true,
+ message: "This might take some time"
+ };
+ setIsLoading(loadObj);
+ setIsSendAlert(false);
+ let signers = [];
+ if (signersdata?.length > 0) {
+ signersdata.forEach((x) => {
+ if (x.objectId) {
+ const obj = {
+ __type: "Pointer",
+ className: "contracts_Contactbook",
+ objectId: x.objectId
+ };
+ signers.push(obj);
+ }
+ });
+ }
+ try {
+ const data = {
+ Placeholders: signerPos,
+ Signers: signers,
+ Name: pdfDetails[0]?.Name || "",
+ Note: pdfDetails[0]?.Note || "",
+ Description: pdfDetails[0]?.Description || "",
+ SendinOrder: pdfDetails[0]?.SendinOrder || false
+ };
+
+ await axios
+ .put(
+ `${localStorage.getItem("baseUrl")}classes/${localStorage.getItem(
+ "_appName"
+ )}_Template/${templateId}`,
+ data,
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ "X-Parse-Session-Token": localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then(() => {
+ setIsCreateDocModal(true);
+ setIsMailSend(true);
+ const loadObj = {
+ isLoad: false
+ };
+ setIsLoading(loadObj);
+ })
+ .catch((err) => {
+ console.log("axois err ", err);
+ });
+ } catch (e) {
+ console.log("error", e);
+ }
+ } else {
+ setIsReceipent(false);
+ }
+ };
+
+ const handleDontShow = (isChecked) => {
+ setIsDontShow(isChecked);
+ };
+
+ //here you can add your messages in content and selector is key of particular steps
+ const tourConfig = [
+ {
+ selector: '[data-tut="reactourAddbtn"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Clicking "Add role" button will allow you to add various signer roles. You can attach users to each role in subsequent steps.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ observe: '[data-tut="reactourAddbtn--observe"]',
+ style: { fontSize: "13px" }
+ },
+ {
+ selector: '[data-tut="reactourFirst"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Select a role from this list to add a place-holder where he is supposed to sign.The placeholder will appear in the same colour as the recipient name once you drop it on the document.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" },
+ action: () => handleCloseRoleModal()
+ },
+ {
+ selector: '[data-tut="reactourSecond"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Drag the signature or stamp placeholder onto the PDF to choose your desired signing location.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ },
+ {
+ selector: '[data-tut="reactourThird"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Drag the placeholder for a role anywhere on the document.Remember, it will appear in the same colour as the name of the recipient for easy reference.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ },
+ {
+ selector: '[data-tut="reactourFour"]',
+ content: () => (
+ <TourContentWithBtn
+ message={`Clicking "Save" button will save the template and will ask you for creating new document.`}
+ isChecked={handleDontShow}
+ />
+ ),
+ position: "top",
+ style: { fontSize: "13px" }
+ }
+ ];
+
+ //function for update TourStatus
+ const closeTour = async () => {
+ setTemplateTour(false);
+ if (isDontShow) {
+ const extUserClass = localStorage.getItem("extended_class");
+ let updatedTourStatus = [];
+ if (tourStatus.length > 0) {
+ updatedTourStatus = [...tourStatus];
+ const templatetourIndex = tourStatus.findIndex(
+ (obj) => obj["templatetour"] === false || obj["templatetour"] === true
+ );
+ if (templatetourIndex !== -1) {
+ updatedTourStatus[templatetourIndex] = { templatetour: true };
+ } else {
+ updatedTourStatus.push({ templatetour: true });
+ }
+ } else {
+ updatedTourStatus = [{ templatetour: true }];
+ }
+ await axios
+ .put(
+ `${localStorage.getItem(
+ "baseUrl"
+ )}classes/${extUserClass}/${signerUserId}`,
+ {
+ TourStatus: updatedTourStatus
+ },
+ {
+ headers: {
+ "Content-Type": "application/json",
+ "X-Parse-Application-Id": localStorage.getItem("parseAppId"),
+ sessionToken: localStorage.getItem("accesstoken")
+ }
+ }
+ )
+ .then(() => {
+ // const json = Listdata.data;
+ // const res = json.results;
+ })
+ .catch((err) => {
+ console.log("axois err ", err);
+ });
+ }
+ };
+
+ // `handleCreateDocModal` is used to create Document from template when user click on yes from modal
+ const handleCreateDocModal = async () => {
+ setIsCreateDocModal(false);
+ setIsCreateDoc(true);
+ // handle create document
+ const res = await createDocument(pdfDetails, signerPos, signersdata);
+ if (res.status === "success") {
+ navigate(`/placeHolderSign/${res.id}`, {
+ state: { title: "Use Template" }
+ });
+ setIsCreateDoc(false);
+ } else {
+ setHandleError("Error: Something went wrong!");
+ setIsCreateDoc(false);
+ }
+ };
+
+ // `handleAddSigner` is used to open Add Role Modal
+ const handleAddSigner = () => {
+ setIsModalRole(true);
+ setRoleName("");
+ };
+
+ // `handleAddRole` function is called when use click on add button in addRole modal
+ // save Role in entry in signerList and user
+ const handleAddRole = (e) => {
+ e.preventDefault();
+ setSignerObjId("");
+ setContractName("");
+ const count = signersdata.length > 0 ? signersdata.length + 1 : 1;
+ const Id = randomId();
+ const index = signersdata.length;
+ const obj = {
+ Role: roleName || "User " + count,
+ Id: Id,
+ blockColor: color[index]
+ };
+ setSignersData((prevArr) => [...prevArr, obj]);
+ setIsModalRole(false);
+ setRoleName("");
+ setUniqueId(Id);
+ setIsSelectId(index);
+ setIsMailSend(false);
+ };
+ // `handleDeleteUser` function is used to delete record and placeholder when user click on delete which is place next user name in recipients list
+ const handleDeleteUser = (Id) => {
+ const updateSigner = signersdata
+ .filter((x) => x.Id !== Id)
+ .map((x, i) => ({ ...x, blockColor: color[i] }));
+ setSignersData(updateSigner);
+ const updatePlaceholderUser = signerPos
+ .filter((x) => x.Id !== Id)
+ .map((x, i) => ({ ...x, blockColor: color[i] }));
+ const index = signersdata.findIndex((x) => x.Id === Id);
+ if (index === signersdata.length - 1) {
+ setUniqueId(updateSigner[updateSigner.length - 1]?.Id || "");
+ setIsSelectId(index - 1 || 0);
+ } else {
+ setUniqueId(updateSigner[index]?.Id || "");
+ setIsSelectId(index);
+ }
+
+ setSignerPos(updatePlaceholderUser);
+ setIsMailSend(false);
+ };
+
+ // `handleLinkUser` is used to open Add/Choose Signer Modal when user can link existing or new User with placeholder
+ // and update entry in signersList
+ const handleLinkUser = (id) => {
+ setIsAddUser({ [id]: true });
+ };
+ const handleAddUser = (data) => {
+ const signerPtr = {
+ __type: "Pointer",
+ className: "contracts_Contactbook",
+ objectId: data.objectId
+ };
+ const updatePlaceHolder = signerPos.map((x) => {
+ if (x.Id === uniqueId) {
+ return { ...x, signerPtr: signerPtr, signerObjId: data.objectId };
+ }
+ return { ...x };
+ });
+ setSignerPos(updatePlaceHolder);
+
+ const updateSigner = signersdata.map((x) => {
+ if (x.Id === uniqueId) {
+ return { ...x, ...data, className: "contracts_Contactbook" };
+ }
+ return { ...x };
+ });
+ setSignersData(updateSigner);
+ setIsMailSend(false);
+ const index = signersdata.findIndex((x) => x.Id === uniqueId);
+ setIsSelectId(index);
+ };
+
+ // `closePopup` is used to close Add/Choose signer modal
+ const closePopup = () => {
+ setIsAddUser({});
+ };
+
+ // `handleRoleChange` function is call when user update Role name from recipients list
+ const handleRoleChange = (event, roleId) => {
+ // Update the role when the content changes
+ const updatedRoles = signersdata.map((role) =>
+ role.Id === roleId ? { ...role, Role: event.target.value } : role
+ );
+ setSignersData(updatedRoles);
+ const updatedPlaceholder = signerPos.map((role) =>
+ role.Id === roleId ? { ...role, Role: event.target.value } : role
+ );
+ setSignerPos(updatedPlaceholder);
+ setIsMailSend(false);
+ };
+
+ // `handleOnBlur` function is call when user click outside input box
+ const handleOnBlur = (updateRole, roleId) => {
+ // Update the role when the content changes
+ if (!updateRole) {
+ const updatedRoles = signersdata.map((role) =>
+ role.Id === roleId ? { ...role, Role: roleName } : role
+ );
+ setSignersData(updatedRoles);
+ const updatedPlaceholder = signerPos?.map((role) =>
+ role.Id === roleId ? { ...role, Role: roleName } : role
+ );
+ setSignerPos(updatedPlaceholder);
+ }
+ };
+
+ const handleEditTemplateModal = () => {
+ setIsEditTemplate(!isEditTemplate);
+ };
+
+ const handleEditTemplateForm = (data) => {
+ setIsEditTemplate(false);
+ const updateTemplate = pdfDetails.map((x) => {
+ return { ...x, ...data };
+ });
+ setPdfDetails(updateTemplate);
+ setIsMailSend(false);
+ };
+
+ const handleCloseRoleModal = () => {
+ setIsModalRole(false);
+ };
+
+ const handleSaveWidgetsOptions = (
+ dropdownName,
+ dropdownOptions,
+ minCount,
+ maxCount,
+ isReadOnly,
+ addOption,
+ deleteOption,
+ status,
+ defaultValue
+ ) => {
+ const filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos;
+
+ const getPosData = getXYdata;
+ const addSignPos = getPosData.map((position) => {
+ if (position.key === signKey) {
+ if (widgetType === "radio") {
+ if (addOption) {
+ return {
+ ...position,
+
+ Height: position.Height
+ ? position.Height + 15
+ : defaultWidthHeight(widgetType).height + 15
+ };
+ } else if (deleteOption) {
+ return {
+ ...position,
+ Height: position.Height
+ ? position.Height - 15
+ : defaultWidthHeight(widgetType).height - 15
+ };
+ } else {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: dropdownName,
+ values: dropdownOptions,
+ status: status,
+ defaultValue: defaultValue
+ }
+ };
+ }
+ } else if (widgetType === "checkbox") {
+ if (addOption) {
+ return {
+ ...position,
+ Height: position.Height
+ ? position.Height + 15
+ : defaultWidthHeight(widgetType).height + 15
+ };
+ } else if (deleteOption) {
+ return {
+ ...position,
+ Height: position.Height
+ ? position.Height - 15
+ : defaultWidthHeight(widgetType).height - 15
+ };
+ } else {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: dropdownName,
+ values: dropdownOptions,
+ validation: {
+ minRequiredCount: minCount,
+ maxRequiredCount: maxCount
+ },
+ isReadOnly: isReadOnly
+ }
+ };
+ }
+ } else {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: dropdownName,
+ status: status,
+ values: dropdownOptions,
+ defaultValue: defaultValue
+ }
+ };
+ }
+ }
+ return position;
+ });
+
+ const newUpdateSignPos = getPlaceHolder.map((obj) => {
+ if (obj.pageNumber === pageNumber) {
+ return { ...obj, pos: addSignPos };
+ }
+ return obj;
+ });
+ const newUpdateSigner = signerPos.map((obj) => {
+ if (obj.Id === uniqueId) {
+ return { ...obj, placeHolder: newUpdateSignPos };
+ }
+ return obj;
+ });
+
+ setSignerPos(newUpdateSigner);
+ }
+ }
+ };
+
+ const handleWidgetdefaultdata = (defaultdata) => {
+ const options = ["email", "number", "text"];
+ let inputype;
+ if (defaultdata.textvalidate) {
+ inputype = options.includes(defaultdata.textvalidate)
+ ? defaultdata.textvalidate
+ : "regex";
+ } else {
+ inputype = "text";
+ }
+
+ const filterSignerPos = signerPos.filter((data) => data.Id === uniqueId);
+ if (filterSignerPos.length > 0) {
+ const getPlaceHolder = filterSignerPos[0].placeHolder;
+
+ const getPageNumer = getPlaceHolder.filter(
+ (data) => data.pageNumber === pageNumber
+ );
+
+ if (getPageNumer.length > 0) {
+ const getXYdata = getPageNumer[0].pos;
+ const getPosData = getXYdata;
+ const addSignPos = getPosData.map((position) => {
+ if (position.key === signKey) {
+ if (position.type === "text") {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: defaultdata?.name || "text",
+ status: defaultdata?.status || "required",
+ hint: defaultdata?.hint || "",
+ defaultValue: defaultdata?.defaultValue || "",
+ validation: {
+ type: inputype,
+ pattern:
+ inputype === "regex" ? defaultdata.textvalidate : ""
+ }
+ }
+ };
+ } else {
+ return {
+ ...position,
+ options: {
+ ...position.options,
+ name: defaultdata.name,
+ status: defaultdata.status,
+ defaultValue: defaultdata.defaultValue
+ }
+ };
+ }
+ }
+ return position;
+ });
+
+ const newUpdateSignPos = getPlaceHolder.map((obj) => {
+ if (obj.pageNumber === pageNumber) {
+ return { ...obj, pos: addSignPos };
+ }
+ return obj;
+ });
+ const newUpdateSigner = signerPos.map((obj) => {
+ if (obj.Id === uniqueId) {
+ return { ...obj, placeHolder: newUpdateSignPos };
+ }
+ return obj;
+ });
+ setSignerPos(newUpdateSigner);
+ }
+ }
+ setCurrWidgetsDetails({});
+ handleNameModal();
+ };
+ const handleNameModal = () => {
+ setIsNameModal(!isNameModal);
+ setCurrWidgetsDetails({});
+ };
+
+ return (
+ <div>
+ <Title title={"Template"} />
+ <DndProvider backend={HTML5Backend}>
+ {isLoading.isLoad ? (
+ <Loader isLoading={isLoading} />
+ ) : handleError ? (
+ <HandleError handleError={handleError} />
+ ) : noData ? (
+ <Nodata />
+ ) : (
+ <div className="signatureContainer" ref={divRef}>
+ {/* this component used for UI interaction and show their functionality */}
+ {!checkTourStatus && (
+ //this tour component used in your html component where you want to put
+ //onRequestClose function to close tour
+ //steps is defined what will be your messages and style also
+ //isOpen is takes boolean value to open
+ <Tour
+ onRequestClose={closeTour}
+ steps={tourConfig}
+ isOpen={templateTour}
+ rounded={5}
+ closeWithMask={false}
+ />
+ )}
+ {/* this component used to render all pdf pages in left side */}
+ <RenderAllPdfPage
+ signPdfUrl={pdfDetails[0].URL}
+ allPages={allPages}
+ setAllPages={setAllPages}
+ setPageNumber={setPageNumber}
+ setSignBtnPosition={setSignBtnPosition}
+ pageNumber={pageNumber}
+ />
+
+ {/* pdf render view */}
+ <div
+ style={{
+ marginLeft: !isMobile && pdfOriginalWidth > 500 && "20px",
+ marginRight: !isMobile && pdfOriginalWidth > 500 && "20px"
+ }}
+ >
+ {/* this modal is used show alert set placeholder for all signers before send mail */}
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={isSendAlert}
+ title={"Fields required"}
+ handleClose={() => setIsSendAlert(false)}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>Please add field for all recipients.</p>
+ </div>
+ </ModalUi>
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={!IsReceipent}
+ title={"Roles"}
+ handleClose={() => setIsReceipent(true)}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>Please add a role</p>
+ </div>
+ </ModalUi>
+ {/* this modal is used show send mail message and after send mail success message */}
+ <ModalUi
+ isOpen={isCreateDocModal}
+ title={"Create Document"}
+ handleClose={() => setIsCreateDocModal(false)}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>
+ Do you want to create a document using the template you just
+ created ?
+ </p>
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ {currentEmail.length > 0 && (
+ <>
+ <button
+ onClick={() => {
+ handleCreateDocModal();
+ }}
+ style={{
+ background: themeColor,
+ color: "white"
+ }}
+ type="button"
+ className="finishBtn"
+ >
+ Yes
+ </button>
+ <button
+ onClick={() => {
+ setIsCreateDocModal(false);
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ No
+ </button>
+ </>
+ )}
+ </div>
+ </ModalUi>
+ {isCreateDoc && <Loader isLoading={isLoading} />}
+ <ModalUi
+ headerColor={"#dc3545"}
+ isOpen={isShowEmail}
+ title={"signers alert"}
+ handleClose={() => {
+ setIsShowEmail(false);
+ }}
+ >
+ <div style={{ height: "100%", padding: 20 }}>
+ <p>Please select signer for add placeholder!</p>
+ <div
+ style={{
+ height: "1px",
+ backgroundColor: "#9f9f9f",
+ width: "100%",
+ marginTop: "15px",
+ marginBottom: "15px"
+ }}
+ ></div>
+ <button
+ onClick={() => {
+ setIsShowEmail(false);
+ }}
+ type="button"
+ className="finishBtn cancelBtn"
+ >
+ Ok
+ </button>
+ </div>
+ </ModalUi>
+ <DropdownWidgetOption
+ type="radio"
+ title="Radio group"
+ showDropdown={isRadio}
+ setShowDropdown={setIsRadio}
+ handleSaveWidgetsOptions={handleSaveWidgetsOptions}
+ currWidgetsDetails={currWidgetsDetails}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ />
+ <DropdownWidgetOption
+ type="checkbox"
+ title="Checkbox"
+ showDropdown={isCheckbox}
+ setShowDropdown={setIsCheckbox}
+ handleSaveWidgetsOptions={handleSaveWidgetsOptions}
+ currWidgetsDetails={currWidgetsDetails}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ />
+ <DropdownWidgetOption
+ type="dropdown"
+ title="Dropdown options"
+ showDropdown={showDropdown}
+ setShowDropdown={setShowDropdown}
+ handleSaveWidgetsOptions={handleSaveWidgetsOptions}
+ currWidgetsDetails={currWidgetsDetails}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ />
+ <PlaceholderCopy
+ isPageCopy={isPageCopy}
+ setIsPageCopy={setIsPageCopy}
+ xyPostion={signerPos}
+ setXyPostion={setSignerPos}
+ allPages={allPages}
+ pageNumber={pageNumber}
+ signKey={signKey}
+ // signerObjId={signerObjId}
+ Id={uniqueId}
+ />
+ {/* pdf header which contain funish back button */}
+ <Header
+ completeBtnTitle={"Save"}
+ isPlaceholder={true}
+ pageNumber={pageNumber}
+ allPages={allPages}
+ changePage={changePage}
+ pdfDetails={pdfDetails}
+ signerPos={signerPos}
+ signersdata={signersdata}
+ isMailSend={isMailSend}
+ alertSendEmail={alertSendEmail}
+ isShowHeader={true}
+ currentSigner={true}
+ setIsEditTemplate={handleEditTemplateModal}
+ dataTut4="reactourFour"
+ />
+ <div data-tut="reactourThird">
+ {containerWH && (
+ <RenderPdf
+ pageNumber={pageNumber}
+ pdfOriginalWidth={pdfOriginalWidth}
+ pdfNewWidth={pdfNewWidth}
+ pdfDetails={pdfDetails}
+ signerPos={signerPos}
+ successEmail={false}
+ numPages={numPages}
+ pageDetails={pageDetails}
+ placeholder={true}
+ drop={drop}
+ handleDeleteSign={handleDeleteSign}
+ handleTabDrag={handleTabDrag}
+ handleStop={handleStop}
+ setPdfLoadFail={setPdfLoadFail}
+ pdfLoadFail={pdfLoadFail}
+ setSignerPos={setSignerPos}
+ containerWH={containerWH}
+ setIsResize={setIsResize}
+ setZIndex={setZIndex}
+ handleLinkUser={handleLinkUser}
+ setUniqueId={setUniqueId}
+ signersdata={signersdata}
+ setIsPageCopy={setIsPageCopy}
+ setSignKey={setSignKey}
+ setSignerObjId={setSignerObjId}
+ isDragging={isDragging}
+ setShowDropdown={setShowDropdown}
+ setCurrWidgetsDetails={setCurrWidgetsDetails}
+ setWidgetType={setWidgetType}
+ setIsRadio={setIsRadio}
+ setSelectWidgetId={setSelectWidgetId}
+ selectWidgetId={selectWidgetId}
+ setIsCheckbox={setIsCheckbox}
+ handleNameModal={handleNameModal}
+ />
+ )}
+ </div>
+ </div>
+ {/* signature button */}
+ {isMobile ? (
+ <div>
+ <WidgetComponent
+ dataTut="reactourFirst"
+ dataTut2="reactourSecond"
+ pdfUrl={isMailSend}
+ dragSignature={dragSignature}
+ signRef={signRef}
+ handleDivClick={handleDivClick}
+ handleMouseLeave={handleMouseLeave}
+ isDragSign={isDragSign}
+ themeColor={themeColor}
+ dragStamp={dragStamp}
+ dragRef={dragRef}
+ isDragStamp={isDragStamp}
+ isSignYourself={false}
+ addPositionOfSignature={addPositionOfSignature}
+ signerPos={signerPos}
+ signersdata={signersdata}
+ isSelectListId={isSelectListId}
+ setSignerObjId={setSignerObjId}
+ setIsSelectId={setIsSelectId}
+ setContractName={setContractName}
+ isSigners={isSigners}
+ setIsShowEmail={setIsShowEmail}
+ isMailSend={isMailSend}
+ setSelectedEmail={setSelectedEmail}
+ selectedEmail={selectedEmail}
+ handleAddSigner={handleAddSigner}
+ setUniqueId={setUniqueId}
+ setRoleName={setRoleName}
+ handleDeleteUser={handleDeleteUser}
+ handleRoleChange={handleRoleChange}
+ handleOnBlur={handleOnBlur}
+ title={"Roles"}
+ initial={true}
+ isTemplateFlow={true}
+ />
+ </div>
+ ) : (
+ <div>
+ <div className="signerComponent">
+ <div
+ style={{ maxHeight: window.innerHeight - 70 + "px" }}
+ className="autoSignScroll"
+ >
+ <SignerListPlace
+ signerPos={signerPos}
+ signersdata={signersdata}
+ isSelectListId={isSelectListId}
+ setSignerObjId={setSignerObjId}
+ setRoleName={setRoleName}
+ setIsSelectId={setIsSelectId}
+ setContractName={setContractName}
+ handleAddSigner={handleAddSigner}
+ setUniqueId={setUniqueId}
+ handleDeleteUser={handleDeleteUser}
+ handleRoleChange={handleRoleChange}
+ handleOnBlur={handleOnBlur}
+ title={"Roles"}
+ />
+ <div data-tut="reactourSecond">
+ <WidgetComponent
+ pdfUrl={isMailSend}
+ dragSignature={dragSignature}
+ signRef={signRef}
+ handleDivClick={handleDivClick}
+ handleMouseLeave={handleMouseLeave}
+ isDragSign={isDragSign}
+ themeColor={themeColor}
+ dragStamp={dragStamp}
+ dragRef={dragRef}
+ isDragStamp={isDragStamp}
+ isSignYourself={false}
+ addPositionOfSignature={addPositionOfSignature}
+ title={"Roles"}
+ initial={true}
+ isTemplateFlow={true}
+ />
+ </div>
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ )}
+ </DndProvider>
+ <div data-tut="reactourAddbtn--observe">
+ <AddRoleModal
+ isModalRole={isModalRole}
+ roleName={roleName}
+ signersdata={signersdata}
+ setRoleName={setRoleName}
+ handleAddRole={handleAddRole}
+ handleCloseRoleModal={handleCloseRoleModal}
+ />
+ </div>
+ <div>
+ <LinkUserModal
+ handleAddUser={handleAddUser}
+ isAddUser={isAddUser}
+ uniqueId={uniqueId}
+ closePopup={closePopup}
+ />
+ </div>
+ <ModalUi
+ title={"Edit Template"}
+ isOpen={isEditTemplate}
+ handleClose={handleEditTemplateModal}
+ >
+ <EditTemplate
+ template={pdfDetails?.[0]}
+ onSuccess={handleEditTemplateForm}
+ />
+ </ModalUi>
+ <WidgetNameModal
+ widgetName={widgetName}
+ defaultdata={currWidgetsDetails}
+ isOpen={isNameModal}
+ handleClose={handleNameModal}
+ handleData={handleWidgetdefaultdata}
+ />
+ </div>
+ );
+};
+
+export default TemplatePlaceholder;
diff --git a/apps/OpenSign/src/styles/AddUser.css b/apps/OpenSign/src/styles/AddUser.css
new file mode 100644
index 000000000..00576a9fc
--- /dev/null
+++ b/apps/OpenSign/src/styles/AddUser.css
@@ -0,0 +1,79 @@
+.addusercontainer {
+ height: 100%;
+ padding: 10px 20px 10px 20px;
+}
+
+.loaderdiv {
+ position: fixed;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ background-color: rgba(0, 0, 0, 0.3);
+
+}
+
+.form-wrapper {
+ width: 100%;
+ margin-left: auto;
+ margin-right: auto;
+ padding: 8px;
+}
+
+.form-section {
+ margin-bottom: 0.75rem;
+}
+
+.checkbox-label {
+ margin-left: 0.5rem;
+ color: #4b5563;
+}
+
+.addUserInput {
+ padding: 0.5rem 0.75rem;
+ width: 100%;
+ border-width: 1px;
+ border-color: #d1d5db;
+ border-radius: 0.375rem;
+ outline: none;
+ font-size: 0.75rem;
+}
+
+
+.buttoncontainer {
+ margin-top: 1rem;
+ display: flex;
+ justify-content: flex-start;
+}
+
+.submitbutton {
+ background: #1ab6ce;
+ border-radius: 2px;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+ border: none;
+ text-transform: uppercase;
+ font-size: 13px;
+ font-weight: 600;
+ padding: 0.375rem 0.75rem;
+ text-align: center;
+ color: #ffffff;
+ outline: none;
+}
+/* For classes: bg-[#188ae2] text-sm text-white px-4 py-2 rounded ml-2 shadow focus:outline-none */
+.resetbutton {
+ background-color: #188ae2;
+ border-radius: 2px;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+ border: none;
+ text-transform: uppercase;
+ font-size: 13px;
+ font-weight: 600;
+ padding: 0.375rem 0.75rem;
+ text-align: center;
+ color: #ffffff;
+ outline: none;
+ margin-left: 8px;
+}
\ No newline at end of file
diff --git a/apps/OpenSign/src/styles/certificate.css b/apps/OpenSign/src/styles/certificate.css
new file mode 100644
index 000000000..6d491ca7b
--- /dev/null
+++ b/apps/OpenSign/src/styles/certificate.css
@@ -0,0 +1,9 @@
+.containerBox {
+ border-radius: 5px;
+ padding: 10px;
+}
+
+.certificateBox {
+ border: 1px solid rgb(177, 174, 174);
+ padding: 20px;
+}
\ No newline at end of file
diff --git a/apps/OpenSign/src/styles/customModal.css b/apps/OpenSign/src/styles/customModal.css
new file mode 100644
index 000000000..4fc6b56c1
--- /dev/null
+++ b/apps/OpenSign/src/styles/customModal.css
@@ -0,0 +1,59 @@
+.parentDiv {
+ background: gray;
+ position: absolute;
+ z-index: 20;
+ background-color: rgba(0, 0, 0, 0.75);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+}
+
+.childDiv {
+ width: 40%;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-content: center;
+ background-color: #fff;
+ margin: 30px 20px;
+ border: 0px 1px 1px 1px solid rgba(0, 0, 0, 0.2);
+ border-radius: 0.3rem;
+ outline: 0;
+}
+
+.modalHeadDiv {
+ padding: 10px;
+ color: #fff;
+ border-top-left-radius: 0.3rem;
+ border-top-right-radius: 0.3rem;
+ font-size: 17px;
+ font-weight: 400;
+}
+
+.modalBodyDIv {
+ padding: 15px;
+}
+
+.spanTagHead {
+ color: white !important;
+ font-size: 17px;
+ font-weight: 500;
+}
+
+.pTagBody {
+ font-size: 15px !important;
+}
+
+.modalFooterDiv {
+ margin: 15px 15px 15px 5px;
+ display: flex;
+ justify-content: flex-start;
+}
+
+@media screen and (max-width: 500px) {
+ .childDiv {
+ margin: 50px 7px;
+ width: 80%;
+ }
+}
diff --git a/apps/OpenSign/src/styles/loginPage.css b/apps/OpenSign/src/styles/loginPage.css
new file mode 100644
index 000000000..bd80e9b0b
--- /dev/null
+++ b/apps/OpenSign/src/styles/loginPage.css
@@ -0,0 +1,210 @@
+.loginInput{
+ padding: 10px;
+
+ border-radius: 4px;
+ width: 100%;
+ font-size: 0.75rem;
+ border: 1px solid #e2dddd;;
+ background-color: #e0e5f5;
+ color: black;
+
+ padding-left: 1rem!important;
+ padding-right: 1rem!important;
+ padding-top: 0.5rem!important;
+
+ font-family: inherit;
+ font-feature-settings: inherit;
+ font-variation-settings: inherit;
+ font-weight: inherit;
+ overflow: visible;
+
+ }
+ .loginInput:focus{
+ outline: none;
+ border: none;
+ }
+.verifyBtn{
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 3px 30px;
+ color: white;
+ font-weight: 500 !important;
+ font-size: 14px !important;
+ border: none;
+}
+.verifyBtn:focus {
+ border: none;
+ outline: none;
+}
+
+
+.verifyBtn:hover {
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+ color: white;
+}
+.fakeimg {
+ height: 200px;
+ background: #aaa;
+}
+
+.GTRY {
+ border: 1px solid #dee2e6;
+ margin-top: 75px;
+ padding-bottom: 20px;
+ background-color: #fff;
+}
+
+.main_head {
+ width: 100%;
+ height: 66px;
+ background-color: #fff;
+ margin-bottom: 52px;
+ padding-top: 10px;
+}
+
+.main-logo {
+ width: 250px;
+ height: 66px;
+ display: inline-block;
+}
+
+.card-box {
+ background: #fff;
+ min-height: 50px;
+ box-shadow: 0 20px 20px rgba(0, 0, 0, 0.1);
+ position: relative;
+ margin-bottom: 20px;
+ transition: 0.5s;
+ border: 1px solid #f2f2f2;
+ border-radius: 7px;
+ margin-top: 10px;
+}
+
+.LKJH {
+ display: flex;
+}
+
+.GTR {
+ text-align: left;
+}
+
+.JUI {
+ text-align: right;
+}
+
+.btn-info {
+ color: #fff;
+ background-color: #15b4e9;
+ border-color: #15b4e9;
+}
+
+.btn-info:hover {
+ color: #fff;
+ background-color: #15b4e9;
+ border-color: #15b4e9;
+}
+
+.btn-reg {
+ color: #15b4e9;
+ background-color: #ffffff;
+ border-color: #15b4e9;
+}
+
+.btn-reg:hover {
+ color: #15b4e9;
+ background-color: #ffffff;
+ border-color: #15b4e9;
+}
+
+.SYTU {
+ display: flex;
+}
+
+.MLKI {
+ float: right;
+ margin-bottom: 12px;
+}
+
+
+.login-btn {
+ width: 100% !important;
+ display: block !important;
+}
+
+@media only screen and (max-width: 667px) {
+ .MLKI {
+ float: inherit;
+ }
+
+
+ .login-btn {
+ width: 210px !important;
+ }
+}
+
+.MLKI a {
+ color: #212529;
+}
+
+.KNLO {
+ color: #878787;
+ font-size: 13px;
+}
+
+.form-check-label {
+ margin-left: 17px;
+ margin-bottom: 12px;
+}
+.welcomeText{
+ font-size: 30px;
+}
+
+
+@media only screen and (max-width: 600px) {
+ .KLO1 {
+ display: none;
+ }
+
+ .MLKI a {
+ font-size: 12px;
+ }
+
+ .form-check-label {
+ font-size: 12px;
+ margin-bottom: 14px;
+ }
+
+ .MKUY {
+ text-align: center;
+ padding-top: 10px;
+ }
+
+ .main_head {
+ margin-bottom: 12px;
+ padding-top: 10px;
+ border-bottom: 1px dashed #eeeeee;
+ }
+
+
+
+}
+@media screen and (max-width:366px) {
+
+ .main-logo {
+ width: 150px;
+ height: 46px;
+ display: inline-block;
+ }
+ .welcomeText{
+ font-size: 20px;
+ }
+ .KNLO {
+ color: #878787;
+ font-size: 10px;
+ }
+ .btnContainer{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+
+}
\ No newline at end of file
diff --git a/apps/OpenSign/src/styles/managesign.css b/apps/OpenSign/src/styles/managesign.css
new file mode 100644
index 000000000..c273c7082
--- /dev/null
+++ b/apps/OpenSign/src/styles/managesign.css
@@ -0,0 +1,225 @@
+.mainDiv {
+ position: relative;
+}
+
+.successBtn {
+ background: #3ac9d6;
+ border: 1px solid #3ac9d6;
+}
+
+.warning {
+ position: absolute;
+ padding: 8px;
+ border: 1px solid black;
+ background: white;
+ width: 300px;
+ border-radius: 5px;
+ animation: inAnimation 2s ease-in-out;
+ z-index: 1;
+}
+
+.nameWarning {
+ position: absolute;
+ bottom: -70px;
+ left: 10px;
+}
+
+.nameWarning::before {
+ content: '';
+ width: 0px;
+ height: 0px;
+ border-style: outset;
+ border-width: 0px 10px 10px 10px;
+ border-color: transparent transparent black transparent;
+ display: inline-block;
+ position: absolute;
+ top: -29%;
+ left: 0;
+ right: 75%;
+ margin: 0 auto;
+}
+
+.signWarning {
+ bottom: 70px;
+ left: 50px;
+}
+
+.signWarning::before {
+ content: '';
+ width: 0px;
+ height: 0px;
+ border-style: outset;
+ border-width: 0px 10px 10px 10px;
+ border-color: transparent transparent black transparent;
+ display: inline-block;
+ position: absolute;
+ top: -29%;
+ left: 0;
+ right: 75%;
+ margin: 0 auto;
+}
+
+.successBox {
+ z-index: 1;
+ position: absolute;
+ top: 5%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ font-size: 13px;
+ animation: inAnimation 2s ease-in-out;
+}
+
+@keyframes inAnimation {
+ 0% {
+ opacity: 0;
+ visibility: hidden;
+ }
+
+ 25% {
+ opacity: 1;
+ visibility: visible;
+ }
+
+ 50% {
+ opacity: 1;
+ visibility: visible;
+ }
+
+ 75% {
+ opacity: 1;
+ visibility: visible;
+ }
+
+ 100% {
+ opacity: 0;
+ visibility: hidden;
+ }
+}
+
+.signature {
+ color: white;
+ cursor: pointer;
+ padding: 10px 14px 10px;
+ background: #15b4e9;
+ font-size: 12px;
+ font-weight: 600;
+ border-radius: 2px;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+}
+
+.signature:hover {
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+ background: #13a8da;
+ color: white;
+}
+
+.imgupload {
+ color: white;
+ cursor: pointer;
+ padding: 10px 14px 10px;
+ background: #15b4e9;
+ font-size: 12px;
+ font-weight: 600;
+ border-radius: 2px;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ min-width: 105px;
+}
+
+.imgupload:hover {
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+ background: #13a8da;
+ color: white;
+}
+
+
+.loaderContainer {
+ position: fixed;
+ inset: 0%;
+ width: 100%;
+ height: 100svh;
+ background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7));
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.loader {
+ width: 70px;
+ height: 70px;
+ border-top: 4px solid #1b8ef4;
+ border-left: 4px solid #1b8ef4;
+ border-radius: 80%;
+ animation: spin 0.5s linear infinite;
+
+}
+
+@keyframes spin {
+ from {
+ transform: rotate(0);
+ }
+
+ to {
+ transform: rotate(360deg);
+ }
+}
+
+.customBtn {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 10px 14px 10px;
+ color: white;
+ font-weight: 600;
+ font-size: 12px;
+ text-transform: uppercase;
+ border-radius: 2px;
+ margin-left: 10px;
+ width: 100px;
+}
+
+.clearbtn {
+ font-size: 15px;
+}
+
+.clearbtn:hover {
+ text-decoration: underline;
+ text-underline-offset: 2px;
+ color: blue;
+}
+
+.successBtn:hover {
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+ background: #1ab6ce;
+ color: white;
+
+}
+
+.resetBtn {
+ background: #188ae2;
+ margin-left: 10;
+ border: 1px solid #188ae2;
+}
+
+.resetBtn:hover {
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+ background: #177ecd;
+ color: white;
+}
+
+.signBlock {
+ display: flex;
+ flex-direction: row;
+ gap: 12px;
+}
+.signInputManage{
+ width: 50%;
+}
+@media (max-width: 815px) {
+ .signBlock {
+ display: flex;
+ flex-direction: column;
+
+ }
+ .signInputManage{
+ width: 100%;
+ }
+}
+
\ No newline at end of file
diff --git a/apps/OpenSign/src/styles/opensigndrive.css b/apps/OpenSign/src/styles/opensigndrive.css
new file mode 100644
index 000000000..76b414cce
--- /dev/null
+++ b/apps/OpenSign/src/styles/opensigndrive.css
@@ -0,0 +1,540 @@
+@import "@radix-ui/colors/black-alpha.css";
+@import "@radix-ui/colors/mauve.css";
+@import "@radix-ui/colors/violet.css";
+
+.ContextMenuContent,
+.ContextMenuSubContent {
+ min-width: 135px;
+ background-color: white;
+ border-radius: 6px;
+ overflow: hidden;
+ padding: 5px;
+ box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35),
+ 0px 10px 20px -15px rgba(22, 23, 24, 0.2);
+ z-index: 99;
+}
+
+.ContextMenuItem,
+.ContextMenuCheckboxItem,
+.ContextMenuRadioItem,
+.ContextMenuSubTrigger {
+ font-size: 13px;
+ line-height: 1;
+ color: var(--violet-11);
+ border-radius: 3px;
+ display: flex;
+ align-items: center;
+ height: 25px;
+ padding: 0 5px;
+ position: relative;
+ padding-left: 15px;
+ user-select: none;
+ outline: none;
+}
+
+.ContextMenuSubTrigger[data-state="open"] {
+ background-color: gray;
+ color: var(--violet-11);
+}
+
+.ContextMenuItem[data-disabled],
+.ContextMenuCheckboxItem[data-disabled],
+.ContextMenuRadioItem[data-disabled],
+.ContextMenuSubTrigger[data-disabled] {
+ color: var(--mauve-8);
+ pointer-events: "none";
+}
+
+.ContextMenuItem[data-highlighted],
+.ContextMenuCheckboxItem[data-highlighted],
+.ContextMenuRadioItem[data-highlighted],
+.ContextMenuSubTrigger[data-highlighted] {
+ background-color: #dad9db;
+ color: var(--violet-11);
+}
+
+.ContextMenuLabel {
+ padding-left: 25px;
+ font-size: 12px;
+ line-height: 25px;
+ color: var(--mauve-11);
+}
+
+.ContextMenuItemIndicator {
+ position: absolute;
+ left: 0;
+ width: 25px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.RightSlot {
+ margin-left: auto;
+ padding-left: 20px;
+ color: var(--mauve-11);
+}
+
+[data-highlighted] > .RightSlot {
+ color: white;
+}
+
+[data-disabled] .RightSlot {
+ color: var(--mauve-8);
+}
+
+.dropdown-menu {
+ min-width: 10rem;
+}
+
+.dropdown-item {
+ display: block;
+ width: 100%;
+ padding: 0.3rem 1.2rem;
+ clear: both;
+ font-weight: 400;
+ color: #393a39;
+ text-align: inherit;
+ white-space: nowrap;
+ background-color: transparent;
+ border: 0;
+ cursor: pointer;
+}
+
+.dropdown-item:hover {
+ background-color: #dad9db;
+ color: var(--violet-11);
+}
+
+.itemColor {
+ font-size: 13px !important;
+}
+
+.folderComponent {
+ padding: 30px;
+ height: 100%;
+ border-radius: 5px;
+}
+.inputStyle {
+ border: 1.6px solid #ccc !important;
+}
+.folderComponent::-webkit-scrollbar {
+ display: none;
+ /* for Chrome, Safari, and Opera */
+}
+
+.modal {
+ margin-top: 50px;
+}
+
+.folderBox {
+ /* box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
+ margin: 10px ;
+ padding: 5px 0px 5px 40px; */
+ /* overflow: scroll;
+ display: flex;
+ justify-content: space-between;
+ width: 200px; */
+ margin: 10px;
+ /* box-shadow: rgba(0, 0, 0, 0.15) 1.95px 1.95px 2.6px; */
+}
+
+.folderContainer {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+}
+
+/* .folderBox:hover{
+ box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
+ font-weight: bold;
+ } */
+.pdfName {
+ font-size: 10px;
+ font-weight: 600;
+}
+
+.viewbotton {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 8px 20px;
+ color: white;
+ font-weight: 600;
+ font-size: 14px;
+ border: none;
+ border-radius: 2px;
+ margin-left: 10px;
+}
+
+.viewbotton:focus {
+ border: none;
+ outline: none;
+}
+
+.folderRender {
+ display: flex;
+ flex-direction: column;
+
+ justify-content: center;
+ align-items: center;
+ cursor: pointer;
+ position: relative;
+ width: 100px;
+ height: 100px;
+ margin: 20px;
+ display: inline-block;
+}
+
+.pdfContainer {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ margin-top: 20px;
+ align-items: center;
+
+ justify-content: space-around;
+}
+
+.pdfContainer .box:last-child {
+ margin-left: 0;
+ /* Override the margin on the last box */
+ margin-right: auto;
+ /* Align it to the start */
+}
+
+.icon-container {
+ position: relative;
+ width: 100px;
+ height: 100px;
+ margin: 10px;
+ display: inline-block;
+
+ cursor: pointer;
+}
+
+.hrStyle {
+ margin-top: 0rem !important;
+ margin-bottom: 0rem !important;
+ border: 0;
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
+}
+
+.pdf-icon {
+ width: 100%;
+ height: 100%;
+}
+
+.status-badge {
+ position: absolute;
+ top: 0;
+ right: 0;
+ background-color: #fff;
+
+ width: 24px;
+ height: 24px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-radius: 50%;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+}
+
+.status-badge i {
+ font-size: 12px;
+}
+
+/* Status-specific colors */
+.completed {
+ background-color: #4caf50;
+ color: #fff;
+}
+
+.in-progress {
+ background-color: #ffc107;
+ color: #fff;
+}
+
+.declined {
+ background-color: #f44336;
+ color: #fff;
+}
+
+.expired {
+ background-color: #9e9e9e;
+ color: #fff;
+}
+
+.draft {
+ background-color: #079cdc;
+ color: #fff;
+}
+
+.add {
+ background-color: #05bbdb;
+ color: #fff;
+ padding: 8px 15px;
+ text-align: center;
+ display: flex;
+ margin: 5px;
+}
+
+.sort {
+ padding: 8px 15px;
+ margin: 5px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ cursor: pointer;
+}
+
+.sort:hover {
+ box-shadow: 0 2px 4px rgba(168, 204, 206, 0.1);
+ background-color: var(--mauve-3);
+ border-radius: 2px;
+}
+
+/* Hover effect */
+.info-box {
+ position: absolute;
+
+ bottom: 100%;
+ left: 0;
+ background-color: #fff;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ padding: 5px;
+ width: 180px;
+ display: none;
+ z-index: 10;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+ text-align: center;
+}
+
+.icon-container:hover .info-box {
+ display: block;
+}
+
+.folderRender:hover .info-box {
+ display: block;
+}
+
+.info-box:hover {
+ z-index: 999;
+}
+
+.addFolderInput {
+ padding: 10px;
+
+ border-radius: 4px;
+ /* width: 440px; */
+ font-size: 15px;
+
+ border: 0.5px solid rgb(198, 195, 195);
+}
+
+.tooltip-inner {
+ background-color: #fff;
+ border: 1px solid black;
+ font-weight: 600;
+ opacity: 1 !important;
+ color: rgb(0, 0, 0);
+ border-radius: 3px;
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+ font-size: 12px;
+}
+
+.fileName {
+ display: inline-block;
+ width: 100px;
+ white-space: nowrap;
+ overflow: hidden !important;
+ text-overflow: ellipsis;
+ font-size: 11px;
+ text-align: center;
+ font-weight: 480;
+}
+
+.foldName {
+ display: inline-block;
+ width: 100px;
+ white-space: nowrap;
+ overflow: hidden !important;
+ text-overflow: ellipsis;
+ font-size: 11px;
+ text-align: center;
+ font-weight: 480;
+}
+
+.statusSpan {
+ font-size: 12px;
+ font-weight: 500;
+}
+
+a {
+ all: unset;
+}
+
+.HoverCardContent {
+ border-radius: 6px;
+ padding: 5px 10px;
+ width: 170px;
+ background-color: white;
+ box-shadow: hsl(206 22% 7% / 35%) 0px 10px 38px -10px,
+ hsl(206 22% 7% / 20%) 0px 10px 20px -15px;
+ animation-duration: 400ms;
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
+ will-change: transform, opacity;
+ text-align: center;
+ align-items: center;
+}
+
+.HoverCardContent[data-side="top"] {
+ animation-name: slideDownAndFade;
+}
+
+.HoverCardContent[data-side="right"] {
+ animation-name: slideLeftAndFade;
+}
+
+.HoverCardContent[data-side="bottom"] {
+ animation-name: slideUpAndFade;
+}
+
+.HoverCardContent[data-side="left"] {
+ animation-name: slideRightAndFade;
+}
+
+.HoverCardArrow {
+ fill: white;
+}
+
+@keyframes slideUpAndFade {
+ 0% {
+ opacity: 0;
+ transform: translateY(2px);
+ }
+
+ 100% {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+@keyframes slideRightAndFade {
+ 0% {
+ opacity: 0;
+ transform: translateX(-2px);
+ }
+
+ 100% {
+ opacity: 1;
+ transform: translateX(0);
+ }
+}
+
+@keyframes slideDownAndFade {
+ 0% {
+ opacity: 0;
+ transform: translateY(-2px);
+ }
+
+ 100% {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+@keyframes slideLeftAndFade {
+ 0% {
+ opacity: 0;
+ transform: translateX(2px);
+ }
+
+ 100% {
+ opacity: 1;
+ transform: translateX(0);
+ }
+}
+
+.dropMenuBD {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+}
+
+.dropMenuSS {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ justify-content: space-between;
+ display: none;
+}
+
+.folderPath {
+ overflow-x: auto;
+ white-space: nowrap;
+
+ cursor: pointer;
+ user-select: none;
+}
+
+.folderPath::-webkit-scrollbar {
+ display: none;
+ /* for Chrome, Safari, and Opera */
+}
+
+.docDeleteBtn {
+ /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18); */
+ box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000),
+ var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
+ padding: 7px 17px;
+ color: white;
+ font-weight: 600 !important;
+ font-size: 12px !important;
+ border: none;
+ border-radius: 2px;
+}
+
+.docDeleteBtn:focus {
+ border: none;
+ outline: none;
+}
+
+.docDeleteBtn:hover {
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+ color: white;
+}
+
+@media screen and (max-width: 766px) {
+ .itemColor {
+ font-size: 10px !important;
+ }
+}
+
+@media (min-width: 310px) and (max-width: 550px) {
+ .pdfContainer {
+ justify-content: space-around;
+ }
+
+ .sort {
+ padding: 2px;
+ }
+
+ .folderComponent {
+ margin: 10px;
+ }
+}
+
+@media screen and (max-width: 309px) {
+ .pdfContainer {
+ justify-content: center;
+ }
+
+ .sort {
+ padding: 2px;
+ }
+
+ .folderComponent {
+ margin: 10px;
+ }
+}
diff --git a/apps/OpenSign/src/styles/signature.css b/apps/OpenSign/src/styles/signature.css
new file mode 100644
index 000000000..3559b8efc
--- /dev/null
+++ b/apps/OpenSign/src/styles/signature.css
@@ -0,0 +1,1272 @@
+@import url('https://fonts.googleapis.com/css2?family=Fasthand&display=swap');
+@import url('https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap');
+@import url('https://fonts.googleapis.com/css2?family=Delicious+Handrawn&display=swap');
+@import url('https://fonts.googleapis.com/css2?family=Cedarville+Cursive&display=swap');
+
+.placeholderBlock {
+ padding: 0px;
+ position: absolute;
+ border-style: dashed;
+ width: 150px;
+ height: 60px;
+ background: #daebe0;
+ text-align: center;
+ justify-content: center;
+ border-width: 0.2px;
+
+}
+
+.dropdownContainer {
+ display: flex;
+ flex-direction: column;
+ overflow-y: scroll;
+ max-height: 250px;
+}
+
+.dropdownContainer::-webkit-scrollbar {
+ display: none;
+}
+
+.react-datepicker__input-container {
+ position: initial !important;
+}
+
+.widgets {
+ -webkit-user-select: none;
+ /* Disable text selection in WebKit browsers */
+ -moz-user-select: none;
+ user-select: none;
+
+}
+
+.inputPlaceholder {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ /* font-size: 12px; */
+ border: 1px solid #007bff;
+ border-radius: 2px;
+
+}
+
+.radioButton {
+ width: 100%;
+ height: 100%;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ font-size: 12px;
+ border: 1px solid #007bff;
+ border-radius: 50px;
+}
+
+.inputPlaceholder:focus {
+ outline: none;
+ border: 1px solid #188ae2;
+}
+
+.drodown-input {
+ padding: 5px;
+ width: 100%;
+ font-size: 0.75rem;
+ border: 1px solid #8ad5ce;
+ /* border: 1px solid #e2dddd; */
+ /* background-color: #e0e5f5; */
+ color: black;
+ font-family: inherit;
+ font-feature-settings: inherit;
+ font-variation-settings: inherit;
+ font-weight: inherit;
+ overflow: visible;
+
+}
+
+.drodown-input:focus {
+ outline: none;
+ border: 1px solid #099b8d;
+}
+
+.dropdownAdd {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+
+ color: white;
+ font-weight: 600;
+ font-size: 13px;
+ border: none;
+ margin-left: 10px;
+
+}
+
+.dropdownAdd:focus {
+ outline: none;
+}
+
+.dropdownList {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ width: 50%;
+}
+
+.signatureCanvas {
+
+ border: 2px solid #888;
+ background-color: rgb(255, 255, 255);
+ width: 460px;
+ height: 184px;
+}
+
+.intialSignatureCanvas {
+ border: 2px solid #888;
+ background-color: rgb(255, 255, 255);
+ width: 150px;
+ height: 150px;
+}
+
+.intialSignature {
+ border: 2px solid #888;
+ background-color: rgb(255, 255, 255);
+ width: 183px;
+ height: 183px;
+}
+
+.penContainerDefault {
+ width: 460px;
+}
+
+.penContainerInitial {
+ width: 183px;
+}
+
+.borderResize {
+ position: absolute;
+ display: inline-block;
+ width: 14px;
+ height: 14px;
+
+}
+
+.borderResize :hover {
+ cursor: sw-resize;
+}
+
+.dropdown-date-menu {
+ min-width: 7rem;
+}
+
+
+.mailBtn {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 3px 15px !important;
+ background-color: rgb(79 190 241);
+ border: none !important;
+ color: white !important;
+}
+
+.mailBtn:hover {
+ box-shadow: 0 2px 4px rgba(154, 36, 36, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+}
+
+.emailToast {
+ position: absolute;
+ z-index: 10;
+ background: #aeedae;
+ padding: 0 3px 3px 3px;
+ margin: 2px;
+ border-radius: 2px;
+}
+
+
+.signatureBtn {
+ border: 1.5px solid #47a3ad;
+
+ border-radius: 3px;
+ display: flex;
+ padding: 0px;
+ justify-content: space-between;
+ background: white;
+ transition-duration: 0.4s;
+ cursor: all-scroll;
+ width: 150px;
+ height: 30px;
+ color: black;
+}
+
+.disableSign {
+ border: 1.5px solid #47a3ad;
+ margin-bottom: 10px;
+ border-radius: 3px;
+ display: flex;
+ padding: 0px;
+ justify-content: space-between;
+ background: white;
+ transition-duration: 0.4s;
+ cursor: all-scroll;
+ width: 150px;
+ height: 30px;
+ color: black;
+ border: 1px solid rgb(203, 203, 203);
+ cursor: text;
+}
+
+.emailInput {
+ padding: 10px;
+ border: 1.5px solid gray;
+ border-radius: 4px;
+ width: 100%;
+ font-size: 15px;
+ padding-bottom: 20px;
+}
+
+.emailInput:focus {
+ outline: none;
+ border: 1.5px solid #47a3ad;
+}
+
+.addEmail {
+ padding: "0px";
+ border: 1.5px solid #47a3ad;
+ border-radius: 4px;
+ width: 100%;
+ font-size: 15px;
+}
+
+.addEmail,
+.emailInput {
+ outline: none;
+}
+
+.addEmailInput {
+ border: none;
+ outline: none;
+}
+
+.emailChip {
+ background-color: #47a3ad;
+ margin: 4px;
+ border-radius: 10px;
+ padding: 5px 10px;
+}
+
+.addEmailInput {
+ padding: 10px;
+ border-radius: 4px;
+ width: 100%;
+ font-size: 15px;
+}
+
+.addEmailInput:focus {
+ outline: none;
+ border: none;
+}
+
+.signatureInput {
+ width: 80%;
+ border-radius: 4px;
+ font-size: 20px;
+ border: 1px solid #e2dddd;
+ color: black;
+ font-family: inherit;
+ font-feature-settings: inherit;
+ font-variation-settings: inherit;
+ font-weight: inherit;
+ overflow: visible;
+ height: 30px;
+}
+
+.signatureInput:focus {
+ outline: none;
+ border: 1px solid blue;
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+}
+
+.resizable-box-overlay {
+ position: absolute;
+ border: 2px solid #ddd;
+ overflow: hidden;
+ background-color: white;
+}
+
+.box-content {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+}
+
+.close-button {
+ align-self: flex-end;
+ margin: 8px;
+ cursor: pointer;
+}
+
+.placeholdCloseBtn {
+ position: absolute;
+ right: -5px;
+ top: -5px;
+ border-radius: 100%;
+ font-size: 10px;
+ cursor: pointer;
+ padding: 0px 5.1px 1px 5px;
+}
+
+.signCloseBtn {
+ position: absolute;
+
+ font-size: 14px;
+ cursor: pointer;
+ z-index: 2;
+ background: white;
+}
+
+.signCopy {
+ position: absolute;
+
+ font-size: 13px;
+ cursor: pointer;
+ z-index: 2;
+ background: white;
+}
+
+.signUserIcon {
+ position: absolute;
+
+ font-size: 13px;
+ cursor: pointer;
+ z-index: 2;
+ background: white;
+}
+
+.settingIcon {
+ position: absolute;
+
+ font-size: 13px;
+ cursor: pointer;
+ z-index: 2;
+ background: white;
+}
+
+.ScrollbarsCustom-Track {
+ width: 4px !important;
+}
+
+.signYourselfBlock {
+ padding: 0px;
+ display: flex !important;
+ justify-content: center !important;
+ align-items: center !important;
+}
+
+.finishBtn {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 3px 30px;
+ color: white;
+ font-weight: 500 !important;
+ font-size: 14px !important;
+ border: none;
+ margin-left: 10px;
+ border-radius: 2px;
+}
+
+.sendMail {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 3px 30px;
+ color: white;
+ font-weight: 500 !important;
+ font-size: 14px !important;
+ border: none;
+ margin-left: 10px;
+}
+
+.finishBtn:focus {
+ border: none;
+ outline: none;
+}
+
+.finishBtn:hover {
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+
+}
+
+.saveBtn {
+ padding: 3px 18px !important;
+}
+
+.disabledFinish {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 3px 30px;
+ color: white;
+ font-weight: 600;
+ font-size: 14px;
+ border: none;
+ margin-left: 10px;
+}
+
+.sendHover:hover {
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+ color: white;
+}
+
+.defaultSignBox {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ width: 90%;
+ height: 111px;
+ padding: 8px 20px;
+ color: white;
+ font-weight: 600;
+ font-size: 14px;
+ border: none;
+ border-radius: 2px;
+ margin-left: 10px;
+}
+
+.backBtn {
+ background-color: white;
+}
+
+.backBtn:hover {
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+}
+
+.defaultBtn {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 3px 26px;
+ color: black;
+ font-weight: 500;
+ font-size: 14px;
+ border: 1px solid gray;
+ border-radius: 2px;
+ margin-left: 10px;
+ border: "none";
+}
+
+.defaultBtn:focus {
+ border: none;
+ outline: none;
+}
+
+.downloadBtn {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 3px 15px !important;
+ background-color: rgb(241 79 79);
+ border: none !important;
+ color: white !important;
+}
+
+.downloadBtn:hover {
+ box-shadow: 0 2px 4px rgba(154, 36, 36, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+}
+
+.printBtn {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 3px 15px !important;
+ background: #188ae2;
+ border: none !important;
+ color: white !important;
+}
+
+.printBtn:hover {
+ box-shadow: 0 2px 4px rgba(23, 48, 137, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+}
+
+.certificateBtn {
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.18);
+ padding: 3px 15px !important;
+ background: #08bc66;
+ border: none !important;
+ color: white !important;
+ text-decoration: none !important;
+}
+
+.certificateBtn:hover {
+ box-shadow: 0 2px 4px rgba(15, 150, 87, 0.1), 0 2px 4px rgba(0, 0, 0, 0.18);
+}
+
+.signerList {
+ overflow-y: scroll;
+ max-height: 180px;
+}
+
+.signerList::-webkit-scrollbar {
+ display: none;
+}
+
+.showScroll {
+ height: 100%;
+ overflow: scroll;
+
+}
+
+.showScroll::-webkit-scrollbar {
+ display: none;
+}
+
+.hideScroll {
+ height: 100%;
+ overflow: scroll;
+}
+
+.signedStyle {
+ color: white;
+ padding: 5px;
+ font-family: sans-serif;
+ font-size: 15px !important;
+}
+
+.userName {
+ font-size: 12px !important;
+ font-weight: bold !important;
+ color: #424242 !important;
+ width: 100px;
+ white-space: nowrap;
+ overflow: hidden !important;
+ text-overflow: ellipsis;
+}
+
+.useEmail {
+ font-size: 10px;
+ color: #424242;
+ font-weight: 500;
+ width: 100px;
+ white-space: nowrap;
+ overflow: hidden !important;
+ text-overflow: ellipsis;
+}
+
+.spanTagHead {
+ color: white !important;
+ font-size: 17px;
+ font-weight: 500;
+}
+
+.pTagBody {
+
+ font-size: 15px !important;
+}
+
+.signTab {
+ cursor: pointer !important;
+ font-weight: 400 !important;
+ margin: 7px !important;
+ font-size: 15px !important;
+}
+
+.cancelBtn {
+ color: black;
+ border: 1px solid #ccc;
+}
+
+.draggable-button {
+ padding: 10px 20px;
+ background: #3498db;
+ color: #fff;
+ border: none;
+ cursor: grab;
+ transition: transform 0.2s;
+}
+
+.draggable-button.dragging {
+ opacity: 0.5;
+ /* Reduce opacity while dragging */
+ transform: scale(1.1);
+ /* Apply a scaling effect while dragging */
+}
+
+.signatureContainer {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ background-color: #ebebeb;
+ position: "relative"
+}
+
+.signatureHeader {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 5px;
+}
+
+.signerComponent {
+ /* box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px; */
+ width: 180px;
+ background-color: white;
+ height: 100%;
+
+}
+
+.modalBody {
+ padding: 1rem !important;
+ padding-top: 2rem !important;
+}
+
+.signLayoutContainer1 {
+ padding: 30px;
+ display: flex;
+ flex-direction: column;
+ align-items: center
+}
+
+.signLayoutContainer2 {
+ display: none;
+}
+
+.preBtn1 {
+ display: flex;
+ align-items: center;
+}
+
+.preBtn2 {
+ display: none;
+}
+
+.headerBtn2 {
+ display: none;
+}
+
+.uploadImgLogo {
+ font-size: 50px;
+}
+
+.DropdownMenuContent,
+.DropdownMenuSubContent {
+ min-width: 130px;
+ background-color: #fff;
+ border: 1px solid rgba(0, 0, 0, .15);
+ border-radius: 0.25rem;
+ padding: 5px;
+ animation-duration: 400ms;
+ animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
+ will-change: transform, opacity;
+ z-index: 30 !important;
+}
+
+.DropdownMenuContent[data-side='top'],
+.DropdownMenuSubContent[data-side='top'] {
+ animation-name: slideDownAndFade;
+}
+
+.DropdownMenuContent[data-side='right'],
+.DropdownMenuSubContent[data-side='right'] {
+ animation-name: slideLeftAndFade;
+}
+
+.DropdownMenuContent[data-side='bottom'],
+.DropdownMenuSubContent[data-side='bottom'] {
+ animation-name: slideUpAndFade;
+}
+
+.DropdownMenuContent[data-side='left'],
+.DropdownMenuSubContent[data-side='left'] {
+ animation-name: slideRightAndFade;
+}
+
+.DropdownMenuItem {
+ font-size: 13px;
+ line-height: 1;
+ color: black;
+ background-color: #fff;
+ display: flex;
+ align-items: center;
+ height: 25px;
+ padding: 0 5px;
+ position: relative;
+ padding-left: 20px;
+ user-select: none;
+ outline: none;
+ border: none;
+}
+
+.SelectTrigger {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 4px;
+ padding: 0 70px;
+ font-size: 13px;
+ line-height: 1;
+ height: 35px;
+ gap: 5px;
+ border: none;
+ background-color: #887abf;
+
+ width: 100px;
+ white-space: nowrap;
+ overflow: hidden !important;
+ text-overflow: ellipsis;
+}
+
+.selectEmail {
+
+ align-items: center;
+ justify-content: center;
+ border-radius: 4px;
+ padding: 0 15px;
+ font-size: 13px;
+ line-height: 1;
+ height: 35px;
+ gap: 5px;
+ border: none;
+ background-color: #887abf;
+ width: 200px;
+ white-space: nowrap;
+ overflow: hidden !important;
+ text-overflow: ellipsis;
+}
+
+option {
+ overflow-y: scroll;
+}
+
+
+.SelectTrigger:hover {
+ border: none;
+ outline: none;
+}
+
+.selectEmail:hover {
+ border: none;
+ outline: none;
+}
+
+
+.SelectTrigger:focus {
+ /* box-shadow: 0 0 0 2px black; */
+ border: none;
+ outline: none;
+}
+
+.selectEmail:focus {
+ /* box-shadow: 0 0 0 2px black; */
+ border: none;
+ outline: none;
+}
+
+.SelectTrigger[data-placeholder] {
+ color: black;
+}
+
+.SelectIcon {
+ color: Var(--violet-11);
+}
+
+.SelectContent {
+ overflow: hidden;
+ background-color: white;
+ border-radius: 6px;
+ box-shadow: 0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2);
+}
+
+.SelectViewport {
+ padding: 5px;
+}
+
+.SelectItem {
+ font-size: 13px;
+ line-height: 1;
+ color: var(--violet-11);
+ border-radius: 3px;
+ display: flex;
+ align-items: center;
+ height: 25px;
+ padding: 0 35px 0 25px;
+ position: relative;
+ user-select: none;
+ z-index: 10 !important;
+}
+
+.SelectItem[data-disabled] {
+ color: var(--mauve-8);
+ pointer-events: none;
+}
+
+.SelectItem[data-highlighted] {
+ outline: none;
+ background-color: var(--violet-9);
+ color: var(--violet-1);
+}
+
+.SelectLabel {
+ padding: 0 25px;
+ font-size: 12px;
+ line-height: 25px;
+ color: var(--mauve-11);
+}
+
+.SelectSeparator {
+ height: 1px;
+ background-color: var(--violet-6);
+ margin: 5px;
+}
+
+.SelectItemIndicator {
+ position: absolute;
+ left: 0;
+ width: 25px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.SelectScrollButton {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 25px;
+ background-color: white;
+ color: var(--violet-11);
+ cursor: default;
+}
+
+.fontOptionContainer {
+ border: 1px solid #d6d3d3;
+ margin: 10px 0px 5px 0px;
+
+}
+
+.dropDownStyle {
+ width: auto;
+}
+
+.autoSignScroll {
+ overflow-y: auto;
+}
+
+.autoSignScroll::-webkit-scrollbar {
+ display: none;
+}
+
+.validateInputText {
+ width: 76%;
+}
+
+.regxSelect {
+ border: 1px solid #8ad5ce;
+ width: 80%;
+}
+
+.regxSelect:focus {
+ outline: none;
+ border: 1px solid #8ad5ce;
+}
+
+.radioGroupInput {
+ width: 100%;
+}
+
+.radioGroup {
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-start;
+}
+
+
+
+.labelTextArea {
+
+ font-size: 12px;
+ min-width: 100%;
+ min-height: 100%;
+ border: 1px solid #007bff;
+ outline: none;
+ z-index: 999;
+ border-radius: 2px;
+ resize: none;
+
+}
+
+.labelTextArea:focus {
+ outline: none;
+ border: 1px solid #188ae2;
+}
+
+@media screen and (max-width:766px) {
+
+ .validateInputText {
+ width: 93%;
+ }
+
+ .regxSelect {
+ width: 100%;
+ }
+
+ .validateText {
+ display: flex;
+ flex-direction: column;
+ justify-content: flex-start;
+ }
+
+ .showPages {
+ display: none;
+ }
+
+ .dropdown-menu {
+ min-width: 0rem !important;
+ }
+
+ .signatureContainer {
+ display: flex;
+ flex-direction: column;
+
+ }
+
+
+ .signerComponent {
+ display: none;
+
+ }
+
+ .preBtn1 {
+ display: none;
+ }
+
+ .preBtn2 {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ background-color: #ebebeb;
+ padding: 5px 10px;
+ }
+
+ #navbar {
+ overflow: hidden;
+ z-index: 49;
+ }
+
+ /* Navbar links */
+ #navbar a {
+ float: left;
+ display: block;
+ color: #f2f2f2;
+ text-align: center;
+ padding: 14px;
+ text-decoration: none;
+ }
+
+ #navbar a.active {
+ background-color: #4caf50;
+ color: white;
+ }
+
+ /* Page content */
+ .content {
+ padding: 16px;
+ }
+
+ /* The sticky class is added to the navbar
+ with JS when it reaches its scroll position */
+ .stickyHead {
+ top: 50px;
+ left: 0.9rem;
+ }
+
+ .stickySignerHead {
+ position: fixed;
+ }
+
+ .stickyfooter {
+ position: fixed;
+ z-index: 99 !important;
+ bottom: 0px;
+ right: 0rem;
+ }
+
+ /* Add some top padding to the page content
+ to prevent sudden quick movement (as the
+ navigation bar gets a new position at the top of the
+ page (position:fixed and top:0) */
+ .stickyHead+.content {
+ padding-top: 60px;
+ }
+
+
+ .signLayoutContainer2 {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-around;
+ margin-top: 5px;
+ padding: 2px 5px 10px 5px;
+ position: sticky;
+ align-items: center;
+
+ }
+
+ .headerBtn {
+ display: none;
+ }
+
+ .headerBtn2 {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+
+ margin-top: 5px;
+ }
+
+ .mobileHead {
+ display: flex;
+ }
+
+ .signatureText {
+ margin-right: 5px;
+ font-size: 12px;
+ }
+}
+
+@media screen and (max-width:487px) and (min-width:351px) {
+ .signatureCanvas {
+
+ width: 300px;
+ height: 120px;
+ }
+
+ .penContainerDefault {
+ width: 300px;
+ }
+
+ .uploadImgLogo {
+ font-size: 30px;
+ }
+
+ .hidePdf {
+ display: none;
+ }
+
+ .mobileHead {
+ display: flex;
+ }
+
+ .signTab {
+
+ font-weight: 500 !important;
+
+ font-size: 12px !important;
+ }
+
+}
+
+@media screen and (max-width:350px) and (min-width:311px) {
+ .signatureCanvas {
+
+ width: 280px;
+ height: 112px;
+ }
+
+ .penContainerDefault {
+ width: 280px;
+ }
+
+ .hidePdf {
+ display: none;
+ }
+
+ .signTab {
+
+ font-weight: 500 !important;
+
+ font-size: 10px !important;
+ }
+
+ .uploadImgLogo {
+ font-size: 25px;
+ }
+
+ .uploadImg {
+
+ font-size: 10px !important;
+ }
+
+ .mobileHead {
+ display: flex;
+ }
+}
+
+@media screen and (max-width:310px) {
+ .signatureCanvas {
+
+ width: 230px;
+ height: 92px;
+ }
+
+ .penContainerDefault {
+ width: 230px;
+ }
+
+ .hidePdf {
+ display: none;
+ }
+
+ .signTab {
+
+ font-weight: 500 !important;
+
+ font-size: 8px !important;
+ }
+
+ .uploadImgLogo {
+ font-size: 20px;
+ }
+
+ .uploadImg {
+
+ font-size: 10px !important;
+ }
+
+ .mobileHead {
+ display: flex;
+ }
+}
+
+.signature-backdrop {
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ background-color: #000;
+}
+
+.signature-backdrop.fade.in {
+ opacity: 0.5;
+}
+
+.modaloverlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba(0, 0, 0, 0.75);
+ justify-content: center;
+ align-items: center;
+ z-index: 900;
+}
+
+.modalcontainer {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ background-color: #fff;
+ border-radius: 5px;
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
+ z-index: 901;
+ max-height: 80%;
+ min-width: 500px;
+ overflow-y: auto;
+ scrollbar-width: none;
+ /* Firefox */
+ -ms-overflow-style: none;
+ /* Internet Explorer and Edge */
+}
+
+.dropdownModal {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ background-color: #fff;
+ border-radius: 5px;
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
+ z-index: 901;
+ max-height: 80%;
+ min-width: 40%;
+ overflow-y: auto;
+ scrollbar-width: none;
+ /* Firefox */
+ -ms-overflow-style: none;
+ /* Internet Explorer and Edge */
+}
+
+/* Hide scrollbar for Webkit browsers */
+.modalcontainer::-webkit-scrollbar {
+ display: none;
+}
+
+/* Hide scrollbar for Webkit browsers */
+.dropdownModal::-webkit-scrollbar {
+ display: none;
+}
+
+.modalheader {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 10px 20px;
+ border-bottom: 1px solid #ccc;
+ color: #ffffff;
+}
+
+/* Styling for the modal title */
+.modaltitle {
+ font-size: 1.2rem;
+ font-weight: normal;
+}
+
+/* Styling for the close button */
+.closebtn {
+ background: none;
+ border: none;
+ font-size: 1.5rem;
+ cursor: pointer;
+}
+
+.defaultOptions {
+ font-size: 12px;
+ margin-left: 5px;
+
+}
+.defaultOptions:focus{
+ outline: none;
+}
+
+@media (max-width:767px) {
+
+ .modalcontainer {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ background-color: #fff;
+ border-radius: 8px;
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
+ z-index: 1000;
+ max-height: 80%;
+ min-width: 90%;
+ overflow-y: auto;
+ }
+
+ .dropdownModal {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ background-color: #fff;
+ border-radius: 8px;
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
+ z-index: 1000;
+ max-height: 80%;
+ min-width: 60%;
+ overflow-y: auto;
+ }
+}
+
+@media (max-width:464px) {
+ .dropdownModal {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ background-color: #fff;
+ border-radius: 8px;
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
+ z-index: 1000;
+ max-height: 80%;
+ min-width: 78%;
+ overflow-y: auto;
+ }
+
+}
\ No newline at end of file
diff --git a/apps/OpenSign/src/styles/signerListPlace.css b/apps/OpenSign/src/styles/signerListPlace.css
new file mode 100644
index 000000000..1df701b70
--- /dev/null
+++ b/apps/OpenSign/src/styles/signerListPlace.css
@@ -0,0 +1,16 @@
+.addSignerBtn{
+ padding: 10px;
+ margin-top: 2px;
+ display: flex;
+ flex-direction: row;
+ justify-content: center;
+ align-items: center;
+ border: 1px solid #47a3ad;
+ margin: 1px;
+ color: #47a3ad;
+ cursor: pointer
+}
+.addSignerBtn:hover{
+ background: #47a3ad;
+ color: #ffffff;
+}
diff --git a/apps/OpenSignServer/cloud/customRoute/v1/routes/CreateDocumentWithTemplate.js b/apps/OpenSignServer/cloud/customRoute/v1/routes/CreateDocumentWithTemplate.js
index 6ef70f07a..970c95b5f 100644
--- a/apps/OpenSignServer/cloud/customRoute/v1/routes/CreateDocumentWithTemplate.js
+++ b/apps/OpenSignServer/cloud/customRoute/v1/routes/CreateDocumentWithTemplate.js
@@ -218,7 +218,7 @@ export default async function createDocumentWithTemplate(request, response) {
const objectId = contactMail[i].contactPtr.objectId;
- const hostUrl = baseUrl.origin + '/loadmf/signmicroapp';
+ const hostUrl = baseUrl.origin;
let signPdf = `${hostUrl}/login/${res.id}/${contactMail[i].email}/${objectId}/${serverParams}`;
const openSignUrl = 'https://www.opensignlabs.com/contact-us';
const orgName = template.ExtUserPtr.Company ? template.ExtUserPtr.Company : '';
@@ -319,7 +319,7 @@ export default async function createDocumentWithTemplate(request, response) {
objectId: res.id,
signurl: contact.map(x => ({
email: x.email,
- url: `${baseUrl.origin}/loadmf/signmicroapp/login/${res.id}/${x.email}/${x.contactPtr.objectId}/${serverParams}`,
+ url: `${baseUrl.origin}/login/${res.id}/${x.email}/${x.contactPtr.objectId}/${serverParams}`,
})),
message: 'Document sent successfully!',
});
diff --git a/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js b/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js
index 0ca92d067..33b276be0 100644
--- a/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js
+++ b/apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js
@@ -268,8 +268,7 @@ export default async function createDocumentwithCoordinate(request, response) {
};
const objectId = contactMail[i].contactPtr.objectId;
-
- const hostUrl = baseUrl.origin + '/loadmf/signmicroapp';
+ const hostUrl = baseUrl.origin;
let signPdf = `${hostUrl}/login/${res.id}/${contactMail[i].email}/${objectId}/${serverParams}`;
const openSignUrl = 'https://www.opensignlabs.com/contact-us';
const orgName = parseExtUser.Company ? parseExtUser.Company : '';
@@ -354,7 +353,7 @@ export default async function createDocumentwithCoordinate(request, response) {
objectId: res.id,
signurl: contact.map(x => ({
email: x.email,
- url: `${baseUrl.origin}/loadmf/signmicroapp/login/${res.id}/${x.email}/${x.contactPtr.objectId}/${serverParams}`,
+ url: `${baseUrl.origin}/login/${res.id}/${x.email}/${x.contactPtr.objectId}/${serverParams}`,
})),
message: 'Document sent successfully!',
});
diff --git a/apps/OpenSignServer/databases/migrations/20240304153308-update_menu_routes.cjs b/apps/OpenSignServer/databases/migrations/20240304153308-update_menu_routes.cjs
new file mode 100644
index 000000000..c19feaba1
--- /dev/null
+++ b/apps/OpenSignServer/databases/migrations/20240304153308-update_menu_routes.cjs
@@ -0,0 +1,696 @@
+/**
+ *
+ * @param {Parse} Parse
+ */
+exports.up = async Parse => {
+ const className = 'w_menu';
+ const userMenu = new Parse.Query(className);
+ const updateUserMenu = await userMenu.get('H9vRfEYKhT');
+ updateUserMenu.set('menuItems', [
+ {
+ icon: 'fas fa-tachometer-alt',
+ title: 'Dashboard',
+ target: '',
+ pageType: 'dashboard',
+ description: '',
+ objectId: '35KBoSgoAK',
+ },
+ {
+ icon: 'far fa-newspaper',
+ title: 'New Document',
+ target: '_self',
+ pageType: null,
+ description: null,
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-nib',
+ title: 'Sign yourself',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'sHAnZphf69',
+ },
+ {
+ icon: 'fa-solid fa-paper-plane',
+ title: 'Request signatures',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: '8mZzFxbG1z',
+ },
+ {
+ icon: 'fas fa-file-signature',
+ title: 'New template',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'template',
+ },
+ ],
+ },
+ {
+ icon: 'fa-solid fa-file-contract',
+ title: 'Templates',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '6TeaPr321t',
+ },
+ {
+ icon: 'fas fa-folder',
+ title: 'OpenSignâ„¢ Drive',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'opensigndrive',
+ },
+ {
+ icon: 'fas fa-address-card',
+ title: 'Reports',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-signature',
+ title: 'Need your sign',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '4Hhwbp482K',
+ },
+ {
+ icon: 'fas fa-tasks',
+ title: 'In Progress',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '1MwEuxLEkF',
+ },
+ {
+ icon: 'fas fa-check-circle',
+ title: 'Completed',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'kQUoW4hUXz',
+ },
+ {
+ icon: 'fas fa-edit',
+ title: 'Drafts',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'ByHuevtCFY',
+ },
+ {
+ icon: 'fas fa-times-circle',
+ title: 'Declined',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'UPr2Fm5WY3',
+ },
+ {
+ icon: 'fas fa-hourglass-end',
+ title: 'Expired',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'zNqBHXHsYH',
+ },
+ {
+ icon: 'fa-solid fa-address-book',
+ title: 'Contactbook',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '5KhaPr482K',
+ },
+ ],
+ },
+ {
+ icon: 'fas fa-cog',
+ title: 'Settings',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-fancy',
+ title: 'My Signature',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'managesign',
+ },
+ {
+ icon: 'fa-solid fa-key',
+ title: 'API Token',
+ target: '_self',
+ pageType: 'generatetoken',
+ description: '',
+ objectId: '',
+ },
+ {
+ icon: 'fa-solid fa-globe',
+ title: 'Webhook',
+ target: '_self',
+ pageType: 'webhook',
+ description: '',
+ objectId: '',
+ },
+ ],
+ },
+ ]);
+
+ const AdminMenu = new Parse.Query(className);
+ const updateAdminMenu = await AdminMenu.get('VPh91h0ZHk');
+ updateAdminMenu.set('menuItems', [
+ {
+ icon: 'fas fa-tachometer-alt',
+ title: 'Dashboard',
+ target: '',
+ pageType: 'dashboard',
+ description: '',
+ objectId: '35KBoSgoAK',
+ },
+ {
+ icon: 'far fa-newspaper',
+ title: 'New Document',
+ target: '_self',
+ pageType: null,
+ description: null,
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-nib',
+ title: 'Sign yourself',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'sHAnZphf69',
+ },
+ {
+ icon: 'fa-solid fa-paper-plane',
+ title: 'Request signatures',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: '8mZzFxbG1z',
+ },
+ {
+ icon: 'fas fa-file-signature',
+ title: 'New template',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'template',
+ },
+ ],
+ },
+ {
+ icon: 'fa-solid fa-file-contract',
+ title: 'Templates',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '6TeaPr321t',
+ },
+ {
+ icon: 'fas fa-folder',
+ title: 'OpenSignâ„¢ Drive',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'opensigndrive',
+ },
+ {
+ icon: 'fas fa-address-card',
+ title: 'Reports',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-signature',
+ title: 'Need your sign',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '4Hhwbp482K',
+ },
+ {
+ icon: 'fas fa-tasks',
+ title: 'In Progress',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '1MwEuxLEkF',
+ },
+ {
+ icon: 'fas fa-check-circle',
+ title: 'Completed',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'kQUoW4hUXz',
+ },
+ {
+ icon: 'fas fa-edit',
+ title: 'Drafts',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'ByHuevtCFY',
+ },
+ {
+ icon: 'fas fa-times-circle',
+ title: 'Declined',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'UPr2Fm5WY3',
+ },
+ {
+ icon: 'fas fa-hourglass-end',
+ title: 'Expired',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'zNqBHXHsYH',
+ },
+ {
+ icon: 'fa-solid fa-address-book',
+ title: 'Contactbook',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '5KhaPr482K',
+ },
+ ],
+ },
+ {
+ icon: 'fas fa-cog',
+ title: 'Settings',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-fancy',
+ title: 'My Signature',
+ target: '_self',
+ pageType: '',
+ description: '',
+ objectId: 'managesign',
+ },
+ {
+ icon: 'far fa-user',
+ title: 'Add User',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'lM0xRnM3iE',
+ },
+ {
+ icon: 'fa-solid fa-key',
+ title: 'API Token',
+ target: '_self',
+ pageType: 'generatetoken',
+ description: '',
+ objectId: '',
+ },
+ {
+ icon: 'fa-solid fa-globe',
+ title: 'Webhook',
+ target: '_self',
+ pageType: 'webhook',
+ description: '',
+ objectId: '',
+ },
+ ],
+ },
+ ]);
+ // TODO: Set the schema here
+ // Example:
+ // schema.addString('name').addNumber('cash');
+ const batch = [updateUserMenu, updateAdminMenu];
+ return Parse.Object.saveAll(batch, { useMasterKey: true });
+};
+
+/**
+ *
+ * @param {Parse} Parse
+ */
+exports.down = async Parse => {
+ // TODO: set className here
+ const className = 'w_menu';
+ const userMenu = new Parse.Query(className);
+ const revertUserMenu = await userMenu.get('H9vRfEYKhT');
+ revertUserMenu.set('menuItems', [
+ {
+ icon: 'fas fa-tachometer-alt',
+ title: 'Dashboard',
+ target: '',
+ pageType: 'dashboard',
+ description: '',
+ objectId: '35KBoSgoAK',
+ },
+ {
+ icon: 'far fa-newspaper',
+ title: 'New Document',
+ target: '_self',
+ pageType: null,
+ description: null,
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-nib',
+ title: 'Sign yourself',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'sHAnZphf69',
+ },
+ {
+ icon: 'fa-solid fa-paper-plane',
+ title: 'Request signatures',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: '8mZzFxbG1z',
+ },
+ {
+ icon: 'fas fa-file-signature',
+ title: 'New template',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'template',
+ },
+ ],
+ },
+ {
+ icon: 'fa-solid fa-file-contract',
+ title: 'Templates',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '6TeaPr321t',
+ },
+ {
+ icon: 'fas fa-folder',
+ title: 'OpenSignâ„¢ Drive',
+ target: '_self',
+ pageType: 'mf',
+ description: '',
+ objectId:
+ 'remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/legadrive',
+ },
+ {
+ icon: 'fas fa-address-card',
+ title: 'Reports',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-signature',
+ title: 'Need your sign',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '4Hhwbp482K',
+ },
+ {
+ icon: 'fas fa-tasks',
+ title: 'In Progress',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '1MwEuxLEkF',
+ },
+ {
+ icon: 'fas fa-check-circle',
+ title: 'Completed',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'kQUoW4hUXz',
+ },
+ {
+ icon: 'fas fa-edit',
+ title: 'Drafts',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'ByHuevtCFY',
+ },
+ {
+ icon: 'fas fa-times-circle',
+ title: 'Declined',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'UPr2Fm5WY3',
+ },
+ {
+ icon: 'fas fa-hourglass-end',
+ title: 'Expired',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'zNqBHXHsYH',
+ },
+ {
+ icon: 'fa-solid fa-address-book',
+ title: 'Contactbook',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '5KhaPr482K',
+ },
+ ],
+ },
+ {
+ icon: 'fas fa-cog',
+ title: 'Settings',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-fancy',
+ title: 'My Signature',
+ target: '_self',
+ pageType: 'mf',
+ description: '',
+ objectId:
+ 'remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/managesign',
+ },
+ {
+ icon: 'fa-solid fa-key',
+ title: 'API Token',
+ target: '_self',
+ pageType: 'generatetoken',
+ description: '',
+ objectId: '',
+ },
+ {
+ icon: 'fa-solid fa-globe',
+ title: 'Webhook',
+ target: '_self',
+ pageType: 'webhook',
+ description: '',
+ objectId: '',
+ },
+ ],
+ },
+ ]);
+
+ const adminMenu = new Parse.Query(className);
+ const revertAdminMenu = await adminMenu.get('VPh91h0ZHk');
+ revertAdminMenu.set('menuItems', [
+ {
+ icon: 'fas fa-tachometer-alt',
+ title: 'Dashboard',
+ target: '',
+ pageType: 'dashboard',
+ description: '',
+ objectId: '35KBoSgoAK',
+ },
+ {
+ icon: 'far fa-newspaper',
+ title: 'New Document',
+ target: '_self',
+ pageType: null,
+ description: null,
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-nib',
+ title: 'Sign yourself',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'sHAnZphf69',
+ },
+ {
+ icon: 'fa-solid fa-paper-plane',
+ title: 'Request signatures',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: '8mZzFxbG1z',
+ },
+ {
+ icon: 'fas fa-file-signature',
+ title: 'New template',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'template',
+ },
+ ],
+ },
+ {
+ icon: 'fa-solid fa-file-contract',
+ title: 'Templates',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '6TeaPr321t',
+ },
+ {
+ icon: 'fas fa-folder',
+ title: 'OpenSignâ„¢ Drive',
+ target: '_self',
+ pageType: 'mf',
+ description: '',
+ objectId:
+ 'remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/legadrive',
+ },
+ {
+ icon: 'fas fa-address-card',
+ title: 'Reports',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-signature',
+ title: 'Need your sign',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '4Hhwbp482K',
+ },
+ {
+ icon: 'fas fa-tasks',
+ title: 'In Progress',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '1MwEuxLEkF',
+ },
+ {
+ icon: 'fas fa-check-circle',
+ title: 'Completed',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'kQUoW4hUXz',
+ },
+ {
+ icon: 'fas fa-edit',
+ title: 'Drafts',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'ByHuevtCFY',
+ },
+ {
+ icon: 'fas fa-times-circle',
+ title: 'Declined',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'UPr2Fm5WY3',
+ },
+ {
+ icon: 'fas fa-hourglass-end',
+ title: 'Expired',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: 'zNqBHXHsYH',
+ },
+ {
+ icon: 'fa-solid fa-address-book',
+ title: 'Contactbook',
+ target: '_self',
+ pageType: 'report',
+ description: '',
+ objectId: '5KhaPr482K',
+ },
+ ],
+ },
+ {
+ icon: 'fas fa-cog',
+ title: 'Settings',
+ target: '_self',
+ pageType: null,
+ description: '',
+ objectId: null,
+ children: [
+ {
+ icon: 'fas fa-pen-fancy',
+ title: 'My Signature',
+ target: '_self',
+ pageType: 'mf',
+ description: '',
+ objectId:
+ 'remoteUrl=aHR0cHM6Ly9xaWstYWktb3JnLmdpdGh1Yi5pby9TaWduLU1pY3JvYXBwVjIvcmVtb3RlRW50cnkuanM=&moduleToLoad=AppRoutes&remoteName=signmicroapp/managesign',
+ },
+ {
+ icon: 'far fa-user',
+ title: 'Add User',
+ target: '_self',
+ pageType: 'form',
+ description: '',
+ objectId: 'lM0xRnM3iE',
+ },
+ {
+ icon: 'fa-solid fa-key',
+ title: 'API Token',
+ target: '_self',
+ pageType: 'generatetoken',
+ description: '',
+ objectId: '',
+ },
+ {
+ icon: 'fa-solid fa-globe',
+ title: 'Webhook',
+ target: '_self',
+ pageType: 'webhook',
+ description: '',
+ objectId: '',
+ },
+ ],
+ },
+ ]);
+ // TODO: Set the schema here
+ // Example:
+ // schema.addString('name').addNumber('cash');
+ const batch = [revertUserMenu, revertAdminMenu];
+ return Parse.Object.saveAll(batch, { useMasterKey: true });
+};
diff --git a/apps/OpenSignServer/test.pdf b/apps/OpenSignServer/test.pdf
index 002851067..7a2d63ada 100644
Binary files a/apps/OpenSignServer/test.pdf and b/apps/OpenSignServer/test.pdf differ
diff --git a/microfrontends/SignDocuments/src/Component/component/RenderDebugPdf.js b/microfrontends/SignDocuments/src/Component/component/RenderDebugPdf.js
index 89ddd03f5..8a2e1e403 100644
--- a/microfrontends/SignDocuments/src/Component/component/RenderDebugPdf.js
+++ b/microfrontends/SignDocuments/src/Component/component/RenderDebugPdf.js
@@ -2,8 +2,6 @@ import React from "react";
import { Document, Page, pdfjs } from "react-pdf";
import { Stage, Layer, Rect } from "react-konva";
const RenderDebugPdf = (props) => {
- pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
-
return (
<div>
<div
diff --git a/microfrontends/SignDocuments/src/Component/placeHolderSign.js b/microfrontends/SignDocuments/src/Component/placeHolderSign.js
index 036517be1..5d3fb7828 100644
--- a/microfrontends/SignDocuments/src/Component/placeHolderSign.js
+++ b/microfrontends/SignDocuments/src/Component/placeHolderSign.js
@@ -488,7 +488,7 @@ function PlaceHolderSign() {
setIsCheckbox(true);
} else if (dragTypeValue === "radio") {
setIsRadio(true);
- } else if(dragTypeValue !== 'label' && dragTypeValue !== 'signature') {
+ } else if (dragTypeValue !== "label" && dragTypeValue !== "signature") {
setIsNameModal(true);
}
setWidgetType(dragTypeValue);
@@ -704,10 +704,9 @@ function PlaceHolderSign() {
flag,
containerWH
);
-
+
const parseBaseUrl = localStorage.getItem("baseUrl");
const parseAppId = localStorage.getItem("parseAppId");
- Parse.initialize(parseAppId);
Parse.serverURL = parseBaseUrl;
Parse.initialize(parseAppId);
const fileName = sanitizeFileName(pdfDetails[0].Name) + ".pdf";
@@ -746,7 +745,7 @@ function PlaceHolderSign() {
setIsSendAlert(alert);
}
};
-
+
const sendEmailToSigners = async () => {
setIsUiLoading(true);
const pdfUrl = await embedPrefilllData();
@@ -842,7 +841,6 @@ function PlaceHolderSign() {
//filter label widgets after add label widgets data on pdf
const filterPrefill = signerPos.filter((data) => data.Role !== "prefill");
-
try {
if (updateExpiryDate) {
data = {
@@ -1212,7 +1210,7 @@ function PlaceHolderSign() {
const handleNameModal = () => {
setIsNameModal(!isNameModal);
- setCurrWidgetsDetails({})
+ setCurrWidgetsDetails({});
};
//function for update TourStatus
const closeTour = async () => {