onairos 2.3.1 → 3.1.10

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,217 @@
1
+ # Tailwind CSS v4.1.11 Upgrade Guide
2
+
3
+ ## Overview
4
+
5
+ The Onairos SDK has been successfully upgraded to Tailwind CSS v4.1.11, bringing significant performance improvements and modern CSS features.
6
+
7
+ ## Key Improvements
8
+
9
+ ### 🚀 Performance Gains
10
+ - **3.5x faster** full builds
11
+ - **8x faster** incremental builds with new CSS
12
+ - **100x faster** incremental builds with no new CSS (measured in microseconds!)
13
+
14
+ ### 🎨 New Features
15
+ - **Text Shadows**: New `text-shadow-*` utilities with color support
16
+ - **Mask Utilities**: Composable `mask-*` utilities for complex effects
17
+ - **Container Queries**: Built-in `@container` and responsive variants
18
+ - **3D Transforms**: Native `rotate-x-*`, `rotate-y-*`, `scale-z-*` utilities
19
+ - **Enhanced Gradients**: Angle support, conic/radial gradients, color interpolation
20
+ - **Dynamic Utilities**: No configuration needed for arbitrary grid columns, spacing values
21
+ - **Safe Alignment**: `justify-center-safe` prevents content from being clipped
22
+
23
+ ## Configuration Changes
24
+
25
+ ### Old Configuration (v3)
26
+ ```javascript
27
+ // tailwind.config.js
28
+ module.exports = {
29
+ theme: {
30
+ extend: {
31
+ colors: {
32
+ 'onairos-primary': '#3B82F6'
33
+ }
34
+ }
35
+ }
36
+ }
37
+ ```
38
+
39
+ ### New Configuration (v4)
40
+ ```css
41
+ /* src/styles/tailwind.css */
42
+ @import "tailwindcss";
43
+
44
+ @theme {
45
+ --color-onairos-primary: #3B82F6;
46
+ --color-onairos-secondary: #1E40AF;
47
+ --color-onairos-accent: #06B6D4;
48
+ }
49
+ ```
50
+
51
+ ## Build Configuration
52
+
53
+ ### PostCSS Setup
54
+ ```javascript
55
+ // postcss.config.js
56
+ export default {
57
+ plugins: {
58
+ '@tailwindcss/postcss': {},
59
+ },
60
+ };
61
+ ```
62
+
63
+ ### Webpack Integration
64
+ The webpack configuration has been updated to:
65
+ - Process CSS files with PostCSS and Tailwind v4
66
+ - Extract CSS into separate files for production
67
+ - Support both development and production builds
68
+
69
+ ## Custom Utilities
70
+
71
+ New custom utilities have been created for the Onairos SDK:
72
+
73
+ ```css
74
+ @utility btn-onairos {
75
+ display: inline-flex;
76
+ align-items: center;
77
+ justify-content: center;
78
+ border-radius: 0.5rem;
79
+ padding: 0.5rem 1rem;
80
+ font-weight: 600;
81
+ transition: all 0.2s ease-in-out;
82
+ background-color: var(--color-onairos-primary);
83
+ color: white;
84
+ }
85
+
86
+ @utility card-onairos {
87
+ background-color: white;
88
+ border-radius: 0.75rem;
89
+ box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
90
+ padding: 1.5rem;
91
+ border: 1px solid rgb(229 231 235);
92
+ }
93
+
94
+ @utility loading-spinner {
95
+ /* Animated loading spinner */
96
+ }
97
+ ```
98
+
99
+ ## Migration Changes Made
100
+
101
+ ### Updated Gradient Classes
102
+ - `bg-gradient-to-r` → `bg-linear-to-r`
103
+ - `bg-gradient-to-tr` → `bg-linear-to-tr`
104
+ - `bg-gradient-to-br` → `bg-linear-to-br`
105
+
106
+ ### Package Dependencies
107
+ - Updated `tailwindcss` from `^3.3.5` to `^4.1.11`
108
+ - Added `@tailwindcss/postcss` for v4 PostCSS integration
109
+ - Added CSS processing dependencies (`css-loader`, `style-loader`, `postcss-loader`)
110
+ - Added `mini-css-extract-plugin` for production CSS extraction
111
+
112
+ ## New Features Examples
113
+
114
+ ### Container Queries
115
+ ```html
116
+ <div class="@container">
117
+ <div class="grid grid-cols-1 @sm:grid-cols-3 @lg:grid-cols-4">
118
+ <!-- Responsive based on container, not viewport -->
119
+ </div>
120
+ </div>
121
+ ```
122
+
123
+ ### Text Shadows
124
+ ```html
125
+ <h1 class="text-shadow-lg text-shadow-blue-500/50">
126
+ Colored text shadow
127
+ </h1>
128
+ ```
129
+
130
+ ### Dynamic Grid Columns
131
+ ```html
132
+ <!-- No configuration needed -->
133
+ <div class="grid grid-cols-7 gap-2">
134
+ <!-- 7 columns just work -->
135
+ </div>
136
+ ```
137
+
138
+ ### 3D Transforms
139
+ ```html
140
+ <div class="perspective-distant">
141
+ <div class="rotate-x-45 rotate-y-30 transform-3d">
142
+ 3D transformed element
143
+ </div>
144
+ </div>
145
+ ```
146
+
147
+ ### Enhanced Gradients
148
+ ```html
149
+ <!-- 45-degree linear gradient -->
150
+ <div class="bg-linear-45 from-pink-500 to-orange-500"></div>
151
+
152
+ <!-- Radial gradient with position -->
153
+ <div class="bg-radial-[at_30%_30%] from-cyan-500 to-blue-600"></div>
154
+
155
+ <!-- Conic gradient -->
156
+ <div class="bg-conic from-red-500 via-yellow-500 to-blue-500"></div>
157
+ ```
158
+
159
+ ## CSS Variables Access
160
+
161
+ All theme values are now available as CSS variables:
162
+
163
+ ```css
164
+ .custom-component {
165
+ background-color: var(--color-onairos-primary);
166
+ font-family: var(--font-display);
167
+ border-radius: var(--spacing);
168
+ }
169
+ ```
170
+
171
+ ## Testing
172
+
173
+ A new test file `test-tailwind-v4.html` has been created to showcase all the new features and verify the upgrade works correctly.
174
+
175
+ ## Building the Project
176
+
177
+ ```bash
178
+ # Install dependencies
179
+ npm install
180
+
181
+ # Development build
182
+ npm run dev
183
+
184
+ # Production build
185
+ npm run build
186
+ ```
187
+
188
+ ## Browser Support
189
+
190
+ Tailwind CSS v4.1.11 requires:
191
+ - Safari 16.4+
192
+ - Chrome 111+
193
+ - Firefox 128+
194
+
195
+ For older browser support, consider staying with v3.4 or using a compatibility layer.
196
+
197
+ ## Performance Benefits
198
+
199
+ The upgrade brings substantial performance improvements:
200
+ - Faster development builds
201
+ - Reduced CSS bundle size
202
+ - Better tree-shaking
203
+ - Modern CSS features that reduce JavaScript overhead
204
+
205
+ ## Next Steps
206
+
207
+ 1. Test all components thoroughly
208
+ 2. Update any remaining v3 syntax
209
+ 3. Explore new v4 features in component designs
210
+ 4. Consider using CSS variables for runtime theming
211
+ 5. Update documentation and examples
212
+
213
+ ## Resources
214
+
215
+ - [Tailwind CSS v4.0 Documentation](https://tailwindcss.com/docs)
216
+ - [Migration Guide](https://tailwindcss.com/docs/upgrade-guide)
217
+ - [New Features Blog Post](https://tailwindcss.com/blog/tailwindcss-v4)
package/dist/294.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";(this.webpackChunkOnairosLaravel=this.webpackChunkOnairosLaravel||[]).push([[294],{408:(e,t)=>{var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),i=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),y=Symbol.iterator;var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,_={};function v(e,t,r){this.props=e,this.context=t,this.refs=_,this.updater=r||d}function b(){}function m(e,t,r){this.props=e,this.context=t,this.refs=_,this.updater=r||d}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=v.prototype;var S=m.prototype=new b;S.constructor=m,h(S,v.prototype),S.isPureReactComponent=!0;var k=Array.isArray,w=Object.prototype.hasOwnProperty,E={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function R(e,t,n){var o,u={},a=null,c=null;if(null!=t)for(o in void 0!==t.ref&&(c=t.ref),void 0!==t.key&&(a=""+t.key),t)w.call(t,o)&&!$.hasOwnProperty(o)&&(u[o]=t[o]);var i=arguments.length-2;if(1===i)u.children=n;else if(1<i){for(var f=Array(i),s=0;s<i;s++)f[s]=arguments[s+2];u.children=f}if(e&&e.defaultProps)for(o in i=e.defaultProps)void 0===u[o]&&(u[o]=i[o]);return{$$typeof:r,type:e,key:a,ref:c,props:u,_owner:E.current}}function C(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var g=/\/+/g;function j(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function O(e,t,o,u,a){var c=typeof e;"undefined"!==c&&"boolean"!==c||(e=null);var i=!1;if(null===e)i=!0;else switch(c){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case r:case n:i=!0}}if(i)return a=a(i=e),e=""===u?"."+j(i,0):u,k(a)?(o="",null!=e&&(o=e.replace(g,"$&/")+"/"),O(a,t,o,"",(function(e){return e}))):null!=a&&(C(a)&&(a=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,o+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(g,"$&/")+"/")+e)),t.push(a)),1;if(i=0,u=""===u?".":u+":",k(e))for(var f=0;f<e.length;f++){var s=u+j(c=e[f],f);i+=O(c,t,o,s,a)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=y&&e[y]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),f=0;!(c=e.next()).done;)i+=O(c=c.value,t,o,s=u+j(c,f++),a);else if("object"===c)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function x(e,t,r){if(null==e)return e;var n=[],o=0;return O(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function P(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var I={current:null},L={transition:null},T={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:L,ReactCurrentOwner:E};function V(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:x,forEach:function(e,t,r){x(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return x(e,(function(){t++})),t},toArray:function(e){return x(e,(function(e){return e}))||[]},only:function(e){if(!C(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=o,t.Profiler=a,t.PureComponent=m,t.StrictMode=u,t.Suspense=s,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T,t.act=V,t.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=h({},e.props),u=e.key,a=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,c=E.current),void 0!==t.key&&(u=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(f in t)w.call(t,f)&&!$.hasOwnProperty(f)&&(o[f]=void 0===t[f]&&void 0!==i?i[f]:t[f])}var f=arguments.length-2;if(1===f)o.children=n;else if(1<f){i=Array(f);for(var s=0;s<f;s++)i[s]=arguments[s+2];o.children=i}return{$$typeof:r,type:e.type,key:u,ref:a,props:o,_owner:c}},t.createContext=function(e){return(e={$$typeof:i,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},t.createElement=R,t.createFactory=function(e){var t=R.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:f,render:e}},t.isValidElement=C,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:P}},t.memo=function(e,t){return{$$typeof:l,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=L.transition;L.transition={};try{e()}finally{L.transition=t}},t.unstable_act=V,t.useCallback=function(e,t){return I.current.useCallback(e,t)},t.useContext=function(e){return I.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return I.current.useDeferredValue(e)},t.useEffect=function(e,t){return I.current.useEffect(e,t)},t.useId=function(){return I.current.useId()},t.useImperativeHandle=function(e,t,r){return I.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return I.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return I.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return I.current.useMemo(e,t)},t.useReducer=function(e,t,r){return I.current.useReducer(e,t,r)},t.useRef=function(e){return I.current.useRef(e)},t.useState=function(e){return I.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return I.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return I.current.useTransition()},t.version="18.3.1"},294:(e,t,r)=>{e.exports=r(408)}}]);
2
+ //# sourceMappingURL=294.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"294.js","mappings":"4GASa,IAAIA,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,gBAAgBE,EAAEH,OAAOC,IAAI,kBAAkBG,EAAEJ,OAAOC,IAAI,qBAAqBI,EAAEL,OAAOC,IAAI,kBAAkBK,EAAEN,OAAOC,IAAI,kBAAkBM,EAAEP,OAAOC,IAAI,iBAAiBO,EAAER,OAAOC,IAAI,qBAAqBQ,EAAET,OAAOC,IAAI,kBAAkBS,EAAEV,OAAOC,IAAI,cAAcU,EAAEX,OAAOC,IAAI,cAAcW,EAAEZ,OAAOa,SACzW,IAAIC,EAAE,CAACC,UAAU,WAAW,OAAM,CAAE,EAAEC,mBAAmB,WAAW,EAAEC,oBAAoB,WAAW,EAAEC,gBAAgB,WAAW,GAAGC,EAAEC,OAAOC,OAAOC,EAAE,CAAC,EAAE,SAASC,EAAEC,EAAEC,EAAEC,GAAGC,KAAKC,MAAMJ,EAAEG,KAAKE,QAAQJ,EAAEE,KAAKG,KAAKR,EAAEK,KAAKI,QAAQL,GAAGZ,CAAC,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AiBvH,EAAE,EAAE4E,EAAQ4C,UAAU,SAASxH,EAAEC,GAAG,OAAOmE,EAAE5C,QAAQgG,UAAUxH,EAAEC,EAAE,EAAE2E,EAAQ6C,MAAM,WAAW,OAAOrD,EAAE5C,QAAQiG,OAAO,EAAE7C,EAAQ8C,oBAAoB,SAAS1H,EAAEC,EAAEC,GAAG,OAAOkE,EAAE5C,QAAQkG,oBAAoB1H,EAAEC,EAAEC,EAAE,EAAE0E,EAAQ+C,mBAAmB,SAAS3H,EAAEC,GAAG,OAAOmE,EAAE5C,QAAQmG,mBAAmB3H,EAAEC,EAAE,EAAE2E,EAAQgD,gBAAgB,SAAS5H,EAAEC,GAAG,OAAOmE,EAAE5C,QAAQoG,gBAAgB5H,EAAEC,EAAE,EACzd2E,EAAQiD,QAAQ,SAAS7H,EAAEC,GAAG,OAAOmE,EAAE5C,QAAQqG,QAAQ7H,EAAEC,EAAE,EAAE2E,EAAQkD,WAAW,SAAS9H,EAAEC,EAAEC,GAAG,OAAOkE,EAAE5C,QAAQsG,WAAW9H,EAAEC,EAAEC,EAAE,EAAE0E,EAAQmD,OAAO,SAAS/H,GAAG,OAAOoE,EAAE5C,QAAQuG,OAAO/H,EAAE,EAAE4E,EAAQoD,SAAS,SAAShI,GAAG,OAAOoE,EAAE5C,QAAQwG,SAAShI,EAAE,EAAE4E,EAAQqD,qBAAqB,SAASjI,EAAEC,EAAEC,GAAG,OAAOkE,EAAE5C,QAAQyG,qBAAqBjI,EAAEC,EAAEC,EAAE,EAAE0E,EAAQsD,cAAc,WAAW,OAAO9D,EAAE5C,QAAQ0G,eAAe,EAAEtD,EAAQuD,QAAQ,Q,gBCtBlaC,EAAOxD,QAAU,EAAjB,I","sources":["webpack://OnairosLaravel/./node_modules/react/cjs/react.production.min.js","webpack://OnairosLaravel/./node_modules/react/index.js"],"sourcesContent":["/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}\nfunction N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\\/+/g;function Q(a,b){return\"object\"===typeof a&&null!==a&&null!=a.key?escape(\"\"+a.key):b.toString(36)}\nfunction R(a,b,e,d,c){var k=typeof a;if(\"undefined\"===k||\"boolean\"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case \"string\":case \"number\":h=!0;break;case \"object\":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=\"\"===d?\".\"+Q(h,0):d,I(c)?(e=\"\",null!=a&&(e=a.replace(P,\"$&/\")+\"/\"),R(c,b,e,\"\",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?\"\":(\"\"+c.key).replace(P,\"$&/\")+\"/\")+a)),b.push(c)),1;h=0;d=\"\"===d?\".\":d+\":\";if(I(a))for(var g=0;g<a.length;g++){k=\na[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),\"function\"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if(\"object\"===k)throw b=String(a),Error(\"Objects are not valid as a React child (found: \"+(\"[object Object]\"===b?\"object with keys {\"+Object.keys(a).join(\", \")+\"}\":b)+\"). If you meant to render a collection of children, use an array instead.\");return h}\nfunction S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,\"\",\"\",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}\nvar U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};function X(){throw Error(\"act(...) is not supported in production builds of React.\");}\nexports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error(\"React.Children.only expected to receive a single React element child.\");return a}};exports.Component=E;exports.Fragment=p;exports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;exports.act=X;\nexports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+a+\".\");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=\"\"+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);\nfor(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};\nexports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=X;exports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};\nexports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};exports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};\nexports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};exports.useTransition=function(){return U.current.useTransition()};exports.version=\"18.3.1\";\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n"],"names":["l","Symbol","for","n","p","q","r","t","u","v","w","x","y","z","iterator","B","isMounted","enqueueForceUpdate","enqueueReplaceState","enqueueSetState","C","Object","assign","D","E","a","b","e","this","props","context","refs","updater","F","G","prototype","isReactComponent","setState","Error","forceUpdate","H","constructor","isPureReactComponent","I","Array","isArray","J","hasOwnProperty","K","current","L","key","ref","__self","__source","M","d","c","k","h","call","g","arguments","length","children","f","m","defaultProps","$$typeof","type","_owner","O","P","Q","replace","escape","toString","R","N","push","A","next","done","value","String","keys","join","S","T","_status","_result","then","default","U","V","transition","W","ReactCurrentDispatcher","ReactCurrentBatchConfig","ReactCurrentOwner","X","exports","Children","map","forEach","apply","count","toArray","only","Component","Fragment","Profiler","PureComponent","StrictMode","Suspense","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","act","cloneElement","createContext","_currentValue","_currentValue2","_threadCount","Provider","Consumer","_defaultValue","_globalName","_context","createElement","createFactory","bind","createRef","forwardRef","render","isValidElement","lazy","_payload","_init","memo","compare","startTransition","unstable_act","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useSyncExternalStore","useTransition","version","module"],"sourceRoot":""}
package/dist/433.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";(this.webpackChunkOnairosLaravel=this.webpackChunkOnairosLaravel||[]).push([[433,294],{433:(e,t,r)=>{r.d(t,{OnairosButton:()=>I});var n=r(294);const o=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,((e,t,r)=>r?r.toUpperCase():t.toLowerCase())))(e);return t.charAt(0).toUpperCase()+t.slice(1)},a=(...e)=>e.filter(((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t)).join(" ").trim(),l=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};var c={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const s=(0,n.forwardRef)((({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:s="",children:i,iconNode:u,...m},d)=>(0,n.createElement)("svg",{ref:d,...c,width:t,height:t,stroke:e,strokeWidth:o?24*Number(r)/Number(t):r,className:a("lucide",s),...!i&&!l(m)&&{"aria-hidden":"true"},...m},[...u.map((([e,t])=>(0,n.createElement)(e,t))),...Array.isArray(i)?i:[i]]))),i=(e,t)=>{const r=(0,n.forwardRef)((({className:r,...l},c)=>{return(0,n.createElement)(s,{ref:c,iconNode:t,className:a(`lucide-${i=o(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...l});var i}));return r.displayName=o(e),r},u=i("mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),m=i("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),d=i("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);function p(e){let{onSuccess:t,testMode:r=!0}=e;const[o,a]=(0,n.useState)(""),[l,c]=(0,n.useState)(""),[s,i]=(0,n.useState)("email"),[p,f]=(0,n.useState)(!1),[g,b]=(0,n.useState)(""),y=async e=>{if(e.preventDefault(),b(""),(e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))(o)){f(!0);try{if(r)setTimeout((()=>{i("code"),f(!1)}),1e3);else{if(!(await fetch("https://api2.onairos.uk/email/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o})})).ok)throw new Error("Failed to send verification code");i("code"),f(!1)}}catch(e){b(e.message),f(!1)}}else b("Please enter a valid email address")},h=async e=>{if(e.preventDefault(),b(""),r&&"123456"===l)return i("success"),void setTimeout((()=>{t({email:o,verified:!0})}),1e3);if(r)b("Invalid code. Use 123456 for testing.");else{f(!0);try{const e=await fetch("https://api2.onairos.uk/email/verify/confirm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:o,code:l})});if(!e.ok)throw new Error("Invalid verification code");const r=await e.json();i("success"),setTimeout((()=>{t({email:o,verified:!0,token:r.token})}),1e3)}catch(e){b(e.message),f(!1)}}};return n.createElement("div",{className:"flex flex-col items-center space-y-6 p-6 w-full"},"email"===s&&n.createElement("div",{className:"flex flex-col items-center space-y-6 w-full"},n.createElement("div",{className:"flex items-center justify-center w-16 h-16 bg-blue-100 rounded-full"},n.createElement(u,{className:"w-8 h-8 text-blue-600"})),n.createElement("div",{className:"text-center"},n.createElement("h2",{className:"text-xl font-semibold text-gray-900 mb-2"},"Sign in to Onairos"),n.createElement("p",{className:"text-gray-600"},"Enter your email address to continue"),r&&n.createElement("p",{className:"text-sm text-blue-600 mt-2"},"Test mode: Any valid email will work")),n.createElement("form",{onSubmit:y,className:"w-full max-w-md space-y-4"},n.createElement("div",null,n.createElement("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1"},"Email address"),n.createElement("input",{type:"email",id:"email",value:o,onChange:e=>a(e.target.value),placeholder:"Enter your email",className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none",required:!0})),g&&n.createElement("p",{className:"text-sm text-red-600"},g),n.createElement("button",{type:"submit",disabled:p,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"},p?n.createElement("div",{className:"animate-spin h-5 w-5 border-2 border-white rounded-full border-t-transparent"}):n.createElement(n.Fragment,null,"Continue",n.createElement(m,{className:"ml-2 w-4 h-4"}))))),"code"===s&&n.createElement("div",{className:"flex flex-col items-center space-y-6 w-full"},n.createElement("div",{className:"flex items-center justify-center w-16 h-16 bg-green-100 rounded-full"},n.createElement(u,{className:"w-8 h-8 text-green-600"})),n.createElement("div",{className:"text-center"},n.createElement("h2",{className:"text-xl font-semibold text-gray-900 mb-2"},"Check your email"),n.createElement("p",{className:"text-gray-600"},"We sent a verification code to"),n.createElement("p",{className:"text-gray-900 font-medium"},o),r&&n.createElement("p",{className:"text-sm text-blue-600 mt-2"},"Test mode: Use code 123456")),n.createElement("form",{onSubmit:h,className:"w-full max-w-md space-y-4"},n.createElement("div",null,n.createElement("label",{htmlFor:"code",className:"block text-sm font-medium text-gray-700 mb-1"},"Verification code"),n.createElement("input",{type:"text",id:"code",value:l,onChange:e=>c(e.target.value),placeholder:"Enter 6-digit code",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",maxLength:"6",required:!0})),g&&n.createElement("p",{className:"text-sm text-red-600"},g),n.createElement("button",{type:"submit",disabled:p,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"},p?n.createElement("div",{className:"animate-spin h-5 w-5 border-2 border-white rounded-full border-t-transparent"}):"Verify Code"),n.createElement("button",{type:"button",onClick:()=>i("email"),className:"w-full py-2 px-4 text-gray-600 hover:text-gray-800"},"Use a different email"))),"success"===s&&n.createElement("div",{className:"flex flex-col items-center space-y-6 w-full"},n.createElement("div",{className:"flex items-center justify-center w-16 h-16 bg-green-100 rounded-full"},n.createElement(d,{className:"w-8 h-8 text-green-600"})),n.createElement("div",{className:"text-center"},n.createElement("h2",{className:"text-xl font-semibold text-gray-900 mb-2"},"Email verified!"),n.createElement("p",{className:"text-gray-600"},"Setting up your account...")),n.createElement("div",{className:"w-8 h-8"},n.createElement("div",{className:"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent"}))))}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){b(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const y=[{name:"YouTube",icon:"📺",color:"bg-red-500",connector:"youtube"},{name:"LinkedIn",icon:"💼",color:"bg-blue-700",connector:"linkedin"},{name:"Reddit",icon:"🔥",color:"bg-orange-500",connector:"reddit"},{name:"Pinterest",icon:"📌",color:"bg-red-600",connector:"pinterest"},{name:"Instagram",icon:"📷",color:"bg-pink-500",connector:"instagram"},{name:"GitHub",icon:"⚡",color:"bg-gray-800",connector:"github"},{name:"Facebook",icon:"👥",color:"bg-blue-600",connector:"facebook"},{name:"Gmail",icon:"✉️",color:"bg-red-400",connector:"gmail"}],h={apiKey:process.env.REACT_APP_ONAIROS_API_KEY||"onairos_web_sdk_live_key_2024",baseUrl:process.env.REACT_APP_ONAIROS_BASE_URL||"https://api2.onairos.uk",sdkType:"web",enableHealthMonitoring:!0,enableAutoRefresh:!0,enableConnectionValidation:!0};function v(e){let{onComplete:t,appIcon:r,appName:o="App"}=e;const[a,l]=(0,n.useState)({}),[c,s]=(0,n.useState)(!1),[i,u]=(0,n.useState)(null),[m,d]=(0,n.useState)({}),[p,f]=(0,n.useState)({}),[b,v]=(0,n.useState)(0);(0,n.useEffect)((()=>{(()=>{const e=localStorage.getItem("onairos_oauth_platform");e&&(console.log("📱 OAuth return detected for: ".concat(e)),localStorage.removeItem("onairos_oauth_platform"),localStorage.removeItem("onairos_oauth_return"),l((t=>g(g({},t),{},{[e]:!0}))),d((t=>g(g({},t),{},{[e]:null}))),console.log("✅ ".concat(e," marked as connected from OAuth return")))})()}),[]);const x=async e=>{console.log("🚀 connectToPlatform called for: ".concat(e));const t=y.find((t=>t.name===e));if(null==t||!t.connector)return console.error("❌ No connector found for platform: ".concat(e)),!1;try{var r;s(!0),u(e),d((t=>g(g({},t),{},{[e]:null}))),console.log("🔗 Starting OAuth connection for ".concat(e,"..."));const n=localStorage.getItem("username")||(null===(r=localStorage.getItem("onairosUser"))||void 0===r?void 0:r.email)||"user@example.com",o="".concat(h.baseUrl,"/").concat(t.connector,"/authorize"),a=await fetch(o,{method:"POST",headers:{"x-api-key":h.apiKey,"Content-Type":"application/json"},body:JSON.stringify({session:{username:n}})});if(!a.ok)throw new Error("HTTP ".concat(a.status,": ").concat(a.statusText));const c=await a.json();console.log("📋 ".concat(e," OAuth response:"),c);const i={youtube:["youtubeURL","youtubeUrl","youtube_url"],linkedin:["linkedinURL","linkedinUrl","linkedin_url"],reddit:["redditURL","redditUrl","reddit_url"],pinterest:["pinterestURL","pinterestUrl","pinterest_url"],instagram:["instagramURL","instagramUrl","instagram_url"],github:["githubURL","githubUrl","github_url"],facebook:["facebookURL","facebookUrl","facebook_url"],gmail:["gmailURL","gmailUrl","gmail_url"]}[t.connector]||["".concat(t.connector,"URL"),"".concat(t.connector,"Url"),"".concat(t.connector,"_url"),"platformURL","authUrl","url"];let m=null,p=null;for(const e of i)if(c[e]){m=c[e],p=e;break}if(!m)throw console.error("❌ No OAuth URL found for ".concat(e,":")),console.error("Expected one of:",i),console.error("Response keys:",Object.keys(c)),console.error("Full response:",c),new Error("No OAuth URL found. Backend should return one of: ".concat(i.join(", ")));if(console.log("✅ Found OAuth URL for ".concat(e," using key: ").concat(p)),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=768)return localStorage.setItem("onairos_oauth_platform",e),localStorage.setItem("onairos_oauth_return",window.location.href),window.location.href=m,!0;{const r=window.open(m,"".concat(t.connector,"_oauth"),"width=500,height=600,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no");if(!r)throw new Error("Popup blocked. Please allow popups and try again.");let n=!1;const o=setInterval((()=>{try{if(r.location&&"onairos.uk"===r.location.hostname)return n=!0,console.log("🔄 ".concat(e," popup navigated to onairos.uk - treating as success")),void r.close()}catch(t){n||(n=!0,console.log("🔄 ".concat(e," popup navigated (cross-origin) - likely to onairos.uk")))}try{if(r.closed){clearInterval(o);const t=localStorage.getItem("onairos_".concat(e,"_success")),r=localStorage.getItem("onairos_".concat(e,"_error")),a=localStorage.getItem("onairos_".concat(e,"_timestamp")),c=a&&Date.now()-parseInt(a)<3e4;t&&c?(console.log("✅ ".concat(e," OAuth completed successfully (callback page)")),localStorage.removeItem("onairos_".concat(e,"_success")),localStorage.removeItem("onairos_".concat(e,"_timestamp")),l((t=>g(g({},t),{},{[e]:!0}))),d((t=>g(g({},t),{},{[e]:null})))):r&&c?(console.log("❌ ".concat(e," OAuth failed:"),r),localStorage.removeItem("onairos_".concat(e,"_error")),localStorage.removeItem("onairos_".concat(e,"_timestamp")),d((t=>g(g({},t),{},{[e]:r})))):n?(console.log("✅ ".concat(e," OAuth likely successful (navigated to onairos.uk)")),l((t=>g(g({},t),{},{[e]:!0}))),d((t=>g(g({},t),{},{[e]:null})))):(console.log("⚠️ ".concat(e," OAuth cancelled or no response")),d((t=>g(g({},t),{},{[e]:"Connection was cancelled"})))),s(!1),u(null)}}catch(e){}}),1e3);return setTimeout((()=>{try{!r.closed&&r.location&&"onairos.uk"===r.location.hostname&&(console.log("🚪 Auto-closing ".concat(e," popup showing onairos.uk (not found)")),r.close())}catch(t){!r.closed&&n&&(console.log("🚪 Auto-closing ".concat(e," popup (cross-origin, likely onairos.uk)")),r.close())}}),1e4),setTimeout((()=>{r.closed||(r.close(),clearInterval(o),d((t=>g(g({},t),{},{[e]:"Connection timeout"}))),s(!1),u(null))}),3e5),!0}}catch(t){return console.error("❌ Error connecting to ".concat(e,":"),t),d((r=>g(g({},r),{},{[e]:t.message}))),s(!1),u(null),!1}},w=Object.values(a).filter(Boolean).length;return n.createElement("div",{className:"max-w-sm mx-auto bg-white p-4 rounded-lg shadow-lg"},n.createElement("div",{className:"flex items-center justify-center mb-4"},n.createElement("div",{className:"flex items-center space-x-2"},n.createElement("img",{src:r||"https://onairos.sirv.com/Images/OnairosBlack.png",alt:o,className:"w-8 h-8 rounded-lg"}),n.createElement("div",{className:"flex items-center text-gray-400"},n.createElement("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 8l4 4m0 0l-4 4m4-4H3"}))),n.createElement("img",{src:"https://onairos.sirv.com/Images/OnairosBlack.png",alt:"Onairos",className:"w-8 h-8 rounded-lg"}))),n.createElement("div",{className:"text-center mb-4"},n.createElement("h2",{className:"text-lg font-bold text-gray-900 mb-1"},"Connect Data"),n.createElement("p",{className:"text-gray-600 text-sm"},"Connect data here to enhance your ",o," experience")),n.createElement("div",{className:"grid grid-cols-2 gap-3 mb-4"},y.map((e=>{const t=a[e.name]||!1,r=i===e.name,o=m[e.name],s=c&&!r;return n.createElement("div",{key:e.name,className:"relative p-3 border-2 rounded-lg transition-all duration-200 cursor-pointer ".concat(s?"opacity-50 cursor-not-allowed":"hover:shadow-md"," ").concat(t?"border-green-400 bg-green-50":o?"border-red-400 bg-red-50":r?"border-blue-400 bg-blue-50":"border-gray-200 bg-white hover:border-gray-300"),onClick:()=>!s&&(async e=>{if(console.log("🔥 TOGGLE CLICKED: ".concat(e)),c&&i!==e)return void console.log("⚠️ Already connecting to ".concat(i,", ignoring click on ").concat(e));a[e]?(console.log("🔌 Disconnecting from ".concat(e,"...")),l((t=>g(g({},t),{},{[e]:!1}))),d((t=>g(g({},t),{},{[e]:null})))):await x(e)})(e.name)},n.createElement("div",{className:"w-8 h-8 rounded-lg ".concat(e.color," flex items-center justify-center text-white text-lg mb-2 mx-auto relative")},r?n.createElement("div",{className:"animate-spin h-4 w-4 border-2 border-white rounded-full border-t-transparent"}):e.icon,t&&!r&&n.createElement("div",{className:"absolute -top-1 -right-1 w-4 h-4 bg-green-500 rounded-full flex items-center justify-center"},n.createElement("svg",{className:"w-2.5 h-2.5 text-white",fill:"currentColor",viewBox:"0 0 20 20"},n.createElement("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"}))),o&&!r&&n.createElement("div",{className:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 rounded-full flex items-center justify-center"},n.createElement("svg",{className:"w-2.5 h-2.5 text-white",fill:"currentColor",viewBox:"0 0 20 20"},n.createElement("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})))),n.createElement("div",{className:"text-center"},n.createElement("h3",{className:"font-medium text-gray-900 text-xs"},e.name),n.createElement("p",{className:"text-xs mt-1 ".concat(r?"text-blue-600":t?"text-green-600":o?"text-red-600":"text-gray-500")},r?"Connecting...":t?"Connected":o?"Failed":"Tap to connect"),o&&n.createElement("p",{className:"text-xs text-red-600 mt-1 break-words"},o)))}))),w>0&&n.createElement("div",{className:"mb-4 p-2 bg-green-50 border border-green-200 rounded-lg"},n.createElement("p",{className:"text-green-800 text-sm text-center"},"✅ ",w," connection",w>1?"s":""," active")),n.createElement("button",{onClick:()=>{const e=Object.entries(a).filter((e=>{let[t,r]=e;return r})).map((e=>{let[t]=e;return t}));t({connectedAccounts:e,totalConnections:e.length,healthScore:b,connectionHealth:p,sdkVersion:"2.1.7",enhancedFeatures:{healthMonitoring:h.enableHealthMonitoring,autoRefresh:h.enableAutoRefresh,connectionValidation:h.enableConnectionValidation}})},disabled:0===w,className:"w-full py-3 px-4 rounded-lg font-semibold transition-colors ".concat(w>0?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-300 text-gray-500 cursor-not-allowed")},w>0?"Continue with ".concat(w," connection").concat(w>1?"s":""):"Connect at least one platform"),n.createElement("button",{onClick:()=>t({connectedAccounts:[],totalConnections:0}),className:"w-full mt-2 py-2 text-gray-500 hover:text-gray-700 text-sm"},"Skip for now"))}function x(e){let{onComplete:t,userEmail:r}=e;const[o,a]=(0,n.useState)(""),[l,c]=(0,n.useState)({length:!1,number:!1,special:!1});(0,n.useEffect)((()=>{c({length:o.length>=8,number:/[0-9]/.test(o),special:/[!@#$%^&*(),.?":{}|<>]/.test(o)})}),[o]);const s=Object.values(l).every((e=>e))&&o.length>0;return n.createElement("div",{className:"max-w-md mx-auto bg-white p-6"},n.createElement("div",{className:"text-center mb-6"},n.createElement("div",{className:"w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4"},n.createElement("svg",{className:"w-8 h-8 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-1a2 2 0 00-2-2H6a2 2 0 00-2 2v1a2 2 0 002 2zM12 7V3m0 4l3-3m-3 3L9 4"}))),n.createElement("h2",{className:"text-2xl font-bold text-gray-900 mb-2"},"Create Your Secure PIN"),n.createElement("p",{className:"text-gray-600"},"Your PIN will be used to securely access your data")),n.createElement("form",{onSubmit:e=>{e.preventDefault(),s&&t({pin:o,pinCreated:!0,timestamp:(new Date).toISOString()})},className:"space-y-4"},n.createElement("div",null,n.createElement("label",{htmlFor:"pin",className:"block text-sm font-medium text-gray-700 mb-2"},"Create PIN"),n.createElement("input",{type:"password",id:"pin",value:o,onChange:e=>a(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Enter your secure PIN"})),n.createElement("div",{className:"bg-gray-50 p-4 rounded-lg"},n.createElement("h4",{className:"text-sm font-medium text-gray-700 mb-3"},"PIN Requirements:"),n.createElement("div",{className:"space-y-2"},Object.entries({length:"At least 8 characters",number:"One number (0-9)",special:"One special character (!@#$%^&*)"}).map((e=>{let[t,r]=e;return n.createElement("div",{key:t,className:"flex items-center"},n.createElement("div",{className:"w-4 h-4 rounded-full mr-2 flex items-center justify-center ".concat(l[t]?"bg-green-500":"bg-gray-300")},l[t]&&n.createElement("svg",{className:"w-3 h-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))),n.createElement("span",{className:"text-sm ".concat(l[t]?"text-green-600":"text-gray-600")},r))})))),n.createElement("button",{type:"submit",disabled:!s,className:"w-full py-3 px-4 rounded-lg font-semibold transition-colors ".concat(s?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-300 text-gray-500 cursor-not-allowed")},"Create PIN")),r&&n.createElement("p",{className:"text-center text-sm text-gray-500 mt-4"},"Securing account for: ",n.createElement("span",{className:"font-medium"},r)))}function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?w(Object(r),!0).forEach((function(t){N(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function N(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const k=[{id:"basic",name:"Basic Info",description:"Essential profile information, account details, and basic demographics",icon:"👤",required:!0,tooltip:"Includes name, email, basic profile information. This data is essential for personalization and is always included.",privacyLink:"https://onairos.uk/privacy#basic-info"},{id:"personality",name:"Personality",description:"Personality traits, behavioral patterns and psychological insights",icon:"🧠",required:!1,tooltip:"AI-analyzed personality traits based on your social media activity and interactions. Used to improve content recommendations.",privacyLink:"https://onairos.uk/privacy#personality-data"},{id:"preferences",name:"Preferences",description:"User preferences, interests, settings and personal choices",icon:"⚙️",required:!1,tooltip:"Your stated preferences and interests from connected platforms. Helps customize your experience.",privacyLink:"https://onairos.uk/privacy#preferences-data"}],S=e=>{let{children:t,content:r,privacyLink:o}=e;const[a,l]=(0,n.useState)(!1);return n.createElement("div",{className:"relative inline-block"},n.createElement("span",{onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:"border-b border-dotted border-gray-400 cursor-help"},t),a&&n.createElement("div",{className:"absolute z-50 w-64 p-3 mt-2 text-sm bg-white border border-gray-200 rounded-lg shadow-lg left-0"},n.createElement("p",{className:"mb-2 text-gray-700"},r),n.createElement("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 text-xs font-medium"},"Learn more about privacy →")))};function O(e){let{onComplete:t,userEmail:r,appName:o="App",autoFetch:a=!1,testMode:l=!1,connectedAccounts:c={}}=e;const[s,i]=(0,n.useState)({basic:!0,personality:!1,preferences:!1}),[u,m]=(0,n.useState)(!1),[d,p]=(0,n.useState)(!1),[f,g]=(0,n.useState)(null),[b,y]=(0,n.useState)(null),h=e=>{const t=k.find((t=>t.id===e));null!=t&&t.required||i((t=>E(E({},t),{},{[e]:!t[e]})))},v=async()=>{p(!0),y(null);try{const e=(e=>{let t=0;const r=e+Date.now().toString();for(let e=0;e<r.length;e++)t=(t<<5)-t+r.charCodeAt(e),t&=t;return"user_".concat(Math.abs(t).toString(36))})(r),n=Object.entries(s).filter((e=>{let[t,r]=e;return r})).map((e=>{let[t]=e;return t})),c=e=>{const t=[],r=(new Date).toISOString(),n={basic:"Medium",personality:"Large",preferences:"Traits"};return e.forEach((e=>{n[e]&&t.push({data:n[e],date:r})})),t},i=l?"https://api2.onairos.uk/inferenceTest":"https://api2.onairos.uk/getAPIurlMobile",u={userHash:e,appName:o,approvedData:n,apiUrl:i,testMode:l,timestamp:(new Date).toISOString()};if(!a)return t(u),u;try{const e=c(n),a=l?{approvedData:n,userEmail:r,appName:o,testMode:l,timestamp:(new Date).toISOString()}:{Info:{storage:"local",appId:o,confirmations:e,EncryptedUserPin:"pending_pin_integration",account:r,proofMode:!1,Domain:window.location.hostname,web3Type:"standard",OthentSub:null}},s=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":"onairos_web_sdk_live_key_2024"},body:JSON.stringify(a)});if(!s.ok)throw new Error("API request failed: ".concat(s.status));const m=await s.json();g(m);const d=E(E({},u),{},{apiResponse:m,success:!0});return setTimeout((()=>{t(d)}),1500),d}catch(e){console.error("API request failed:",e),y("API request failed: ".concat(e.message));const r=E(E({},u),{},{error:e.message,success:!1});return setTimeout((()=>{t(r)}),2e3),r}}catch(e){throw console.error("Data processing failed:",e),y("Processing failed: ".concat(e.message)),e}finally{p(!1)}},x=Object.values(s).filter(Boolean).length;return n.createElement("div",{className:"w-full max-w-md mx-auto bg-white rounded-lg shadow-xl overflow-hidden",style:{maxHeight:"90vh",height:"auto"}},n.createElement("div",{className:"p-4 sm:p-6 overflow-y-auto",style:{maxHeight:"calc(90vh - 4rem)"}},n.createElement("div",{className:"text-center mb-4 sm:mb-6"},n.createElement("h2",{className:"text-lg sm:text-xl font-bold text-gray-900 mb-2"},"Data Request"),n.createElement("p",{className:"text-gray-600 text-xs sm:text-sm"},"Select the data types and connections to share with ",n.createElement("span",{className:"font-medium"},o))),n.createElement("div",{className:"mb-4 sm:mb-6 p-2 sm:p-3 bg-blue-50 border border-blue-200 rounded-lg"},n.createElement("p",{className:"text-blue-800 text-xs sm:text-sm"},"🔒 Your selected data will be securely processed and used only for the intended purpose.")),n.createElement("div",{className:"mb-6"},n.createElement("h3",{className:"text-md font-semibold text-gray-900 mb-3"},"Data Types"),n.createElement("div",{className:"space-y-2 sm:space-y-3"},k.map((e=>{const t=s[e.id]||!1,r=e.required;return n.createElement("div",{key:e.id,className:"flex items-center justify-between p-3 sm:p-4 border rounded-lg transition-colors ".concat(r?"bg-gray-100 border-gray-300 cursor-not-allowed":"hover:bg-gray-50 cursor-pointer border-gray-200"),onClick:()=>(e=>{const t=k.find((t=>t.id===e));null!=t&&t.required||h(e)})(e.id)},n.createElement("div",{className:"flex items-center space-x-3"},n.createElement("div",{className:"text-xl sm:text-2xl"},e.icon),n.createElement("div",null,n.createElement("h4",{className:"font-medium text-gray-900 text-sm sm:text-base"},n.createElement(S,{content:e.tooltip,privacyLink:e.privacyLink},e.name),r&&n.createElement("span",{className:"text-gray-500 ml-1 text-xs"},"(Required)")),n.createElement("p",{className:"text-xs sm:text-sm text-gray-500"},e.description))),r?n.createElement("div",{className:"px-2 py-1 bg-gray-400 text-white text-xs rounded-full"},"Required"):n.createElement("button",{onClick:t=>{t.stopPropagation(),h(e.id)},className:"relative inline-flex h-5 sm:h-6 w-9 sm:w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ".concat(t?"bg-blue-600":"bg-gray-200")},n.createElement("span",{className:"inline-block h-3 sm:h-4 w-3 sm:w-4 transform rounded-full bg-white transition-transform ".concat(t?"translate-x-5 sm:translate-x-6":"translate-x-1")})))})))),n.createElement("div",{className:"mb-3 sm:mb-4 p-2 sm:p-3 bg-green-50 border border-green-200 rounded-lg"},n.createElement("p",{className:"text-green-800 text-xs sm:text-sm"},"✅ ",x," data type",x>1?"s":""," selected")),d&&n.createElement("div",{className:"mb-3 sm:mb-4 p-2 sm:p-3 bg-blue-50 border border-blue-200 rounded-lg"},n.createElement("p",{className:"text-blue-800 text-xs sm:text-sm"},"🔄 Processing your data request...")),b&&n.createElement("div",{className:"mb-3 sm:mb-4 p-2 sm:p-3 bg-red-50 border border-red-200 rounded-lg"},n.createElement("p",{className:"text-red-800 text-xs sm:text-sm"},"❌ ",b)),n.createElement("form",{onSubmit:async e=>{e.preventDefault(),m(!0);try{const e=await v();e&&t(e)}catch(e){y("Submission failed: ".concat(e.message))}finally{m(!1)}},className:"space-y-3"},n.createElement("button",{type:"submit",disabled:u||0===x,className:"w-full py-2 sm:py-3 px-4 rounded-lg font-semibold transition-colors text-sm sm:text-base ".concat(x>0&&!u?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-300 text-gray-500 cursor-not-allowed")},u?"Processing...":"Share Selected Data"),n.createElement("button",{type:"button",onClick:()=>t({selectedData:{},selectedConnectors:[],cancelled:!0}),className:"w-full py-2 text-gray-500 hover:text-gray-700 text-xs sm:text-sm"},"Cancel"))))}function C(e){var t,r,o,a,l;let{onComplete:c,userEmail:s,appName:i="App"}=e;const[u,m]=(0,n.useState)(0),[d,p]=(0,n.useState)(0),[f,g]=(0,n.useState)(!1),b=[{title:"Setting up your personal AI",description:"Initializing your secure data model",icon:"🤖",duration:2e3},{title:"Processing your connections",description:"Analyzing your social media patterns",icon:"🔗",duration:2500},{title:"Training your model",description:"Building your personalized insights",icon:"🧠",duration:3e3},{title:"Finalizing setup",description:"Preparing your Onairos experience",icon:"✨",duration:2e3}];return(0,n.useEffect)((()=>{let e,t;if(u<b.length){const r=b[u].duration,n=100/b.length;e=setInterval((()=>{p((e=>{const t=e+n/(r/100);return Math.min(t,(u+1)*n)}))}),100),t=setTimeout((()=>{u<b.length-1?m((e=>e+1)):(g(!0),setTimeout((()=>{c({trainingComplete:!0,timestamp:(new Date).toISOString(),userEmail:s,appName:i})}),1e3))}),r)}return()=>{e&&clearInterval(e),t&&clearTimeout(t)}}),[u,c,s,i]),n.createElement("div",{className:"max-w-md mx-auto bg-white p-6 min-h-[400px] flex flex-col justify-center"},n.createElement("div",{className:"text-center mb-8"},n.createElement("div",{className:"w-20 h-20 bg-linear-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center mx-auto mb-4"},n.createElement("div",{className:"text-3xl"},f?"🎉":null===(t=b[u])||void 0===t?void 0:t.icon)),n.createElement("h2",{className:"text-2xl font-bold text-gray-900 mb-2"},f?"All set!":null===(r=b[u])||void 0===r?void 0:r.title),n.createElement("p",{className:"text-gray-600"},f?"Your personal AI is ready to use":null===(o=b[u])||void 0===o?void 0:o.description)),n.createElement("div",{className:"mb-6"},n.createElement("div",{className:"flex justify-between text-sm text-gray-500 mb-2"},n.createElement("span",null,"Progress"),n.createElement("span",null,Math.round(d),"%")),n.createElement("div",{className:"w-full bg-gray-200 rounded-full h-2"},n.createElement("div",{className:"bg-linear-to-r from-blue-500 to-purple-600 h-2 rounded-full transition-all duration-300 ease-out",style:{width:"".concat(d,"%")}}))),n.createElement("div",{className:"flex justify-center space-x-2 mb-6"},b.map(((e,t)=>n.createElement("div",{key:t,className:"w-3 h-3 rounded-full transition-all duration-300 ".concat(t<=u?"bg-blue-500":"bg-gray-300")})))),n.createElement("div",{className:"bg-gray-50 p-4 rounded-lg"},n.createElement("div",{className:"flex items-center space-x-3"},n.createElement("div",{className:"w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center"},n.createElement("div",{className:"text-sm"},f?"✅":null===(a=b[u])||void 0===a?void 0:a.icon)),n.createElement("div",null,n.createElement("h3",{className:"font-medium text-gray-900"},f?"Training Complete":"Step ".concat(u+1," of ").concat(b.length)),n.createElement("p",{className:"text-sm text-gray-600"},f?"Your Onairos experience is ready":null===(l=b[u])||void 0===l?void 0:l.description)))),n.createElement("div",{className:"mt-6 text-center"},n.createElement("p",{className:"text-sm text-gray-500"},"Setting up for ",n.createElement("span",{className:"font-medium"},i)),s&&n.createElement("p",{className:"text-xs text-gray-400 mt-1"},s)))}function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){P(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function P(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function I(e){let{requestData:t,webpageName:r,inferenceData:o=null,onComplete:a=null,autoFetch:l=!1,testMode:c=!1,proofMode:s=!1,textLayout:i="below",textColor:u="white",login:m=!1,buttonType:d="pill",loginReturn:f=null,loginType:g="signIn",visualType:b="full",appIcon:y=null,enableTraining:h=!0}=e;const[w,E]=(0,n.useState)(!1),[N,k]=(0,n.useState)("email"),[S,_]=(0,n.useState)(null),[P,I]=(0,n.useState)(null);(0,n.useEffect)((()=>{(()=>{const e=localStorage.getItem("onairosUser");if(e)try{const t=JSON.parse(e);_(t),t.onboardingComplete&&t.pinCreated?k("dataRequest"):t.verified&&!t.onboardingComplete?k("onboarding"):t.onboardingComplete&&!t.pinCreated&&k("pin")}catch(e){console.error("Error parsing saved user data:",e),localStorage.removeItem("onairosUser")}})()}),[]);const R=()=>{E(!1),I(null)},A=e=>{console.log("🔥 Email auth successful:",e),console.log("🔧 User State:",{isNewUser:e.isNewUser,userState:e.userState,flowType:e.flowType,existingUser:e.existingUser});const t=!0===e.isNewUser||"onboarding"===e.flowType||"new"===e.userState,r=j(j({},e),{},{verified:!0,onboardingComplete:!t,pinCreated:!t});_(r),localStorage.setItem("onairosUser",JSON.stringify(r)),t?(console.log("🚀 New user detected → Starting onboarding flow (includes training)"),k("onboarding")):(console.log("👋 Existing user detected → Going directly to data request"),k("dataRequest"))},L=e=>{console.log("Onboarding completed:",e);const t=j(j({},S),{},{onboardingComplete:!0,connectedAccounts:e.connectedAccounts||[]});_(t),localStorage.setItem("onairosUser",JSON.stringify(t)),k("pin")},T=e=>{console.log("PIN setup completed:",e);const t=j(j(j({},S),e),{},{pinCreated:!0});_(t),localStorage.setItem("onairosUser",JSON.stringify(t)),k("dataRequest")},U=e=>{console.log("🎓 Training completed:",e);const t=j(j({},S),{},{trainingCompleted:!0},e);_(t),localStorage.setItem("onairosUser",JSON.stringify(t)),k("dataRequest")},D=e=>{console.log("🔥 OnairosButton: Data request completed:",e);const t=j(j({},S),{},{lastDataRequest:e});if(_(t),localStorage.setItem("onairosUser",JSON.stringify(t)),E(!1),console.log("🔥 Calling onComplete callback with:",e),a)try{a(e),console.log("🔥 onComplete callback executed successfully")}catch(e){console.error("🔥 Error in onComplete callback:",e)}else console.log("🔥 No onComplete callback provided")},M="flex items-center justify-center font-bold rounded cursor-pointer ".concat("pill"===d?"px-4 py-2":"w-12 h-12"," bg-transparent OnairosConnect"),q={flexDirection:"below"===i?"column":"row",backgroundColor:"transparent",color:u,border:"1px solid transparent"},$={width:"20px",height:"20px",marginRight:"full"===b?"12px":"0"};return n.createElement(n.Fragment,null,n.createElement("button",{className:M,onClick:async()=>{try{console.log("🔥 openTerminal called"),E(!0)}catch(e){console.error("Error in openTerminal:",e)}},style:q},("full"===b||"icon"===b)&&n.createElement("img",{src:m?"https://onairos.sirv.com/Images/OnairosWhite.png":"https://onairos.sirv.com/Images/OnairosBlack.png",alt:"Onairos Logo",style:$}),"icon"!==b&&n.createElement("span",{className:"".concat("black"===u?"text-black":"text-white"," ").concat("icon"===b?"sr-only":""," ").concat("right"===i?"ml-2":"left"===i?"mr-2":"")},(()=>{switch(g){case"signUp":return"Sign Up with Onairos";case"signOut":return"Sign Out of Onairos";default:return"Sign In with Onairos"}})())),w&&n.createElement("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:e=>{e.target===e.currentTarget&&R()}},n.createElement("div",{className:"bg-white rounded-lg shadow-xl max-w-md w-full mx-4 max-h-[90vh] overflow-hidden relative",onClick:e=>e.stopPropagation()},n.createElement("button",{onClick:R,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 z-10"},n.createElement("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}))),n.createElement("div",{className:"overflow-y-auto max-h-[90vh]"},(()=>{switch(N){case"email":return n.createElement(p,{onSuccess:A,testMode:c});case"onboarding":return n.createElement(v,{onComplete:L,appIcon:y||"https://onairos.sirv.com/Images/OnairosBlack.png",appName:r,username:(null==S?void 0:S.email)||(null==S?void 0:S.username)});case"pin":return n.createElement(x,{onComplete:T,userEmail:null==S?void 0:S.email});case"training":return n.createElement(C,{onComplete:U,userEmail:null==S?void 0:S.email,appName:r,connectedAccounts:(null==S?void 0:S.connectedAccounts)||[]});case"dataRequest":return n.createElement(O,{onComplete:D,userEmail:null==S?void 0:S.email,requestData:t,appName:r,autoFetch:l,testMode:c,appIcon:y,connectedAccounts:(null==S?void 0:S.connectedAccounts)||{}});default:return n.createElement("div",{className:"flex flex-col items-center space-y-4 p-6"},n.createElement("div",{className:"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent"}),n.createElement("p",{className:"text-gray-600"},"Loading..."))}})()))))}},408:(e,t)=>{var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),s=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,b={};function y(e,t,r){this.props=e,this.context=t,this.refs=b,this.updater=r||f}function h(){}function v(e,t,r){this.props=e,this.context=t,this.refs=b,this.updater=r||f}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},h.prototype=y.prototype;var x=v.prototype=new h;x.constructor=v,g(x,y.prototype),x.isPureReactComponent=!0;var w=Array.isArray,E=Object.prototype.hasOwnProperty,N={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function S(e,t,n){var o,a={},l=null,c=null;if(null!=t)for(o in void 0!==t.ref&&(c=t.ref),void 0!==t.key&&(l=""+t.key),t)E.call(t,o)&&!k.hasOwnProperty(o)&&(a[o]=t[o]);var s=arguments.length-2;if(1===s)a.children=n;else if(1<s){for(var i=Array(s),u=0;u<s;u++)i[u]=arguments[u+2];a.children=i}if(e&&e.defaultProps)for(o in s=e.defaultProps)void 0===a[o]&&(a[o]=s[o]);return{$$typeof:r,type:e,key:l,ref:c,props:a,_owner:N.current}}function O(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var C=/\/+/g;function _(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function j(e,t,o,a,l){var c=typeof e;"undefined"!==c&&"boolean"!==c||(e=null);var s=!1;if(null===e)s=!0;else switch(c){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case r:case n:s=!0}}if(s)return l=l(s=e),e=""===a?"."+_(s,0):a,w(l)?(o="",null!=e&&(o=e.replace(C,"$&/")+"/"),j(l,t,o,"",(function(e){return e}))):null!=l&&(O(l)&&(l=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(l,o+(!l.key||s&&s.key===l.key?"":(""+l.key).replace(C,"$&/")+"/")+e)),t.push(l)),1;if(s=0,a=""===a?".":a+":",w(e))for(var i=0;i<e.length;i++){var u=a+_(c=e[i],i);s+=j(c,t,o,u,l)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),i=0;!(c=e.next()).done;)s+=j(c=c.value,t,o,u=a+_(c,i++),l);else if("object"===c)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function P(e,t,r){if(null==e)return e;var n=[],o=0;return j(e,n,"","",(function(e){return t.call(r,e,o++)})),n}function I(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var R={current:null},A={transition:null},L={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:A,ReactCurrentOwner:N};function T(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:P,forEach:function(e,t,r){P(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!O(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=o,t.Profiler=l,t.PureComponent=v,t.StrictMode=a,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=L,t.act=T,t.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=g({},e.props),a=e.key,l=e.ref,c=e._owner;if(null!=t){if(void 0!==t.ref&&(l=t.ref,c=N.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(i in t)E.call(t,i)&&!k.hasOwnProperty(i)&&(o[i]=void 0===t[i]&&void 0!==s?s[i]:t[i])}var i=arguments.length-2;if(1===i)o.children=n;else if(1<i){s=Array(i);for(var u=0;u<i;u++)s[u]=arguments[u+2];o.children=s}return{$$typeof:r,type:e.type,key:a,ref:l,props:o,_owner:c}},t.createContext=function(e){return(e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},t.createElement=S,t.createFactory=function(e){var t=S.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:i,render:e}},t.isValidElement=O,t.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:I}},t.memo=function(e,t){return{$$typeof:m,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=A.transition;A.transition={};try{e()}finally{A.transition=t}},t.unstable_act=T,t.useCallback=function(e,t){return R.current.useCallback(e,t)},t.useContext=function(e){return R.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return R.current.useDeferredValue(e)},t.useEffect=function(e,t){return R.current.useEffect(e,t)},t.useId=function(){return R.current.useId()},t.useImperativeHandle=function(e,t,r){return R.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return R.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return R.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return R.current.useMemo(e,t)},t.useReducer=function(e,t,r){return R.current.useReducer(e,t,r)},t.useRef=function(e){return R.current.useRef(e)},t.useState=function(e){return R.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return R.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return R.current.useTransition()},t.version="18.3.1"},294:(e,t,r)=>{e.exports=r(408)}}]);
2
+ //# sourceMappingURL=433.js.map