onairos 1.0.10 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onairos.esm.js","mappings":"wBACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,8BCElF,MAAM,EAFEI,KAAO,IAAIC,EAAI,CAAC,EAAgC,OAA7Bf,EAAoBgB,EAAED,EAAGD,GAAWC,CAAC,EAE3BA,CAAE,CAAE,cAAmB,IAAME,EAAkCC,cAAe,QAAa,IAAMD,EAA2C,QAAG,WAAgB,IAAMA,EAAkCE,WAAY,UAAe,IAAMF,EAAkCG,UAAW,SAAc,IAAMH,EAAkCI,WCU1WC,EAAgBC,IACpB,MAAMC,EALY,CAACD,GAAWA,EAAOE,QACrC,yBACA,CAACC,EAAOC,EAAIC,IAAOA,EAAKA,EAAGC,cAAgBF,EAAGG,gBAG5BC,CAAYR,GAC9B,OAAOC,EAAUQ,OAAO,GAAGH,cAAgBL,EAAUS,MAAM,EAAE,EAEzDC,EAAe,IAAIC,IAAYA,EAAQC,QAAO,CAACC,EAAWC,EAAOC,IAC9DC,QAAQH,IAAmC,KAArBA,EAAUI,QAAiBF,EAAMG,QAAQL,KAAeC,IACpFK,KAAK,KAAKF,OACPG,EAAeC,IACnB,IAAK,MAAMnC,KAAQmC,EACjB,GAAInC,EAAKoC,WAAW,UAAqB,SAATpC,GAA4B,UAATA,EACjD,OAAO,CAEX,ECjBF,IAAIqC,EAAoB,CACtBC,MAAO,6BACPC,MAAO,GACPC,OAAQ,GACRC,QA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QACE,OACEtG,EAAAA,QAAAA,cAAA,OAAK9E,UAAU,4CACb8E,EAAAA,QAAAA,cAAA,OAAK9E,UAAU,oFACf8E,EAAAA,QAAAA,cAAA,KAAG9E,UAAU,iBAAgB,eAGrC,EAiFWkP,MAOf,CC3PO,SAASC,EAAQ3O,GACtB,OACEsE,EAAAA,QAAAA,cAAAA,EAAAA,QAAAA,SAAA,KAEEA,EAAAA,QAAAA,cAACuH,EAAkB7L,GAGzB,CAEA,U","sources":["webpack://onairos/webpack/bootstrap","webpack://onairos/webpack/runtime/define property getters","webpack://onairos/webpack/runtime/hasOwnProperty shorthand","webpack://onairos/external module \"react\"","webpack://onairos/./node_modules/lucide-react/dist/esm/shared/src/utils.js","webpack://onairos/./node_modules/lucide-react/dist/esm/defaultAttributes.js","webpack://onairos/./node_modules/lucide-react/dist/esm/Icon.js","webpack://onairos/./node_modules/lucide-react/dist/esm/createLucideIcon.js","webpack://onairos/./node_modules/lucide-react/dist/esm/icons/mail.js","webpack://onairos/./node_modules/lucide-react/dist/esm/icons/arrow-right.js","webpack://onairos/./node_modules/lucide-react/dist/esm/icons/check.js","webpack://onairos/./src/components/EmailAuth.js","webpack://onairos/./node_modules/lucide-react/dist/esm/icons/shield.js","webpack://onairos/./node_modules/lucide-react/dist/esm/icons/lock.js","webpack://onairos/./node_modules/lucide-react/dist/esm/icons/circle-alert.js","webpack://onairos/./node_modules/lucide-react/dist/esm/icons/send.js","webpack://onairos/./node_modules/lucide-react/dist/esm/icons/external-link.js","webpack://onairos/./src/components/UniversalOnboarding.js","webpack://onairos/./src/components/PinSetup.js","webpack://onairos/./node_modules/lucide-react/dist/esm/icons/database.js","webpack://onairos/./node_modules/lucide-react/dist/esm/icons/x.js","webpack://onairos/./src/components/DataRequest.js","webpack://onairos/./src/onairosButton.jsx","webpack://onairos/./src/onairos.jsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }\nvar y = x => () => x\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"createElement\"]: () => __WEBPACK_EXTERNAL_MODULE_react__.createElement, [\"default\"]: () => __WEBPACK_EXTERNAL_MODULE_react__[\"default\"], [\"forwardRef\"]: () => __WEBPACK_EXTERNAL_MODULE_react__.forwardRef, [\"useEffect\"]: () => __WEBPACK_EXTERNAL_MODULE_react__.useEffect, [\"useState\"]: () => __WEBPACK_EXTERNAL_MODULE_react__.useState });","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nconst toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\nconst toCamelCase = (string) => string.replace(\n /^([A-Z])|[\\s-_]+(\\w)/g,\n (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()\n);\nconst toPascalCase = (string) => {\n const camelCase = toCamelCase(string);\n return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);\n};\nconst mergeClasses = (...classes) => classes.filter((className, index, array) => {\n return Boolean(className) && className.trim() !== \"\" && array.indexOf(className) === index;\n}).join(\" \").trim();\nconst hasA11yProp = (props) => {\n for (const prop in props) {\n if (prop.startsWith(\"aria-\") || prop === \"role\" || prop === \"title\") {\n return true;\n }\n }\n};\n\nexport { hasA11yProp, mergeClasses, toCamelCase, toKebabCase, toPascalCase };\n//# sourceMappingURL=utils.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nvar defaultAttributes = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: 24,\n height: 24,\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: 2,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n};\n\nexport { defaultAttributes as default };\n//# sourceMappingURL=defaultAttributes.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { mergeClasses, hasA11yProp } from './shared/src/utils.js';\n\nconst Icon = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n iconNode,\n ...rest\n }, ref) => {\n return createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: mergeClasses(\"lucide\", className),\n ...!children && !hasA11yProp(rest) && { \"aria-hidden\": \"true\" },\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n );\n }\n);\n\nexport { Icon as default };\n//# sourceMappingURL=Icon.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport { mergeClasses, toKebabCase, toPascalCase } from './shared/src/utils.js';\nimport Icon from './Icon.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({ className, ...props }, ref) => createElement(Icon, {\n ref,\n iconNode,\n className: mergeClasses(\n `lucide-${toKebabCase(toPascalCase(iconName))}`,\n `lucide-${iconName}`,\n className\n ),\n ...props\n })\n );\n Component.displayName = toPascalCase(iconName);\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"20\", height: \"16\", x: \"2\", y: \"4\", rx: \"2\", key: \"18n3k1\" }],\n [\"path\", { d: \"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7\", key: \"1ocrg3\" }]\n];\nconst Mail = createLucideIcon(\"mail\", __iconNode);\n\nexport { __iconNode, Mail as default };\n//# sourceMappingURL=mail.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }],\n [\"path\", { d: \"m12 5 7 7-7 7\", key: \"xquz4c\" }]\n];\nconst ArrowRight = createLucideIcon(\"arrow-right\", __iconNode);\n\nexport { __iconNode, ArrowRight as default };\n//# sourceMappingURL=arrow-right.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]];\nconst Check = createLucideIcon(\"check\", __iconNode);\n\nexport { __iconNode, Check as default };\n//# sourceMappingURL=check.js.map\n","import React, { useState } from 'react';\r\nimport { Mail, ArrowRight, Check } from 'lucide-react';\r\n\r\nexport default function EmailAuth({ onSuccess, testMode = true }) {\r\n const [email, setEmail] = useState('');\r\n const [code, setCode] = useState('');\r\n const [step, setStep] = useState('email'); // 'email' | 'code' | 'success'\r\n const [isLoading, setIsLoading] = useState(false);\r\n const [error, setError] = useState('');\r\n\r\n const validateEmail = (email) => {\r\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\r\n return emailRegex.test(email);\r\n };\r\n\r\n const handleEmailSubmit = async (e) => {\r\n e.preventDefault();\r\n setError('');\r\n\r\n if (!validateEmail(email)) {\r\n setError('Please enter a valid email address');\r\n return;\r\n }\r\n\r\n setIsLoading(true);\r\n\r\n try {\r\n if (testMode) {\r\n // In test mode, skip email sending and go directly to code step\r\n setTimeout(() => {\r\n setStep('code');\r\n setIsLoading(false);\r\n }, 1000);\r\n } else {\r\n // In production, send actual email\r\n const response = await fetch('https://api2.onairos.uk/auth/send-code', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n },\r\n body: JSON.stringify({ email }),\r\n });\r\n\r\n if (!response.ok) {\r\n throw new Error('Failed to send verification code');\r\n }\r\n\r\n setStep('code');\r\n setIsLoading(false);\r\n }\r\n } catch (error) {\r\n setError(error.message);\r\n setIsLoading(false);\r\n }\r\n };\r\n\r\n const handleCodeSubmit = async (e) => {\r\n e.preventDefault();\r\n setError('');\r\n\r\n if (testMode && code === '123456') {\r\n // Test mode - accept 123456 as valid code\r\n setStep('success');\r\n setTimeout(() => {\r\n onSuccess({ email, verified: true });\r\n }, 1000);\r\n return;\r\n }\r\n\r\n if (!testMode) {\r\n setIsLoading(true);\r\n\r\n try {\r\n const response = await fetch('https://api2.onairos.uk/auth/verify-code', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n },\r\n body: JSON.stringify({ email, code }),\r\n });\r\n\r\n if (!response.ok) {\r\n throw new Error('Invalid verification code');\r\n }\r\n\r\n const data = await response.json();\r\n setStep('success');\r\n setTimeout(() => {\r\n onSuccess({ email, verified: true, token: data.token });\r\n }, 1000);\r\n } catch (error) {\r\n setError(error.message);\r\n setIsLoading(false);\r\n }\r\n } else {\r\n setError('Invalid code. Use 123456 for testing.');\r\n }\r\n };\r\n\r\n const renderEmailStep = () => (\r\n <div className=\"flex flex-col items-center space-y-6 w-full\">\r\n <div className=\"flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full\">\r\n <Mail className=\"w-8 h-8 text-blue-600\" />\r\n </div>\r\n \r\n <div className=\"text-center\">\r\n <h2 className=\"text-xl font-semibold text-gray-900 mb-2\">Sign in to Onairos</h2>\r\n <p className=\"text-gray-600\">Enter your email address to continue</p>\r\n {testMode && (\r\n <p className=\"text-sm text-blue-600 mt-2\">Test mode: Any valid email will work</p>\r\n )}\r\n </div>\r\n\r\n <form onSubmit={handleEmailSubmit} className=\"w-full max-w-md space-y-4\">\r\n <div>\r\n <label htmlFor=\"email\" className=\"block text-sm font-medium text-gray-700 mb-1\">\r\n Email address\r\n </label>\r\n <input\r\n type=\"email\"\r\n id=\"email\"\r\n value={email}\r\n onChange={(e) => setEmail(e.target.value)}\r\n placeholder=\"Enter your email\"\r\n className=\"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none\"\r\n required\r\n />\r\n </div>\r\n\r\n {error && (\r\n <p className=\"text-sm text-red-600\">{error}</p>\r\n )}\r\n\r\n <button\r\n type=\"submit\"\r\n disabled={isLoading}\r\n className=\"w-full py-3 px-4 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center\"\r\n >\r\n {isLoading ? (\r\n <div className=\"animate-spin h-5 w-5 border-2 border-white rounded-full border-t-transparent\"></div>\r\n ) : (\r\n <>\r\n Continue\r\n <ArrowRight className=\"ml-2 w-4 h-4\" />\r\n </>\r\n )}\r\n </button>\r\n </form>\r\n </div>\r\n );\r\n\r\n const renderCodeStep = () => (\r\n <div className=\"flex flex-col items-center space-y-6 w-full\">\r\n <div className=\"flex items-center justify-center w-16 h-16 bg-green-100 rounded-full\">\r\n <Mail className=\"w-8 h-8 text-green-600\" />\r\n </div>\r\n \r\n <div className=\"text-center\">\r\n <h2 className=\"text-xl font-semibold text-gray-900 mb-2\">Check your email</h2>\r\n <p className=\"text-gray-600\">We sent a verification code to</p>\r\n <p className=\"text-gray-900 font-medium\">{email}</p>\r\n {testMode && (\r\n <p className=\"text-sm text-blue-600 mt-2\">Test mode: Use code 123456</p>\r\n )}\r\n </div>\r\n\r\n <form onSubmit={handleCodeSubmit} className=\"w-full max-w-md space-y-4\">\r\n <div>\r\n <label htmlFor=\"code\" className=\"block text-sm font-medium text-gray-700 mb-1\">\r\n Verification code\r\n </label>\r\n <input\r\n type=\"text\"\r\n id=\"code\"\r\n value={code}\r\n onChange={(e) => setCode(e.target.value)}\r\n placeholder=\"Enter 6-digit code\"\r\n className=\"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none text-center text-lg tracking-widest\"\r\n maxLength=\"6\"\r\n required\r\n />\r\n </div>\r\n\r\n {error && (\r\n <p className=\"text-sm text-red-600\">{error}</p>\r\n )}\r\n\r\n <button\r\n type=\"submit\"\r\n disabled={isLoading}\r\n className=\"w-full py-3 px-4 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center\"\r\n >\r\n {isLoading ? (\r\n <div className=\"animate-spin h-5 w-5 border-2 border-white rounded-full border-t-transparent\"></div>\r\n ) : (\r\n 'Verify Code'\r\n )}\r\n </button>\r\n\r\n <button\r\n type=\"button\"\r\n onClick={() => setStep('email')}\r\n className=\"w-full py-2 px-4 text-gray-600 hover:text-gray-800\"\r\n >\r\n Use a different email\r\n </button>\r\n </form>\r\n </div>\r\n );\r\n\r\n const renderSuccessStep = () => (\r\n <div className=\"flex flex-col items-center space-y-6 w-full\">\r\n <div className=\"flex items-center justify-center w-16 h-16 bg-green-100 rounded-full\">\r\n <Check className=\"w-8 h-8 text-green-600\" />\r\n </div>\r\n \r\n <div className=\"text-center\">\r\n <h2 className=\"text-xl font-semibold text-gray-900 mb-2\">Email verified!</h2>\r\n <p className=\"text-gray-600\">Setting up your account...</p>\r\n </div>\r\n\r\n <div className=\"w-8 h-8\">\r\n <div className=\"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent\"></div>\r\n </div>\r\n </div>\r\n );\r\n\r\n return (\r\n <div className=\"flex flex-col items-center space-y-6 p-6 w-full\">\r\n {step === 'email' && renderEmailStep()}\r\n {step === 'code' && renderCodeStep()}\r\n {step === 'success' && renderSuccessStep()}\r\n </div>\r\n );\r\n} ","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\",\n key: \"oel41y\"\n }\n ]\n];\nconst Shield = createLucideIcon(\"shield\", __iconNode);\n\nexport { __iconNode, Shield as default };\n//# sourceMappingURL=shield.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"18\", height: \"11\", x: \"3\", y: \"11\", rx: \"2\", ry: \"2\", key: \"1w4ew1\" }],\n [\"path\", { d: \"M7 11V7a5 5 0 0 1 10 0v4\", key: \"fwvmzm\" }]\n];\nconst Lock = createLucideIcon(\"lock\", __iconNode);\n\nexport { __iconNode, Lock as default };\n//# sourceMappingURL=lock.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"8\", y2: \"12\", key: \"1pkeuh\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"16\", y2: \"16\", key: \"4dfq90\" }]\n];\nconst CircleAlert = createLucideIcon(\"circle-alert\", __iconNode);\n\nexport { __iconNode, CircleAlert as default };\n//# sourceMappingURL=circle-alert.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\",\n key: \"1ffxy3\"\n }\n ],\n [\"path\", { d: \"m21.854 2.147-10.94 10.939\", key: \"12cjpa\" }]\n];\nconst Send = createLucideIcon(\"send\", __iconNode);\n\nexport { __iconNode, Send as default };\n//# sourceMappingURL=send.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M15 3h6v6\", key: \"1q9fwt\" }],\n [\"path\", { d: \"M10 14 21 3\", key: \"gplh6r\" }],\n [\"path\", { d: \"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\", key: \"a6xqqp\" }]\n];\nconst ExternalLink = createLucideIcon(\"external-link\", __iconNode);\n\nexport { __iconNode, ExternalLink as default };\n//# sourceMappingURL=external-link.js.map\n","import React, { useState, useEffect } from 'react';\r\nimport { Shield, Lock, Send, Check, AlertCircle, ExternalLink } from 'lucide-react';\r\n\r\nconst socialPlatforms = [\r\n {\r\n name: 'YouTube',\r\n icon: 'https://onairos.sirv.com/Images/youtube-icon.png',\r\n connected: false,\r\n color: '#FF0000'\r\n },\r\n {\r\n name: 'Reddit',\r\n icon: 'https://onairos.sirv.com/Images/reddit-icon.png',\r\n connected: false,\r\n color: '#FF4500'\r\n },\r\n {\r\n name: 'Instagram',\r\n icon: 'https://onairos.sirv.com/Images/instagram-icon.png',\r\n connected: false,\r\n color: '#E1306C'\r\n },\r\n {\r\n name: 'Pinterest',\r\n icon: 'https://onairos.sirv.com/Images/pinterest-icon.png',\r\n connected: false,\r\n color: '#E60023'\r\n },\r\n {\r\n name: 'TikTok',\r\n icon: 'https://onairos.sirv.com/Images/tiktok-icon.png',\r\n connected: false,\r\n color: '#000000'\r\n }\r\n];\r\n\r\nconst steps = {\r\n CONNECT: 'connect',\r\n PASSPHRASE: 'passphrase',\r\n CONFIRM: 'confirm',\r\n UNIFYING: 'unifying'\r\n};\r\n\r\nexport default function UniversalOnboarding({ onComplete, appIcon }) {\r\n const [platforms, setPlatforms] = useState(socialPlatforms);\r\n const [currentStep, setCurrentStep] = useState(steps.CONNECT);\r\n const [unifyProgress, setUnifyProgress] = useState(0);\r\n const [passphrase, setPassphrase] = useState('');\r\n const [passphraseError, setPassphraseError] = useState('');\r\n const [isLoading, setIsLoading] = useState(false);\r\n\r\n // Listen for OAuth callbacks\r\n useEffect(() => {\r\n const handleOAuthCallback = (event) => {\r\n if (event.data && event.data.platform && event.data.status === 'success') {\r\n setPlatforms(platforms.map(p => \r\n p.name.toLowerCase() === event.data.platform.toLowerCase() \r\n ? { ...p, connected: true } \r\n : p\r\n ));\r\n }\r\n };\r\n\r\n window.addEventListener('message', handleOAuthCallback);\r\n return () => window.removeEventListener('message', handleOAuthCallback);\r\n }, [platforms]);\r\n\r\n // Handle unification progress\r\n useEffect(() => {\r\n if (currentStep === steps.UNIFYING) {\r\n const interval = setInterval(() => {\r\n setUnifyProgress(prev => {\r\n if (prev >= 100) {\r\n clearInterval(interval);\r\n onComplete();\r\n return 100;\r\n }\r\n return prev + 2;\r\n });\r\n }, 100);\r\n\r\n return () => clearInterval(interval);\r\n }\r\n }, [currentStep, onComplete]);\r\n\r\n const handleConnect = async (platformName) => {\r\n try {\r\n setIsLoading(true);\r\n \r\n // Simulate connection for demo purposes\r\n setTimeout(() => {\r\n setPlatforms(platforms.map(p => \r\n p.name === platformName \r\n ? { ...p, connected: true } \r\n : p\r\n ));\r\n setIsLoading(false);\r\n }, 1000);\r\n \r\n } catch (error) {\r\n console.error(`Failed to connect to ${platformName}:`, error);\r\n setIsLoading(false);\r\n }\r\n };\r\n\r\n const handleContinueToPassphrase = () => {\r\n if (platforms.some(p => p.connected)) {\r\n setCurrentStep(steps.PASSPHRASE);\r\n }\r\n };\r\n\r\n const validatePassphrase = () => {\r\n if (!passphrase || passphrase.length < 8) {\r\n setPassphraseError('Passphrase must be at least 8 characters');\r\n return false;\r\n }\r\n setPassphraseError('');\r\n return true;\r\n };\r\n\r\n const handleContinueToConfirm = () => {\r\n if (validatePassphrase()) {\r\n setCurrentStep(steps.CONFIRM);\r\n }\r\n };\r\n\r\n const handleUnify = async () => {\r\n setCurrentStep(steps.UNIFYING);\r\n try {\r\n const response = await fetch('https://api2.onairos.uk/unify', {\r\n method: 'POST',\r\n headers: {\r\n 'Authorization': `Bearer ${localStorage.getItem('onairosToken')}`,\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify({\r\n platforms: platforms.filter(p => p.connected).map(p => p.name.toLowerCase()),\r\n passphrase: passphrase\r\n })\r\n });\r\n\r\n if (!response.ok) {\r\n throw new Error('Failed to unify data');\r\n }\r\n } catch (error) {\r\n console.error('Failed to unify data:', error);\r\n // Handle error appropriately\r\n }\r\n };\r\n\r\n const renderConnectStep = () => (\r\n <div className=\"flex flex-col items-center space-y-6 w-full\">\r\n <h2 className=\"text-xl font-semibold text-gray-900\">Connect Your Accounts</h2>\r\n \r\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4 w-full max-w-md\">\r\n <div className=\"flex items-start\">\r\n <Shield className=\"text-blue-500 mr-2 flex-shrink-0 mt-0.5\" size={20} />\r\n <p className=\"text-sm text-blue-700\">\r\n Your data is never shared with anyone. It's only used to train your personal model and is stored securely.\r\n </p>\r\n </div>\r\n </div>\r\n\r\n <div className=\"grid grid-cols-2 gap-4 w-full max-w-md\">\r\n {platforms.map((platform) => (\r\n <button\r\n key={platform.name}\r\n onClick={() => handleConnect(platform.name)}\r\n disabled={isLoading || platform.connected}\r\n className={`flex flex-col items-center justify-center p-4 rounded-lg border transition-all ${\r\n platform.connected \r\n ? 'bg-green-50 border-green-500' \r\n : 'border-gray-300 hover:border-blue-500 hover:shadow-sm'\r\n }`}\r\n >\r\n <div className=\"relative\">\r\n <img src={platform.icon} alt={platform.name} className=\"w-10 h-10 mb-2\" />\r\n {platform.connected && (\r\n <div className=\"absolute -top-1 -right-1 bg-green-500 rounded-full p-0.5\">\r\n <Check size={14} className=\"text-white\" />\r\n </div>\r\n )}\r\n </div>\r\n <span className={`text-sm ${platform.connected ? 'text-green-600' : 'text-gray-700'}`}>\r\n {platform.connected ? 'Connected' : `Connect`}\r\n </span>\r\n </button>\r\n ))}\r\n </div>\r\n\r\n <button\r\n onClick={handleContinueToPassphrase}\r\n disabled={!platforms.some(p => p.connected)}\r\n className={`w-full max-w-md py-3 px-4 rounded-lg font-semibold transition-all ${\r\n platforms.some(p => p.connected)\r\n ? 'bg-blue-500 text-white hover:bg-blue-600'\r\n : 'bg-gray-300 text-gray-500 cursor-not-allowed'\r\n }`}\r\n >\r\n Continue\r\n </button>\r\n \r\n <p className=\"text-xs text-gray-500 max-w-md text-center\">\r\n Connect at least one account to create your personalized AI model\r\n </p>\r\n </div>\r\n );\r\n\r\n const renderPassphraseStep = () => (\r\n <div className=\"flex flex-col items-center space-y-6 w-full\">\r\n <h2 className=\"text-xl font-semibold text-gray-900\">Create Your Secure Passphrase</h2>\r\n \r\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4 w-full max-w-md\">\r\n <div className=\"flex items-start\">\r\n <Lock className=\"text-blue-500 mr-2 flex-shrink-0 mt-0.5\" size={20} />\r\n <p className=\"text-sm text-blue-700\">\r\n Your passphrase is used to secure your model. We don't store it, so please remember it for future access.\r\n </p>\r\n </div>\r\n </div>\r\n\r\n <div className=\"w-full max-w-md\">\r\n <label htmlFor=\"passphrase\" className=\"block text-sm font-medium text-gray-700 mb-1\">\r\n 8+ Character Passphrase\r\n </label>\r\n <input\r\n type=\"password\"\r\n id=\"passphrase\"\r\n value={passphrase}\r\n onChange={(e) => setPassphrase(e.target.value)}\r\n placeholder=\"Enter your secure passphrase\"\r\n className={`w-full p-3 border ${passphraseError ? 'border-red-500' : 'border-gray-300'} rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none`}\r\n />\r\n {passphraseError && (\r\n <p className=\"mt-1 text-sm text-red-600 flex items-center\">\r\n <AlertCircle size={14} className=\"mr-1\" /> {passphraseError}\r\n </p>\r\n )}\r\n </div>\r\n\r\n <div className=\"flex space-x-3 w-full max-w-md\">\r\n <button\r\n onClick={() => setCurrentStep(steps.CONNECT)}\r\n className=\"flex-1 py-3 px-4 border border-gray-300 rounded-lg font-semibold text-gray-700 hover:bg-gray-50\"\r\n >\r\n Back\r\n </button>\r\n <button\r\n onClick={handleContinueToConfirm}\r\n className=\"flex-1 py-3 px-4 bg-blue-500 rounded-lg font-semibold text-white hover:bg-blue-600\"\r\n >\r\n Continue\r\n </button>\r\n </div>\r\n </div>\r\n );\r\n\r\n const renderConfirmStep = () => (\r\n <div className=\"flex flex-col items-center space-y-6 w-full\">\r\n <h2 className=\"text-xl font-semibold text-gray-900\">Confirm Data Transfer</h2>\r\n \r\n <div className=\"flex justify-center items-center w-full max-w-md py-8\">\r\n <div className=\"relative flex items-center\">\r\n <div className=\"p-3 bg-gray-100 rounded-full\">\r\n <img \r\n src={appIcon || \"https://onairos.sirv.com/Images/onairos-icon.png\"} \r\n alt=\"App\" \r\n className=\"w-16 h-16 rounded-full\"\r\n />\r\n </div>\r\n \r\n <div className=\"mx-4 animate-pulse\">\r\n <Send size={24} className=\"text-blue-500\" />\r\n </div>\r\n \r\n <div className=\"p-3 bg-blue-100 rounded-full\">\r\n <img \r\n src=\"https://onairos.sirv.com/Images/onairos-icon.png\" \r\n alt=\"Onairos\" \r\n className=\"w-16 h-16 rounded-full\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4 w-full max-w-md\">\r\n <p className=\"text-sm text-blue-700\">\r\n You're about to securely send your data to Onairos to train your personal AI model.\r\n Your data is end-to-end encrypted with your passphrase and never shared with anyone.\r\n </p>\r\n </div>\r\n \r\n <div className=\"w-full max-w-md\">\r\n <h3 className=\"font-medium text-gray-700 mb-2\">Connected platforms:</h3>\r\n <div className=\"flex flex-wrap gap-2\">\r\n {platforms.filter(p => p.connected).map(platform => (\r\n <div \r\n key={platform.name} \r\n className=\"flex items-center bg-green-50 border border-green-200 rounded-full px-3 py-1\"\r\n >\r\n <img src={platform.icon} alt={platform.name} className=\"w-4 h-4 mr-1\" />\r\n <span className=\"text-sm text-green-700\">{platform.name}</span>\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n\r\n <div className=\"flex space-x-3 w-full max-w-md\">\r\n <button\r\n onClick={() => setCurrentStep(steps.PASSPHRASE)}\r\n className=\"flex-1 py-3 px-4 border border-gray-300 rounded-lg font-semibold text-gray-700 hover:bg-gray-50\"\r\n >\r\n Back\r\n </button>\r\n <button\r\n onClick={handleUnify}\r\n className=\"flex-1 py-3 px-4 bg-blue-500 rounded-lg font-semibold text-white hover:bg-blue-600\"\r\n >\r\n Confirm & Create Model\r\n </button>\r\n </div>\r\n \r\n <p className=\"text-xs text-gray-500 max-w-md text-center\">\r\n By proceeding, you agree to Onairos' <a href=\"https://onairos.uk/privacy\" target=\"_blank\" rel=\"noopener noreferrer\" className=\"text-blue-500 underline flex items-center inline-flex\">\r\n Privacy Policy <ExternalLink size={12} className=\"ml-0.5\" />\r\n </a>\r\n </p>\r\n </div>\r\n );\r\n\r\n const renderUnifyingStep = () => (\r\n <div className=\"flex flex-col items-center justify-center space-y-6 p-6\">\r\n <h2 className=\"text-xl font-semibold text-gray-900\">Creating Your Personal AI Model</h2>\r\n <p className=\"text-gray-600 text-center\">\r\n Please wait while we securely process your information\r\n </p>\r\n \r\n <div className=\"w-full max-w-md\">\r\n <div className=\"relative pt-1\">\r\n <div className=\"flex mb-2 items-center justify-between\">\r\n <div>\r\n <span className=\"text-xs font-semibold inline-block py-1 px-2 uppercase rounded-full text-blue-600 bg-blue-200\">\r\n Progress\r\n </span>\r\n </div>\r\n <div className=\"text-right\">\r\n <span className=\"text-xs font-semibold inline-block text-blue-600\">\r\n {unifyProgress}%\r\n </span>\r\n </div>\r\n </div>\r\n <div className=\"overflow-hidden h-2 mb-4 text-xs flex rounded bg-blue-200\">\r\n <div\r\n style={{ width: `${unifyProgress}%` }}\r\n className=\"shadow-none flex flex-col text-center whitespace-nowrap text-white justify-center bg-blue-500 transition-all duration-500\"\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"w-12 h-12 animate-spin\">\r\n <svg className=\"w-full h-full text-blue-500\" viewBox=\"0 0 24 24\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z\"\r\n />\r\n </svg>\r\n </div>\r\n \r\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4 w-full max-w-md\">\r\n <p className=\"text-sm text-blue-700\">\r\n Your data is being encrypted with your passphrase and securely processed. This may take a few minutes.\r\n </p>\r\n </div>\r\n </div>\r\n );\r\n\r\n return (\r\n <div className=\"flex flex-col items-center space-y-6 p-6 w-full\">\r\n {currentStep === steps.CONNECT && renderConnectStep()}\r\n {currentStep === steps.PASSPHRASE && renderPassphraseStep()}\r\n {currentStep === steps.CONFIRM && renderConfirmStep()}\r\n {currentStep === steps.UNIFYING && renderUnifyingStep()}\r\n </div>\r\n );\r\n}","import React, { useState, useEffect } from 'react';\r\nimport { Lock, Check, AlertCircle } from 'lucide-react';\r\n\r\nexport default function PinSetup({ onComplete, userEmail }) {\r\n const [pin, setPin] = useState('');\r\n const [confirmPin, setConfirmPin] = useState('');\r\n const [step, setStep] = useState('create'); // 'create' | 'confirm' | 'success'\r\n const [error, setError] = useState('');\r\n const [pinRequirements, setPinRequirements] = useState({\r\n length: false,\r\n number: false,\r\n uppercase: false,\r\n lowercase: false\r\n });\r\n\r\n useEffect(() => {\r\n // Check PIN requirements\r\n setPinRequirements({\r\n length: pin.length >= 6,\r\n number: /[0-9]/.test(pin),\r\n uppercase: /[A-Z]/.test(pin),\r\n lowercase: /[a-z]/.test(pin)\r\n });\r\n }, [pin]);\r\n\r\n const allRequirementsMet = Object.values(pinRequirements).every(req => req);\r\n\r\n const handleCreatePin = (e) => {\r\n e.preventDefault();\r\n setError('');\r\n\r\n if (!allRequirementsMet) {\r\n setError('Please meet all PIN requirements');\r\n return;\r\n }\r\n\r\n setStep('confirm');\r\n };\r\n\r\n const handleConfirmPin = (e) => {\r\n e.preventDefault();\r\n setError('');\r\n\r\n if (pin !== confirmPin) {\r\n setError('PINs do not match');\r\n return;\r\n }\r\n\r\n setStep('success');\r\n \r\n // Simulate PIN storage\r\n setTimeout(() => {\r\n onComplete({ \r\n pin: pin, \r\n email: userEmail,\r\n pinCreated: true \r\n });\r\n }, 1500);\r\n };\r\n\r\n const renderCreateStep = () => (\r\n <div className=\"flex flex-col items-center space-y-6 w-full\">\r\n <div className=\"flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full\">\r\n <Lock className=\"w-8 h-8 text-blue-600\" />\r\n </div>\r\n \r\n <div className=\"text-center\">\r\n <h2 className=\"text-xl font-semibold text-gray-900 mb-2\">Create Your PIN</h2>\r\n <p className=\"text-gray-600\">Your PIN secures your Onairos account</p>\r\n </div>\r\n\r\n <form onSubmit={handleCreatePin} className=\"w-full max-w-md space-y-4\">\r\n <div>\r\n <label htmlFor=\"pin\" className=\"block text-sm font-medium text-gray-700 mb-1\">\r\n Create PIN\r\n </label>\r\n <input\r\n type=\"password\"\r\n id=\"pin\"\r\n value={pin}\r\n onChange={(e) => setPin(e.target.value)}\r\n placeholder=\"Enter your PIN\"\r\n className=\"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none\"\r\n required\r\n />\r\n </div>\r\n\r\n <div className=\"space-y-2\">\r\n <p className=\"text-sm font-medium text-gray-700\">PIN Requirements:</p>\r\n {Object.entries(pinRequirements).map(([req, met]) => (\r\n <div key={req} className=\"flex items-center\">\r\n <div className={`w-4 h-4 rounded-full mr-2 flex items-center justify-center ${\r\n met ? 'bg-green-500' : 'bg-gray-300'\r\n }`}>\r\n {met && <Check size={12} className=\"text-white\" />}\r\n </div>\r\n <span className={`text-sm ${met ? 'text-green-600' : 'text-gray-600'}`}>\r\n {req === 'length' ? 'At least 6 characters' :\r\n req === 'number' ? 'One number' :\r\n req === 'uppercase' ? 'One uppercase letter' : \r\n 'One lowercase letter'}\r\n </span>\r\n </div>\r\n ))}\r\n </div>\r\n\r\n {error && (\r\n <div className=\"flex items-center text-red-600 text-sm\">\r\n <AlertCircle size={16} className=\"mr-1\" />\r\n {error}\r\n </div>\r\n )}\r\n\r\n <button\r\n type=\"submit\"\r\n disabled={!allRequirementsMet}\r\n className={`w-full py-3 px-4 rounded-lg font-semibold ${\r\n allRequirementsMet\r\n ? 'bg-blue-600 text-white hover:bg-blue-700'\r\n : 'bg-gray-300 text-gray-500 cursor-not-allowed'\r\n }`}\r\n >\r\n Continue\r\n </button>\r\n </form>\r\n </div>\r\n );\r\n\r\n const renderConfirmStep = () => (\r\n <div className=\"flex flex-col items-center space-y-6 w-full\">\r\n <div className=\"flex items-center justify-center w-16 h-16 bg-orange-100 rounded-full\">\r\n <Lock className=\"w-8 h-8 text-orange-600\" />\r\n </div>\r\n \r\n <div className=\"text-center\">\r\n <h2 className=\"text-xl font-semibold text-gray-900 mb-2\">Confirm Your PIN</h2>\r\n <p className=\"text-gray-600\">Enter your PIN again to confirm</p>\r\n </div>\r\n\r\n <form onSubmit={handleConfirmPin} className=\"w-full max-w-md space-y-4\">\r\n <div>\r\n <label htmlFor=\"confirmPin\" className=\"block text-sm font-medium text-gray-700 mb-1\">\r\n Confirm PIN\r\n </label>\r\n <input\r\n type=\"password\"\r\n id=\"confirmPin\"\r\n value={confirmPin}\r\n onChange={(e) => setConfirmPin(e.target.value)}\r\n placeholder=\"Re-enter your PIN\"\r\n className=\"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none\"\r\n required\r\n />\r\n </div>\r\n\r\n {error && (\r\n <div className=\"flex items-center text-red-600 text-sm\">\r\n <AlertCircle size={16} className=\"mr-1\" />\r\n {error}\r\n </div>\r\n )}\r\n\r\n <div className=\"flex space-x-3\">\r\n <button\r\n type=\"button\"\r\n onClick={() => {\r\n setStep('create');\r\n setConfirmPin('');\r\n setError('');\r\n }}\r\n className=\"flex-1 py-3 px-4 border border-gray-300 rounded-lg font-semibold text-gray-700 hover:bg-gray-50\"\r\n >\r\n Back\r\n </button>\r\n <button\r\n type=\"submit\"\r\n className=\"flex-1 py-3 px-4 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700\"\r\n >\r\n Create PIN\r\n </button>\r\n </div>\r\n </form>\r\n </div>\r\n );\r\n\r\n const renderSuccessStep = () => (\r\n <div className=\"flex flex-col items-center space-y-6 w-full\">\r\n <div className=\"flex items-center justify-center w-16 h-16 bg-green-100 rounded-full\">\r\n <Check className=\"w-8 h-8 text-green-600\" />\r\n </div>\r\n \r\n <div className=\"text-center\">\r\n <h2 className=\"text-xl font-semibold text-gray-900 mb-2\">PIN Created!</h2>\r\n <p className=\"text-gray-600\">Your account is now secure</p>\r\n </div>\r\n\r\n <div className=\"w-8 h-8\">\r\n <div className=\"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent\"></div>\r\n </div>\r\n </div>\r\n );\r\n\r\n return (\r\n <div className=\"flex flex-col items-center space-y-6 p-6 w-full\">\r\n {step === 'create' && renderCreateStep()}\r\n {step === 'confirm' && renderConfirmStep()}\r\n {step === 'success' && renderSuccessStep()}\r\n </div>\r\n );\r\n} ","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"ellipse\", { cx: \"12\", cy: \"5\", rx: \"9\", ry: \"3\", key: \"msslwz\" }],\n [\"path\", { d: \"M3 5V19A9 3 0 0 0 21 19V5\", key: \"1wlel7\" }],\n [\"path\", { d: \"M3 12A9 3 0 0 0 21 12\", key: \"mv7ke4\" }]\n];\nconst Database = createLucideIcon(\"database\", __iconNode);\n\nexport { __iconNode, Database as default };\n//# sourceMappingURL=database.js.map\n","/**\n * @license lucide-react v0.503.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n];\nconst X = createLucideIcon(\"x\", __iconNode);\n\nexport { __iconNode, X as default };\n//# sourceMappingURL=x.js.map\n","import React, { useState } from 'react';\r\nimport { Shield, Check, X, Database } from 'lucide-react';\r\n\r\nexport default function DataRequest({ onComplete, userEmail, requestData }) {\r\n const [selectedData, setSelectedData] = useState({});\r\n const [isProcessing, setIsProcessing] = useState(false);\r\n\r\n // Default data types if none provided\r\n const defaultDataTypes = [\r\n {\r\n id: 'basic',\r\n name: 'Basic Profile',\r\n description: 'Name, email, and basic preferences',\r\n required: true\r\n },\r\n {\r\n id: 'preferences',\r\n name: 'User Preferences',\r\n description: 'App settings and customization preferences',\r\n required: false\r\n },\r\n {\r\n id: 'usage',\r\n name: 'Usage Analytics',\r\n description: 'How you interact with the application',\r\n required: false\r\n }\r\n ];\r\n\r\n const dataTypes = requestData?.dataTypes || defaultDataTypes;\r\n\r\n const handleDataToggle = (dataId) => {\r\n const dataType = dataTypes.find(d => d.id === dataId);\r\n if (dataType?.required) return; // Can't toggle required data\r\n\r\n setSelectedData(prev => ({\r\n ...prev,\r\n [dataId]: !prev[dataId]\r\n }));\r\n };\r\n\r\n const handleApprove = async () => {\r\n setIsProcessing(true);\r\n\r\n // Include all required data and selected optional data\r\n const approvedData = dataTypes\r\n .filter(dataType => dataType.required || selectedData[dataType.id])\r\n .map(dataType => dataType.id);\r\n\r\n // Simulate API call\r\n setTimeout(() => {\r\n onComplete({\r\n approved: true,\r\n dataTypes: approvedData,\r\n email: userEmail,\r\n timestamp: new Date().toISOString()\r\n });\r\n }, 2000);\r\n };\r\n\r\n const handleReject = () => {\r\n onComplete({\r\n approved: false,\r\n email: userEmail,\r\n timestamp: new Date().toISOString()\r\n });\r\n };\r\n\r\n if (isProcessing) {\r\n return (\r\n <div className=\"flex flex-col items-center space-y-6 p-6 w-full\">\r\n <div className=\"flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full\">\r\n <Database className=\"w-8 h-8 text-blue-600\" />\r\n </div>\r\n \r\n <div className=\"text-center\">\r\n <h2 className=\"text-xl font-semibold text-gray-900 mb-2\">Processing Request</h2>\r\n <p className=\"text-gray-600\">Setting up your data permissions...</p>\r\n </div>\r\n\r\n <div className=\"w-8 h-8\">\r\n <div className=\"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent\"></div>\r\n </div>\r\n </div>\r\n );\r\n }\r\n\r\n return (\r\n <div className=\"flex flex-col items-center space-y-6 p-6 w-full\">\r\n <div className=\"flex items-center justify-center w-16 h-16 bg-green-100 rounded-full\">\r\n <Shield className=\"w-8 h-8 text-green-600\" />\r\n </div>\r\n \r\n <div className=\"text-center\">\r\n <h2 className=\"text-xl font-semibold text-gray-900 mb-2\">Data Access Request</h2>\r\n <p className=\"text-gray-600\">Choose what data you'd like to share</p>\r\n <p className=\"text-sm text-gray-500 mt-1\">Signed in as: {userEmail}</p>\r\n </div>\r\n\r\n <div className=\"w-full max-w-md space-y-3\">\r\n {dataTypes.map((dataType) => (\r\n <div\r\n key={dataType.id}\r\n className={`border rounded-lg p-4 ${\r\n dataType.required \r\n ? 'border-blue-200 bg-blue-50' \r\n : selectedData[dataType.id] \r\n ? 'border-green-200 bg-green-50' \r\n : 'border-gray-200 bg-white'\r\n }`}\r\n >\r\n <div className=\"flex items-start justify-between\">\r\n <div className=\"flex-1\">\r\n <div className=\"flex items-center\">\r\n <h3 className=\"font-medium text-gray-900\">{dataType.name}</h3>\r\n {dataType.required && (\r\n <span className=\"ml-2 text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded\">\r\n Required\r\n </span>\r\n )}\r\n </div>\r\n <p className=\"text-sm text-gray-600 mt-1\">{dataType.description}</p>\r\n </div>\r\n \r\n <button\r\n onClick={() => handleDataToggle(dataType.id)}\r\n disabled={dataType.required}\r\n className={`ml-3 w-6 h-6 rounded-full border-2 flex items-center justify-center ${\r\n dataType.required || selectedData[dataType.id]\r\n ? 'border-green-500 bg-green-500'\r\n : 'border-gray-300 bg-white hover:border-green-500'\r\n } ${dataType.required ? 'cursor-default' : 'cursor-pointer'}`}\r\n >\r\n {(dataType.required || selectedData[dataType.id]) && (\r\n <Check size={14} className=\"text-white\" />\r\n )}\r\n </button>\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n\r\n <div className=\"bg-blue-50 border border-blue-200 rounded-lg p-4 w-full max-w-md\">\r\n <div className=\"flex items-start\">\r\n <Shield className=\"text-blue-500 mr-2 flex-shrink-0 mt-0.5\" size={20} />\r\n <div>\r\n <p className=\"text-sm text-blue-700 font-medium\">Your data is secure</p>\r\n <p className=\"text-xs text-blue-600 mt-1\">\r\n We use industry-standard encryption and never share your data with third parties.\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"flex space-x-3 w-full max-w-md\">\r\n <button\r\n onClick={handleReject}\r\n className=\"flex-1 py-3 px-4 border border-gray-300 rounded-lg font-semibold text-gray-700 hover:bg-gray-50 flex items-center justify-center\"\r\n >\r\n <X size={16} className=\"mr-1\" />\r\n Deny\r\n </button>\r\n <button\r\n onClick={handleApprove}\r\n className=\"flex-1 py-3 px-4 bg-blue-600 text-white rounded-lg font-semibold hover:bg-blue-700 flex items-center justify-center\"\r\n >\r\n <Check size={16} className=\"mr-1\" />\r\n Approve\r\n </button>\r\n </div>\r\n\r\n <p className=\"text-xs text-gray-500 max-w-md text-center\">\r\n You can change these permissions anytime in your account settings.\r\n </p>\r\n </div>\r\n );\r\n} ","import React, { useEffect, useState, useRef } from 'react';\r\nimport { rsaEncrypt } from './RSA.jsx';\r\nimport EmailAuth from './components/EmailAuth.js';\r\nimport UniversalOnboarding from './components/UniversalOnboarding.js';\r\nimport PinSetup from './components/PinSetup.js';\r\nimport DataRequest from './components/DataRequest.js';\r\n\r\nexport function OnairosButton({\r\n requestData, \r\n webpageName, \r\n inferenceData = null, \r\n onComplete = null, \r\n autoFetch = true,\r\n proofMode = false, \r\n textLayout = 'below', \r\n textColor = 'white',\r\n login = false,\r\n buttonType = 'pill',\r\n loginReturn = null,\r\n loginType = 'signIn',\r\n visualType = 'full',\r\n}) {\r\n\r\n const [showOverlay, setShowOverlay] = useState(false);\r\n const [currentFlow, setCurrentFlow] = useState('email'); // 'email' | 'onboarding' | 'pin' | 'dataRequest'\r\n const [userData, setUserData] = useState(null);\r\n const [isLoading, setIsLoading] = useState(false);\r\n const [error, setError] = useState(null);\r\n\r\n // Check for existing user session\r\n useEffect(() => {\r\n const checkExistingSession = () => {\r\n const savedUser = localStorage.getItem('onairosUser');\r\n if (savedUser) {\r\n try {\r\n const user = JSON.parse(savedUser);\r\n setUserData(user);\r\n // If user has completed onboarding and PIN setup, go directly to data request\r\n if (user.onboardingComplete && user.pinCreated) {\r\n setCurrentFlow('dataRequest');\r\n } else if (user.verified && !user.onboardingComplete) {\r\n setCurrentFlow('onboarding');\r\n } else if (user.onboardingComplete && !user.pinCreated) {\r\n setCurrentFlow('pin');\r\n }\r\n } catch (error) {\r\n console.error('Error parsing saved user data:', error);\r\n localStorage.removeItem('onairosUser');\r\n }\r\n }\r\n };\r\n\r\n checkExistingSession();\r\n }, []);\r\n\r\n const openTerminal = async () => {\r\n try {\r\n console.log('🔥 openTerminal called - showing overlay');\r\n setShowOverlay(true);\r\n console.log('🔥 setShowOverlay(true) called');\r\n } catch (error) {\r\n console.error('Error in openTerminal:', error);\r\n }\r\n };\r\n\r\n const handleCloseOverlay = () => {\r\n setShowOverlay(false);\r\n setError(null);\r\n };\r\n\r\n const handleEmailAuthSuccess = (authData) => {\r\n console.log('Email auth successful:', authData);\r\n const newUserData = {\r\n ...authData,\r\n verified: true,\r\n onboardingComplete: false,\r\n pinCreated: false\r\n };\r\n setUserData(newUserData);\r\n localStorage.setItem('onairosUser', JSON.stringify(newUserData));\r\n setCurrentFlow('onboarding');\r\n };\r\n\r\n const handleOnboardingComplete = () => {\r\n console.log('Onboarding completed');\r\n const updatedUserData = {\r\n ...userData,\r\n onboardingComplete: true\r\n };\r\n setUserData(updatedUserData);\r\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\r\n setCurrentFlow('pin');\r\n };\r\n\r\n const handlePinSetupComplete = (pinData) => {\r\n console.log('PIN setup completed:', pinData);\r\n const updatedUserData = {\r\n ...userData,\r\n ...pinData,\r\n pinCreated: true\r\n };\r\n setUserData(updatedUserData);\r\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\r\n setCurrentFlow('dataRequest');\r\n };\r\n\r\n const handleDataRequestComplete = (requestResult) => {\r\n console.log('Data request completed:', requestResult);\r\n \r\n // Update user data with request result\r\n const updatedUserData = {\r\n ...userData,\r\n lastDataRequest: requestResult\r\n };\r\n setUserData(updatedUserData);\r\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\r\n\r\n // Close overlay\r\n setShowOverlay(false);\r\n\r\n // Call onComplete callback if provided\r\n if (onComplete) {\r\n onComplete(requestResult);\r\n }\r\n };\r\n\r\n const renderCurrentFlow = () => {\r\n switch (currentFlow) {\r\n case 'email':\r\n return (\r\n <EmailAuth \r\n onSuccess={handleEmailAuthSuccess}\r\n testMode={true} // Set to false in production\r\n />\r\n );\r\n \r\n case 'onboarding':\r\n return (\r\n <UniversalOnboarding \r\n onComplete={handleOnboardingComplete}\r\n appIcon=\"https://onairos.sirv.com/Images/OnairosBlack.png\"\r\n />\r\n );\r\n \r\n case 'pin':\r\n return (\r\n <PinSetup \r\n onComplete={handlePinSetupComplete}\r\n userEmail={userData?.email}\r\n />\r\n );\r\n \r\n case 'dataRequest':\r\n return (\r\n <DataRequest \r\n onComplete={handleDataRequestComplete}\r\n userEmail={userData?.email}\r\n requestData={requestData}\r\n />\r\n );\r\n \r\n default:\r\n return (\r\n <div className=\"flex flex-col items-center space-y-4 p-6\">\r\n <div className=\"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent\"></div>\r\n <p className=\"text-gray-600\">Loading...</p>\r\n </div>\r\n );\r\n }\r\n };\r\n\r\n // Styling and button class based on visual type\r\n const buttonClass = \r\n `flex items-center justify-center font-bold rounded cursor-pointer ${\r\n buttonType === 'pill' ? 'px-4 py-2' : 'w-12 h-12'\r\n } bg-transparent OnairosConnect`;\r\n\r\n const buttonStyle = {\r\n flexDirection: textLayout === 'below' ? 'column' : 'row',\r\n backgroundColor: 'transparent',\r\n color: textColor,\r\n border: '1px solid transparent',\r\n };\r\n\r\n // Icon and text style based on the visualType\r\n const logoStyle = {\r\n width: '20px',\r\n height: '20px',\r\n marginRight: visualType === 'full' ? '12px' : '0',\r\n };\r\n\r\n const getText = () => {\r\n switch (loginType) {\r\n case 'signUp':\r\n return 'Sign Up with Onairos';\r\n case 'signOut':\r\n return 'Sign Out of Onairos';\r\n default:\r\n return 'Sign In with Onairos';\r\n }\r\n };\r\n\r\n return (\r\n <div className=\"flex items-center justify-center\">\r\n <button\r\n className={buttonClass}\r\n onClick={openTerminal}\r\n style={buttonStyle}\r\n >\r\n {(visualType === 'full' || visualType === 'icon') && (\r\n <img\r\n src=\"https://onairos.sirv.com/Images/OnairosBlack.png\"\r\n alt=\"Onairos Logo\"\r\n style={logoStyle}\r\n className={`${buttonType === 'pill' ? 'w-6 h-6' : 'w-8 h-8'} object-contain`}\r\n />\r\n )}\r\n\r\n {(visualType === 'full' || visualType === 'textOnly') && (\r\n <span className={`${textColor === 'black' ? 'text-black' : 'text-white'} ${visualType === 'icon' ? 'sr-only' : ''} ${textLayout === 'right' ? 'ml-2' : textLayout === 'left' ? 'mr-2' : ''}`}>\r\n {getText()}\r\n </span>\r\n )}\r\n </button>\r\n\r\n {showOverlay && (\r\n <div className=\"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50\">\r\n {console.log('🔥 Rendering overlay!')}\r\n <div className=\"bg-white rounded-lg shadow-xl max-w-md w-full mx-4 max-h-[90vh] overflow-y-auto\">\r\n <div className=\"flex justify-between items-center p-4 border-b\">\r\n <h2 className=\"text-lg font-semibold\">\r\n {currentFlow === 'email' && 'Connect with Onairos'}\r\n {currentFlow === 'onboarding' && 'Account Setup'}\r\n {currentFlow === 'pin' && 'Secure Your Account'}\r\n {currentFlow === 'dataRequest' && 'Data Access Request'}\r\n </h2>\r\n <button \r\n onClick={handleCloseOverlay}\r\n className=\"text-gray-500 hover:text-gray-700 text-xl font-bold\"\r\n >\r\n ×\r\n </button>\r\n </div>\r\n <div className=\"p-4\">\r\n {error && (\r\n <div className=\"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg\">\r\n <p className=\"text-red-700 text-sm\">{error}</p>\r\n </div>\r\n )}\r\n {renderCurrentFlow()}\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n}\r\n\r\nexport default OnairosButton;","import React from 'react';\r\nimport { OnairosButton } from './onairosButton.jsx';\r\n\r\n// Configuration object for the Telegram SDK\r\n\r\nexport function Onairos(props) {\r\n return (\r\n <>\r\n {/* <DeepLink/> */}\r\n <OnairosButton {...props} />\r\n </>\r\n );\r\n}\r\n\r\nexport default Onairos;\r\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","x","d","__WEBPACK_EXTERNAL_MODULE_react__","createElement","forwardRef","useEffect","useState","toPascalCase","string","camelCase","replace","match","p1","p2","toUpperCase","toLowerCase","toCamelCase","charAt","slice","mergeClasses","classes","filter","className","index","array","Boolean","trim","indexOf","join","hasA11yProp","props","startsWith","defaultAttributes","xmlns","width","height","viewBox","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","Icon","color","size","absoluteStrokeWidth","children","iconNode","rest","ref","Number","map","tag","attrs","Array","isArray","createLucideIcon","iconName","Component","displayName","Mail","rx","ArrowRight","Check","EmailAuth","_ref","onSuccess","testMode","email","setEmail","code","setCode","step","setStep","isLoading","setIsLoading","error","setError","handleEmailSubmit","async","e","preventDefault","test","validateEmail","setTimeout","fetch","method","headers","body","JSON","stringify","ok","Error","message","handleCodeSubmit","verified","response","data","json","token","React","onSubmit","htmlFor","type","id","value","onChange","target","placeholder","required","disabled","maxLength","onClick","Shield","Lock","ry","CircleAlert","cx","cy","r","x1","x2","y1","y2","Send","ExternalLink","socialPlatforms","name","icon","connected","steps","CONNECT","PASSPHRASE","CONFIRM","UNIFYING","UniversalOnboarding","onComplete","appIcon","platforms","setPlatforms","currentStep","setCurrentStep","unifyProgress","setUnifyProgress","passphrase","setPassphrase","passphraseError","setPassphraseError","handleOAuthCallback","event","platform","status","p","_objectSpread","window","addEventListener","removeEventListener","interval","setInterval","prev","clearInterval","handleContinueToPassphrase","some","handleContinueToConfirm","length","handleUnify","concat","localStorage","getItem","console","platformName","handleConnect","src","alt","AlertCircle","href","rel","style","PinSetup","userEmail","pin","setPin","confirmPin","setConfirmPin","pinRequirements","setPinRequirements","number","uppercase","lowercase","allRequirementsMet","values","every","req","handleCreatePin","handleConfirmPin","pinCreated","entries","_ref2","met","Database","X","DataRequest","requestData","selectedData","setSelectedData","isProcessing","setIsProcessing","dataTypes","description","dataType","dataId","find","handleDataToggle","handleReject","approved","timestamp","Date","toISOString","approvedData","OnairosButton","webpageName","inferenceData","autoFetch","proofMode","textLayout","textColor","login","buttonType","loginReturn","loginType","visualType","showOverlay","setShowOverlay","currentFlow","setCurrentFlow","userData","setUserData","checkExistingSession","savedUser","user","parse","onboardingComplete","removeItem","handleEmailAuthSuccess","authData","log","newUserData","setItem","handleOnboardingComplete","updatedUserData","handlePinSetupComplete","pinData","handleDataRequestComplete","requestResult","lastDataRequest","buttonClass","buttonStyle","flexDirection","backgroundColor","border","logoStyle","marginRight","getText","handleCloseOverlay","renderCurrentFlow","Onairos"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onairos",
3
- "version": "1.0.10",
3
+ "version": "1.0.13",
4
4
  "dependencies": {
5
5
  "@react-oauth/google": "^0.12.1",
6
6
  "@telegram-apps/sdk-react": "^2.0.25",
@@ -92,7 +92,7 @@
92
92
  "main": "dist/onairos.bundle.js",
93
93
  "module": "dist/onairos.esm.js",
94
94
  "types": "onairos.d.ts",
95
- "browser": "dist/onairos.umd.js",
95
+ "browser": "dist/onairos.bundle.js",
96
96
  "react-native": "dist/onairos.native.js",
97
97
  "repository": {
98
98
  "type": "git",
@@ -1,127 +1,81 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { motion } from 'framer-motion';
1
+ import React, { useState } from 'react';
3
2
 
4
3
  export default function SecuritySetup({ onComplete }) {
5
- const [pin, setPin] = useState('');
6
- const [securityMethod, setSecurityMethod] = useState(null);
7
- const [pinRequirements, setPinRequirements] = useState({
8
- length: false,
9
- capital: false,
10
- number: false,
11
- symbol: false
12
- });
4
+ const [securityMethod, setSecurityMethod] = useState('pin');
13
5
 
14
- useEffect(() => {
15
- // Check PIN requirements
16
- setPinRequirements({
17
- length: pin.length >= 8,
18
- capital: /[A-Z]/.test(pin),
19
- number: /[0-9]/.test(pin),
20
- symbol: /[!@#$%^&*(),.?":{}|<>]/.test(pin)
21
- });
22
- }, [pin]);
23
-
24
- const allRequirementsMet = Object.values(pinRequirements).every(req => req);
25
-
26
- const handlePinSubmit = async () => {
27
- if (allRequirementsMet) {
28
- // Here you would typically hash the PIN and store it
29
- onComplete({ method: 'pin', value: pin });
30
- }
6
+ const handlePinSetup = () => {
7
+ onComplete({ method: 'pin' });
31
8
  };
32
9
 
33
- const handleOthentSetup = () => {
34
- onComplete({ method: 'othent' });
10
+ const handleEmailSetup = () => {
11
+ onComplete({ method: 'email' });
35
12
  };
36
13
 
37
14
  return (
38
- <motion.div
39
- initial={{ opacity: 0, y: 20 }}
40
- animate={{ opacity: 1, y: 0 }}
41
- className="flex flex-col items-center space-y-6 p-6"
42
- >
43
- <h2 className="text-xl font-semibold text-gray-900">Secure Your Account</h2>
44
- <p className="text-gray-600 text-center">
45
- Choose how you want to secure your data
46
- </p>
47
-
48
- {!securityMethod ? (
49
- <div className="grid grid-cols-1 gap-4 w-full max-w-md">
50
- <motion.button
51
- whileHover={{ scale: 1.02 }}
52
- whileTap={{ scale: 0.98 }}
53
- onClick={() => setSecurityMethod('othent')}
54
- className="flex items-center justify-center p-6 rounded-lg border border-gray-300 hover:border-blue-500 bg-white"
55
- >
56
- <img src="https://onairos.sirv.com/Images/othent-icon.png" alt="Othent" className="w-8 h-8 mr-3" />
57
- <span className="text-gray-700">Secure with Google (Othent)</span>
58
- </motion.button>
59
-
60
- <motion.button
61
- whileHover={{ scale: 1.02 }}
62
- whileTap={{ scale: 0.98 }}
63
- onClick={() => setSecurityMethod('pin')}
64
- className="flex items-center justify-center p-6 rounded-lg border border-gray-300 hover:border-blue-500 bg-white"
65
- >
66
- <span className="material-icons mr-3">lock</span>
67
- <span className="text-gray-700">Set up PIN</span>
68
- </motion.button>
69
- </div>
70
- ) : securityMethod === 'pin' ? (
71
- <motion.div
72
- initial={{ opacity: 0 }}
73
- animate={{ opacity: 1 }}
74
- className="w-full max-w-md space-y-4"
15
+ <div className="max-w-md mx-auto bg-white rounded-lg shadow-lg p-6">
16
+ <h2 className="text-2xl font-bold text-center mb-6">Choose Security Method</h2>
17
+
18
+ <div className="space-y-4">
19
+ {/* PIN Security Option */}
20
+ <div
21
+ className={`p-4 border-2 rounded-lg cursor-pointer transition-colors ${
22
+ securityMethod === 'pin'
23
+ ? 'border-blue-500 bg-blue-50'
24
+ : 'border-gray-200 hover:border-gray-300'
25
+ }`}
26
+ onClick={() => setSecurityMethod('pin')}
75
27
  >
76
- <input
77
- type="password"
78
- value={pin}
79
- onChange={(e) => setPin(e.target.value)}
80
- placeholder="Enter your PIN"
81
- className="w-full px-4 py-3 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
82
- />
28
+ <div className="flex items-center">
29
+ <div className="w-8 h-8 mr-3 bg-blue-500 rounded-full flex items-center justify-center">
30
+ <span className="text-white font-bold">🔒</span>
31
+ </div>
32
+ <span className="text-gray-700">Secure with PIN</span>
33
+ </div>
34
+ <p className="text-sm text-gray-500 mt-2 ml-11">
35
+ Create a secure PIN for quick access
36
+ </p>
37
+ </div>
83
38
 
84
- <div className="space-y-2">
85
- {Object.entries(pinRequirements).map(([req, met]) => (
86
- <div key={req} className="flex items-center">
87
- <span className={`material-icons text-sm ${met ? 'text-green-500' : 'text-gray-400'}`}>
88
- {met ? 'check_circle' : 'radio_button_unchecked'}
89
- </span>
90
- <span className={`ml-2 text-sm ${met ? 'text-green-600' : 'text-gray-600'}`}>
91
- {req === 'length' ? 'At least 8 characters' :
92
- req === 'capital' ? 'One capital letter' :
93
- req === 'number' ? 'One number' : 'One special character'}
94
- </span>
95
- </div>
96
- ))}
39
+ {/* Email Security Option */}
40
+ <div
41
+ className={`p-4 border-2 rounded-lg cursor-pointer transition-colors ${
42
+ securityMethod === 'email'
43
+ ? 'border-green-500 bg-green-50'
44
+ : 'border-gray-200 hover:border-gray-300'
45
+ }`}
46
+ onClick={() => setSecurityMethod('email')}
47
+ >
48
+ <div className="flex items-center">
49
+ <div className="w-8 h-8 mr-3 bg-green-500 rounded-full flex items-center justify-center">
50
+ <span className="text-white font-bold">📧</span>
51
+ </div>
52
+ <span className="text-gray-700">Secure with Email</span>
97
53
  </div>
54
+ <p className="text-sm text-gray-500 mt-2 ml-11">
55
+ Use email verification for security
56
+ </p>
57
+ </div>
58
+ </div>
98
59
 
60
+ <div className="mt-6">
61
+ {securityMethod === 'pin' && (
99
62
  <button
100
- onClick={handlePinSubmit}
101
- disabled={!allRequirementsMet}
102
- className={`w-full py-3 px-4 rounded-lg font-semibold ${
103
- allRequirementsMet
104
- ? 'bg-blue-500 text-white hover:bg-blue-600'
105
- : 'bg-gray-300 text-gray-500 cursor-not-allowed'
106
- }`}
63
+ onClick={handlePinSetup}
64
+ className="w-full bg-blue-600 text-white py-3 px-4 rounded-lg hover:bg-blue-700 transition-colors"
107
65
  >
108
- Set PIN
66
+ Continue with PIN
109
67
  </button>
110
- </motion.div>
111
- ) : (
112
- <motion.div
113
- initial={{ opacity: 0 }}
114
- animate={{ opacity: 1 }}
115
- className="w-full max-w-md"
116
- >
68
+ )}
69
+
70
+ {securityMethod === 'email' && (
117
71
  <button
118
- onClick={handleOthentSetup}
119
- className="w-full py-3 px-4 rounded-lg font-semibold bg-blue-500 text-white hover:bg-blue-600"
72
+ onClick={handleEmailSetup}
73
+ className="w-full bg-green-600 text-white py-3 px-4 rounded-lg hover:bg-green-700 transition-colors"
120
74
  >
121
- Continue with Othent
75
+ Continue with Email
122
76
  </button>
123
- </motion.div>
124
- )}
125
- </motion.div>
77
+ )}
78
+ </div>
79
+ </div>
126
80
  );
127
81
  }
package/src/getPin.js CHANGED
@@ -1,23 +1,24 @@
1
- export default async function getPin(hashedOthentSub){
2
- const jsonData = {
3
- Info:
4
- {
5
- 'hashedOthentSub':hashedOthentSub
6
- },
7
- request:'PIN',
8
- }
9
- return await fetch('https://api2.onairos.uk/getAccountInfoFromOthentSub', {
10
- // return await fetch('http://localhost:8080/getAccountInfoFromOthentSub', {
11
- method: 'POST',
12
- headers: {
1
+ export default async function getPin(userSub){
2
+ try {
3
+ const response = await fetch('https://api2.onairos.uk/getAccountInfoFromUserSub', {
4
+ method: 'POST',
5
+ headers: {
13
6
  'Content-Type': 'application/json',
14
- },
15
- body: JSON.stringify(jsonData),
16
- }).then(response => response.json())
17
- .then(data => {
18
- return data;
19
- })
20
- .catch(error => console.error(error));
21
- };
7
+ },
8
+ body: JSON.stringify({
9
+ 'userSub': userSub
10
+ })
11
+ });
12
+
13
+ if (!response.ok) {
14
+ throw new Error(`HTTP error! status: ${response.status}`);
15
+ }
16
+
17
+ return await response.json();
18
+ } catch (error) {
19
+ console.error('Error getting PIN:', error);
20
+ throw error;
21
+ }
22
+ }
22
23
 
23
24
 
@@ -15,7 +15,7 @@ const DataRequestPage = ({ requestData = {}, dataRequester = 'App', proofMode =
15
15
  const [traits, setTraits] = useState(false);
16
16
  const [selectedRequests, setSelectedRequests] = useState({});
17
17
  const selectedConnections = useRef([]);
18
- const hashedOthentSub = useRef(null);
18
+ const userSub = useRef(null);
19
19
  const encryptedUserPin = useRef(null);
20
20
 
21
21
  // Update allowSubmit when granted changes
@@ -56,8 +56,8 @@ const DataRequestPage = ({ requestData = {}, dataRequester = 'App', proofMode =
56
56
  if (event.data.activeModels) {
57
57
  setActiveModels(event.data.activeModels);
58
58
  }
59
- if (event.data.hashedOthentSub) {
60
- hashedOthentSub.current = event.data.hashedOthentSub;
59
+ if (event.data.userSub) {
60
+ userSub.current = event.data.userSub;
61
61
  }
62
62
  if (event.data.encryptedUserPin) {
63
63
  encryptedUserPin.current = event.data.encryptedUserPin;
@@ -80,7 +80,6 @@ const DataRequestPage = ({ requestData = {}, dataRequester = 'App', proofMode =
80
80
  async function rejectDataRequest() {
81
81
  window.top.postMessage({type: 'closeIframe'}, '*');
82
82
  window.postMessage({type: 'closeIframe'}, '*');
83
- // await RejectDataRequest();
84
83
  }
85
84
 
86
85
  /**
@@ -95,15 +94,6 @@ const DataRequestPage = ({ requestData = {}, dataRequester = 'App', proofMode =
95
94
  message: 'Confirm ' + dataRequester + ' Data Access',
96
95
  confirmations: selectedConnections.current
97
96
  };
98
- // console.log("User Granted Data Access : ", selectedConnections.current);
99
-
100
- // Potentially Sign With Othent
101
- // chrome.runtime.sendMessage({
102
- // source: 'dataRequestPage',
103
- // type: 'sign_acccess',
104
- // SignMessage: SignMessage,
105
- // confirmations: selectedConnections.current
106
- // });
107
97
 
108
98
  // Send simplified response
109
99
  try {
@@ -1,27 +1,22 @@
1
1
  import React from 'react';
2
- import { createRoot } from 'react-dom/client';
3
- import DataRequestPage from './DataRequestPage';
2
+ import ReactDOM from 'react-dom/client';
3
+ import DataRequestPage from './DataRequestPage.jsx';
4
4
 
5
- // Initial state - will be updated with data from parent window
6
- let requestData = {};
7
- let dataRequester = 'App';
5
+ // Global variables to store data from parent window
8
6
  let proofMode = false;
9
7
  let domain = '';
10
- let hashedOthentSub = null;
8
+ let userSub = null;
11
9
  let encryptedUserPin = null;
12
10
 
13
11
  // Handle messages from the parent window
14
12
  window.addEventListener('message', (event) => {
15
13
  // Verify the sender origin if needed
16
- // if (event.origin !== "expected-origin") return;
14
+ // if (event.origin !== 'expected-origin') return;
17
15
 
18
- if (event.data && event.data.type === 'initDataRequest') {
19
- // Update state variables
20
- requestData = event.data.requestData || {};
21
- dataRequester = event.data.dataRequester || 'App';
16
+ if (event.data && event.data.source === 'onairosButton') {
22
17
  proofMode = event.data.proofMode || false;
23
18
  domain = event.data.domain || '';
24
- hashedOthentSub = event.data.hashedOthentSub || null;
19
+ userSub = event.data.userSub || null;
25
20
  encryptedUserPin = event.data.encryptedUserPin || null;
26
21
 
27
22
  // Re-render with the new data
@@ -30,23 +25,21 @@ window.addEventListener('message', (event) => {
30
25
  });
31
26
 
32
27
  // Notify the parent window that the iframe is ready
33
- window.parent.postMessage(
34
- { source: 'onairosIframe', action: 'iframeReady' },
35
- '*'
36
- );
28
+ window.parent.postMessage({
29
+ source: 'onairosIframe',
30
+ action: 'iframeReady'
31
+ }, '*');
37
32
 
38
- // Render the React component
33
+ // Function to render the React app
39
34
  function renderApp() {
40
- const root = createRoot(document.getElementById('root'));
35
+ const root = ReactDOM.createRoot(document.getElementById('root'));
41
36
  root.render(
42
- <React.StrictMode>
43
- <DataRequestPage
44
- requestData={requestData}
45
- dataRequester={dataRequester}
46
- proofMode={proofMode}
47
- domain={domain}
48
- />
49
- </React.StrictMode>
37
+ <DataRequestPage
38
+ proofMode={proofMode}
39
+ domain={domain}
40
+ userSub={userSub}
41
+ encryptedUserPin={encryptedUserPin}
42
+ />
50
43
  );
51
44
  }
52
45