flowlink-auth 2.7.0 → 2.7.2
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.
- package/dist/ErrorBox.js +0 -1
- package/dist/SignIn.js +1 -2
- package/dist/SignUp.js +1 -2
- package/dist/api.js +0 -1
- package/dist/createAuthMiddleware.js +0 -1
- package/dist/index.js +1069 -47
- package/dist/init.js +5 -6
- package/dist/provider.js +3 -4
- package/dist/securityUtils.js +0 -1
- package/dist/useAuth.js +1 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,1015 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
// node_modules/react/cjs/react.development.js
|
|
28
|
+
var require_react_development = __commonJS({
|
|
29
|
+
"node_modules/react/cjs/react.development.js"(exports, module) {
|
|
30
|
+
"use strict";
|
|
31
|
+
(function() {
|
|
32
|
+
function defineDeprecationWarning(methodName, info) {
|
|
33
|
+
Object.defineProperty(Component.prototype, methodName, {
|
|
34
|
+
get: function() {
|
|
35
|
+
console.warn(
|
|
36
|
+
"%s(...) is deprecated in plain JavaScript React classes. %s",
|
|
37
|
+
info[0],
|
|
38
|
+
info[1]
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function getIteratorFn(maybeIterable) {
|
|
44
|
+
if (null === maybeIterable || "object" !== typeof maybeIterable)
|
|
45
|
+
return null;
|
|
46
|
+
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
47
|
+
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
48
|
+
}
|
|
49
|
+
function warnNoop(publicInstance, callerName) {
|
|
50
|
+
publicInstance = (publicInstance = publicInstance.constructor) && (publicInstance.displayName || publicInstance.name) || "ReactClass";
|
|
51
|
+
var warningKey = publicInstance + "." + callerName;
|
|
52
|
+
didWarnStateUpdateForUnmountedComponent[warningKey] || (console.error(
|
|
53
|
+
"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",
|
|
54
|
+
callerName,
|
|
55
|
+
publicInstance
|
|
56
|
+
), didWarnStateUpdateForUnmountedComponent[warningKey] = true);
|
|
57
|
+
}
|
|
58
|
+
function Component(props, context, updater) {
|
|
59
|
+
this.props = props;
|
|
60
|
+
this.context = context;
|
|
61
|
+
this.refs = emptyObject;
|
|
62
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
63
|
+
}
|
|
64
|
+
function ComponentDummy() {
|
|
65
|
+
}
|
|
66
|
+
function PureComponent(props, context, updater) {
|
|
67
|
+
this.props = props;
|
|
68
|
+
this.context = context;
|
|
69
|
+
this.refs = emptyObject;
|
|
70
|
+
this.updater = updater || ReactNoopUpdateQueue;
|
|
71
|
+
}
|
|
72
|
+
function noop() {
|
|
73
|
+
}
|
|
74
|
+
function testStringCoercion(value) {
|
|
75
|
+
return "" + value;
|
|
76
|
+
}
|
|
77
|
+
function checkKeyStringCoercion(value) {
|
|
78
|
+
try {
|
|
79
|
+
testStringCoercion(value);
|
|
80
|
+
var JSCompiler_inline_result = false;
|
|
81
|
+
} catch (e) {
|
|
82
|
+
JSCompiler_inline_result = true;
|
|
83
|
+
}
|
|
84
|
+
if (JSCompiler_inline_result) {
|
|
85
|
+
JSCompiler_inline_result = console;
|
|
86
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
87
|
+
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
88
|
+
JSCompiler_temp_const.call(
|
|
89
|
+
JSCompiler_inline_result,
|
|
90
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
91
|
+
JSCompiler_inline_result$jscomp$0
|
|
92
|
+
);
|
|
93
|
+
return testStringCoercion(value);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function getComponentNameFromType(type) {
|
|
97
|
+
if (null == type) return null;
|
|
98
|
+
if ("function" === typeof type)
|
|
99
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
100
|
+
if ("string" === typeof type) return type;
|
|
101
|
+
switch (type) {
|
|
102
|
+
case REACT_FRAGMENT_TYPE:
|
|
103
|
+
return "Fragment";
|
|
104
|
+
case REACT_PROFILER_TYPE:
|
|
105
|
+
return "Profiler";
|
|
106
|
+
case REACT_STRICT_MODE_TYPE:
|
|
107
|
+
return "StrictMode";
|
|
108
|
+
case REACT_SUSPENSE_TYPE:
|
|
109
|
+
return "Suspense";
|
|
110
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
111
|
+
return "SuspenseList";
|
|
112
|
+
case REACT_ACTIVITY_TYPE:
|
|
113
|
+
return "Activity";
|
|
114
|
+
}
|
|
115
|
+
if ("object" === typeof type)
|
|
116
|
+
switch ("number" === typeof type.tag && console.error(
|
|
117
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
118
|
+
), type.$$typeof) {
|
|
119
|
+
case REACT_PORTAL_TYPE:
|
|
120
|
+
return "Portal";
|
|
121
|
+
case REACT_CONTEXT_TYPE:
|
|
122
|
+
return type.displayName || "Context";
|
|
123
|
+
case REACT_CONSUMER_TYPE:
|
|
124
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
125
|
+
case REACT_FORWARD_REF_TYPE:
|
|
126
|
+
var innerType = type.render;
|
|
127
|
+
type = type.displayName;
|
|
128
|
+
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
129
|
+
return type;
|
|
130
|
+
case REACT_MEMO_TYPE:
|
|
131
|
+
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
132
|
+
case REACT_LAZY_TYPE:
|
|
133
|
+
innerType = type._payload;
|
|
134
|
+
type = type._init;
|
|
135
|
+
try {
|
|
136
|
+
return getComponentNameFromType(type(innerType));
|
|
137
|
+
} catch (x) {
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
function getTaskName(type) {
|
|
143
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
144
|
+
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
145
|
+
return "<...>";
|
|
146
|
+
try {
|
|
147
|
+
var name = getComponentNameFromType(type);
|
|
148
|
+
return name ? "<" + name + ">" : "<...>";
|
|
149
|
+
} catch (x) {
|
|
150
|
+
return "<...>";
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function getOwner() {
|
|
154
|
+
var dispatcher = ReactSharedInternals.A;
|
|
155
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
156
|
+
}
|
|
157
|
+
function UnknownOwner() {
|
|
158
|
+
return Error("react-stack-top-frame");
|
|
159
|
+
}
|
|
160
|
+
function hasValidKey(config) {
|
|
161
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
162
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
163
|
+
if (getter && getter.isReactWarning) return false;
|
|
164
|
+
}
|
|
165
|
+
return void 0 !== config.key;
|
|
166
|
+
}
|
|
167
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
168
|
+
function warnAboutAccessingKey() {
|
|
169
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
170
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
171
|
+
displayName
|
|
172
|
+
));
|
|
173
|
+
}
|
|
174
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
175
|
+
Object.defineProperty(props, "key", {
|
|
176
|
+
get: warnAboutAccessingKey,
|
|
177
|
+
configurable: true
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
181
|
+
var componentName = getComponentNameFromType(this.type);
|
|
182
|
+
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
183
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
184
|
+
));
|
|
185
|
+
componentName = this.props.ref;
|
|
186
|
+
return void 0 !== componentName ? componentName : null;
|
|
187
|
+
}
|
|
188
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
189
|
+
var refProp = props.ref;
|
|
190
|
+
type = {
|
|
191
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
192
|
+
type,
|
|
193
|
+
key,
|
|
194
|
+
props,
|
|
195
|
+
_owner: owner
|
|
196
|
+
};
|
|
197
|
+
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
198
|
+
enumerable: false,
|
|
199
|
+
get: elementRefGetterWithDeprecationWarning
|
|
200
|
+
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
201
|
+
type._store = {};
|
|
202
|
+
Object.defineProperty(type._store, "validated", {
|
|
203
|
+
configurable: false,
|
|
204
|
+
enumerable: false,
|
|
205
|
+
writable: true,
|
|
206
|
+
value: 0
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
209
|
+
configurable: false,
|
|
210
|
+
enumerable: false,
|
|
211
|
+
writable: true,
|
|
212
|
+
value: null
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(type, "_debugStack", {
|
|
215
|
+
configurable: false,
|
|
216
|
+
enumerable: false,
|
|
217
|
+
writable: true,
|
|
218
|
+
value: debugStack
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(type, "_debugTask", {
|
|
221
|
+
configurable: false,
|
|
222
|
+
enumerable: false,
|
|
223
|
+
writable: true,
|
|
224
|
+
value: debugTask
|
|
225
|
+
});
|
|
226
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
227
|
+
return type;
|
|
228
|
+
}
|
|
229
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
230
|
+
newKey = ReactElement(
|
|
231
|
+
oldElement.type,
|
|
232
|
+
newKey,
|
|
233
|
+
oldElement.props,
|
|
234
|
+
oldElement._owner,
|
|
235
|
+
oldElement._debugStack,
|
|
236
|
+
oldElement._debugTask
|
|
237
|
+
);
|
|
238
|
+
oldElement._store && (newKey._store.validated = oldElement._store.validated);
|
|
239
|
+
return newKey;
|
|
240
|
+
}
|
|
241
|
+
function validateChildKeys(node) {
|
|
242
|
+
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
|
243
|
+
}
|
|
244
|
+
function isValidElement(object) {
|
|
245
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
246
|
+
}
|
|
247
|
+
function escape(key) {
|
|
248
|
+
var escaperLookup = { "=": "=0", ":": "=2" };
|
|
249
|
+
return "$" + key.replace(/[=:]/g, function(match) {
|
|
250
|
+
return escaperLookup[match];
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
function getElementKey(element, index) {
|
|
254
|
+
return "object" === typeof element && null !== element && null != element.key ? (checkKeyStringCoercion(element.key), escape("" + element.key)) : index.toString(36);
|
|
255
|
+
}
|
|
256
|
+
function resolveThenable(thenable) {
|
|
257
|
+
switch (thenable.status) {
|
|
258
|
+
case "fulfilled":
|
|
259
|
+
return thenable.value;
|
|
260
|
+
case "rejected":
|
|
261
|
+
throw thenable.reason;
|
|
262
|
+
default:
|
|
263
|
+
switch ("string" === typeof thenable.status ? thenable.then(noop, noop) : (thenable.status = "pending", thenable.then(
|
|
264
|
+
function(fulfilledValue) {
|
|
265
|
+
"pending" === thenable.status && (thenable.status = "fulfilled", thenable.value = fulfilledValue);
|
|
266
|
+
},
|
|
267
|
+
function(error) {
|
|
268
|
+
"pending" === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
269
|
+
}
|
|
270
|
+
)), thenable.status) {
|
|
271
|
+
case "fulfilled":
|
|
272
|
+
return thenable.value;
|
|
273
|
+
case "rejected":
|
|
274
|
+
throw thenable.reason;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
throw thenable;
|
|
278
|
+
}
|
|
279
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
280
|
+
var type = typeof children;
|
|
281
|
+
if ("undefined" === type || "boolean" === type) children = null;
|
|
282
|
+
var invokeCallback = false;
|
|
283
|
+
if (null === children) invokeCallback = true;
|
|
284
|
+
else
|
|
285
|
+
switch (type) {
|
|
286
|
+
case "bigint":
|
|
287
|
+
case "string":
|
|
288
|
+
case "number":
|
|
289
|
+
invokeCallback = true;
|
|
290
|
+
break;
|
|
291
|
+
case "object":
|
|
292
|
+
switch (children.$$typeof) {
|
|
293
|
+
case REACT_ELEMENT_TYPE:
|
|
294
|
+
case REACT_PORTAL_TYPE:
|
|
295
|
+
invokeCallback = true;
|
|
296
|
+
break;
|
|
297
|
+
case REACT_LAZY_TYPE:
|
|
298
|
+
return invokeCallback = children._init, mapIntoArray(
|
|
299
|
+
invokeCallback(children._payload),
|
|
300
|
+
array,
|
|
301
|
+
escapedPrefix,
|
|
302
|
+
nameSoFar,
|
|
303
|
+
callback
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (invokeCallback) {
|
|
308
|
+
invokeCallback = children;
|
|
309
|
+
callback = callback(invokeCallback);
|
|
310
|
+
var childKey = "" === nameSoFar ? "." + getElementKey(invokeCallback, 0) : nameSoFar;
|
|
311
|
+
isArrayImpl(callback) ? (escapedPrefix = "", null != childKey && (escapedPrefix = childKey.replace(userProvidedKeyEscapeRegex, "$&/") + "/"), mapIntoArray(callback, array, escapedPrefix, "", function(c) {
|
|
312
|
+
return c;
|
|
313
|
+
})) : null != callback && (isValidElement(callback) && (null != callback.key && (invokeCallback && invokeCallback.key === callback.key || checkKeyStringCoercion(callback.key)), escapedPrefix = cloneAndReplaceKey(
|
|
314
|
+
callback,
|
|
315
|
+
escapedPrefix + (null == callback.key || invokeCallback && invokeCallback.key === callback.key ? "" : ("" + callback.key).replace(
|
|
316
|
+
userProvidedKeyEscapeRegex,
|
|
317
|
+
"$&/"
|
|
318
|
+
) + "/") + childKey
|
|
319
|
+
), "" !== nameSoFar && null != invokeCallback && isValidElement(invokeCallback) && null == invokeCallback.key && invokeCallback._store && !invokeCallback._store.validated && (escapedPrefix._store.validated = 2), callback = escapedPrefix), array.push(callback));
|
|
320
|
+
return 1;
|
|
321
|
+
}
|
|
322
|
+
invokeCallback = 0;
|
|
323
|
+
childKey = "" === nameSoFar ? "." : nameSoFar + ":";
|
|
324
|
+
if (isArrayImpl(children))
|
|
325
|
+
for (var i = 0; i < children.length; i++)
|
|
326
|
+
nameSoFar = children[i], type = childKey + getElementKey(nameSoFar, i), invokeCallback += mapIntoArray(
|
|
327
|
+
nameSoFar,
|
|
328
|
+
array,
|
|
329
|
+
escapedPrefix,
|
|
330
|
+
type,
|
|
331
|
+
callback
|
|
332
|
+
);
|
|
333
|
+
else if (i = getIteratorFn(children), "function" === typeof i)
|
|
334
|
+
for (i === children.entries && (didWarnAboutMaps || console.warn(
|
|
335
|
+
"Using Maps as children is not supported. Use an array of keyed ReactElements instead."
|
|
336
|
+
), didWarnAboutMaps = true), children = i.call(children), i = 0; !(nameSoFar = children.next()).done; )
|
|
337
|
+
nameSoFar = nameSoFar.value, type = childKey + getElementKey(nameSoFar, i++), invokeCallback += mapIntoArray(
|
|
338
|
+
nameSoFar,
|
|
339
|
+
array,
|
|
340
|
+
escapedPrefix,
|
|
341
|
+
type,
|
|
342
|
+
callback
|
|
343
|
+
);
|
|
344
|
+
else if ("object" === type) {
|
|
345
|
+
if ("function" === typeof children.then)
|
|
346
|
+
return mapIntoArray(
|
|
347
|
+
resolveThenable(children),
|
|
348
|
+
array,
|
|
349
|
+
escapedPrefix,
|
|
350
|
+
nameSoFar,
|
|
351
|
+
callback
|
|
352
|
+
);
|
|
353
|
+
array = String(children);
|
|
354
|
+
throw Error(
|
|
355
|
+
"Objects are not valid as a React child (found: " + ("[object Object]" === array ? "object with keys {" + Object.keys(children).join(", ") + "}" : array) + "). If you meant to render a collection of children, use an array instead."
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
return invokeCallback;
|
|
359
|
+
}
|
|
360
|
+
function mapChildren(children, func, context) {
|
|
361
|
+
if (null == children) return children;
|
|
362
|
+
var result = [], count = 0;
|
|
363
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
364
|
+
return func.call(context, child, count++);
|
|
365
|
+
});
|
|
366
|
+
return result;
|
|
367
|
+
}
|
|
368
|
+
function lazyInitializer(payload) {
|
|
369
|
+
if (-1 === payload._status) {
|
|
370
|
+
var ioInfo = payload._ioInfo;
|
|
371
|
+
null != ioInfo && (ioInfo.start = ioInfo.end = performance.now());
|
|
372
|
+
ioInfo = payload._result;
|
|
373
|
+
var thenable = ioInfo();
|
|
374
|
+
thenable.then(
|
|
375
|
+
function(moduleObject) {
|
|
376
|
+
if (0 === payload._status || -1 === payload._status) {
|
|
377
|
+
payload._status = 1;
|
|
378
|
+
payload._result = moduleObject;
|
|
379
|
+
var _ioInfo = payload._ioInfo;
|
|
380
|
+
null != _ioInfo && (_ioInfo.end = performance.now());
|
|
381
|
+
void 0 === thenable.status && (thenable.status = "fulfilled", thenable.value = moduleObject);
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
function(error) {
|
|
385
|
+
if (0 === payload._status || -1 === payload._status) {
|
|
386
|
+
payload._status = 2;
|
|
387
|
+
payload._result = error;
|
|
388
|
+
var _ioInfo2 = payload._ioInfo;
|
|
389
|
+
null != _ioInfo2 && (_ioInfo2.end = performance.now());
|
|
390
|
+
void 0 === thenable.status && (thenable.status = "rejected", thenable.reason = error);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
);
|
|
394
|
+
ioInfo = payload._ioInfo;
|
|
395
|
+
if (null != ioInfo) {
|
|
396
|
+
ioInfo.value = thenable;
|
|
397
|
+
var displayName = thenable.displayName;
|
|
398
|
+
"string" === typeof displayName && (ioInfo.name = displayName);
|
|
399
|
+
}
|
|
400
|
+
-1 === payload._status && (payload._status = 0, payload._result = thenable);
|
|
401
|
+
}
|
|
402
|
+
if (1 === payload._status)
|
|
403
|
+
return ioInfo = payload._result, void 0 === ioInfo && console.error(
|
|
404
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",
|
|
405
|
+
ioInfo
|
|
406
|
+
), "default" in ioInfo || console.error(
|
|
407
|
+
"lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",
|
|
408
|
+
ioInfo
|
|
409
|
+
), ioInfo.default;
|
|
410
|
+
throw payload._result;
|
|
411
|
+
}
|
|
412
|
+
function resolveDispatcher() {
|
|
413
|
+
var dispatcher = ReactSharedInternals.H;
|
|
414
|
+
null === dispatcher && console.error(
|
|
415
|
+
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|
416
|
+
);
|
|
417
|
+
return dispatcher;
|
|
418
|
+
}
|
|
419
|
+
function releaseAsyncTransition() {
|
|
420
|
+
ReactSharedInternals.asyncTransitions--;
|
|
421
|
+
}
|
|
422
|
+
function enqueueTask(task) {
|
|
423
|
+
if (null === enqueueTaskImpl)
|
|
424
|
+
try {
|
|
425
|
+
var requireString = ("require" + Math.random()).slice(0, 7);
|
|
426
|
+
enqueueTaskImpl = (module && module[requireString]).call(
|
|
427
|
+
module,
|
|
428
|
+
"timers"
|
|
429
|
+
).setImmediate;
|
|
430
|
+
} catch (_err) {
|
|
431
|
+
enqueueTaskImpl = function(callback) {
|
|
432
|
+
false === didWarnAboutMessageChannel && (didWarnAboutMessageChannel = true, "undefined" === typeof MessageChannel && console.error(
|
|
433
|
+
"This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."
|
|
434
|
+
));
|
|
435
|
+
var channel = new MessageChannel();
|
|
436
|
+
channel.port1.onmessage = callback;
|
|
437
|
+
channel.port2.postMessage(void 0);
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
return enqueueTaskImpl(task);
|
|
441
|
+
}
|
|
442
|
+
function aggregateErrors(errors) {
|
|
443
|
+
return 1 < errors.length && "function" === typeof AggregateError ? new AggregateError(errors) : errors[0];
|
|
444
|
+
}
|
|
445
|
+
function popActScope(prevActQueue, prevActScopeDepth) {
|
|
446
|
+
prevActScopeDepth !== actScopeDepth - 1 && console.error(
|
|
447
|
+
"You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "
|
|
448
|
+
);
|
|
449
|
+
actScopeDepth = prevActScopeDepth;
|
|
450
|
+
}
|
|
451
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
452
|
+
var queue = ReactSharedInternals.actQueue;
|
|
453
|
+
if (null !== queue)
|
|
454
|
+
if (0 !== queue.length)
|
|
455
|
+
try {
|
|
456
|
+
flushActQueue(queue);
|
|
457
|
+
enqueueTask(function() {
|
|
458
|
+
return recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
459
|
+
});
|
|
460
|
+
return;
|
|
461
|
+
} catch (error) {
|
|
462
|
+
ReactSharedInternals.thrownErrors.push(error);
|
|
463
|
+
}
|
|
464
|
+
else ReactSharedInternals.actQueue = null;
|
|
465
|
+
0 < ReactSharedInternals.thrownErrors.length ? (queue = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, reject(queue)) : resolve(returnValue);
|
|
466
|
+
}
|
|
467
|
+
function flushActQueue(queue) {
|
|
468
|
+
if (!isFlushing) {
|
|
469
|
+
isFlushing = true;
|
|
470
|
+
var i = 0;
|
|
471
|
+
try {
|
|
472
|
+
for (; i < queue.length; i++) {
|
|
473
|
+
var callback = queue[i];
|
|
474
|
+
do {
|
|
475
|
+
ReactSharedInternals.didUsePromise = false;
|
|
476
|
+
var continuation = callback(false);
|
|
477
|
+
if (null !== continuation) {
|
|
478
|
+
if (ReactSharedInternals.didUsePromise) {
|
|
479
|
+
queue[i] = callback;
|
|
480
|
+
queue.splice(0, i);
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
callback = continuation;
|
|
484
|
+
} else break;
|
|
485
|
+
} while (1);
|
|
486
|
+
}
|
|
487
|
+
queue.length = 0;
|
|
488
|
+
} catch (error) {
|
|
489
|
+
queue.splice(0, i + 1), ReactSharedInternals.thrownErrors.push(error);
|
|
490
|
+
} finally {
|
|
491
|
+
isFlushing = false;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
496
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, didWarnStateUpdateForUnmountedComponent = {}, ReactNoopUpdateQueue = {
|
|
497
|
+
isMounted: function() {
|
|
498
|
+
return false;
|
|
499
|
+
},
|
|
500
|
+
enqueueForceUpdate: function(publicInstance) {
|
|
501
|
+
warnNoop(publicInstance, "forceUpdate");
|
|
502
|
+
},
|
|
503
|
+
enqueueReplaceState: function(publicInstance) {
|
|
504
|
+
warnNoop(publicInstance, "replaceState");
|
|
505
|
+
},
|
|
506
|
+
enqueueSetState: function(publicInstance) {
|
|
507
|
+
warnNoop(publicInstance, "setState");
|
|
508
|
+
}
|
|
509
|
+
}, assign = Object.assign, emptyObject = {};
|
|
510
|
+
Object.freeze(emptyObject);
|
|
511
|
+
Component.prototype.isReactComponent = {};
|
|
512
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
513
|
+
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
514
|
+
throw Error(
|
|
515
|
+
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
516
|
+
);
|
|
517
|
+
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
518
|
+
};
|
|
519
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
520
|
+
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
521
|
+
};
|
|
522
|
+
var deprecatedAPIs = {
|
|
523
|
+
isMounted: [
|
|
524
|
+
"isMounted",
|
|
525
|
+
"Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."
|
|
526
|
+
],
|
|
527
|
+
replaceState: [
|
|
528
|
+
"replaceState",
|
|
529
|
+
"Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."
|
|
530
|
+
]
|
|
531
|
+
};
|
|
532
|
+
for (fnName in deprecatedAPIs)
|
|
533
|
+
deprecatedAPIs.hasOwnProperty(fnName) && defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
534
|
+
ComponentDummy.prototype = Component.prototype;
|
|
535
|
+
deprecatedAPIs = PureComponent.prototype = new ComponentDummy();
|
|
536
|
+
deprecatedAPIs.constructor = PureComponent;
|
|
537
|
+
assign(deprecatedAPIs, Component.prototype);
|
|
538
|
+
deprecatedAPIs.isPureReactComponent = true;
|
|
539
|
+
var isArrayImpl = Array.isArray, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = {
|
|
540
|
+
H: null,
|
|
541
|
+
A: null,
|
|
542
|
+
T: null,
|
|
543
|
+
S: null,
|
|
544
|
+
actQueue: null,
|
|
545
|
+
asyncTransitions: 0,
|
|
546
|
+
isBatchingLegacy: false,
|
|
547
|
+
didScheduleLegacyUpdate: false,
|
|
548
|
+
didUsePromise: false,
|
|
549
|
+
thrownErrors: [],
|
|
550
|
+
getCurrentStack: null,
|
|
551
|
+
recentlyCreatedOwnerStacks: 0
|
|
552
|
+
}, hasOwnProperty = Object.prototype.hasOwnProperty, createTask = console.createTask ? console.createTask : function() {
|
|
553
|
+
return null;
|
|
554
|
+
};
|
|
555
|
+
deprecatedAPIs = {
|
|
556
|
+
react_stack_bottom_frame: function(callStackForError) {
|
|
557
|
+
return callStackForError();
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
var specialPropKeyWarningShown, didWarnAboutOldJSXRuntime;
|
|
561
|
+
var didWarnAboutElementRef = {};
|
|
562
|
+
var unknownOwnerDebugStack = deprecatedAPIs.react_stack_bottom_frame.bind(
|
|
563
|
+
deprecatedAPIs,
|
|
564
|
+
UnknownOwner
|
|
565
|
+
)();
|
|
566
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
567
|
+
var didWarnAboutMaps = false, userProvidedKeyEscapeRegex = /\/+/g, reportGlobalError = "function" === typeof reportError ? reportError : function(error) {
|
|
568
|
+
if ("object" === typeof window && "function" === typeof window.ErrorEvent) {
|
|
569
|
+
var event = new window.ErrorEvent("error", {
|
|
570
|
+
bubbles: true,
|
|
571
|
+
cancelable: true,
|
|
572
|
+
message: "object" === typeof error && null !== error && "string" === typeof error.message ? String(error.message) : String(error),
|
|
573
|
+
error
|
|
574
|
+
});
|
|
575
|
+
if (!window.dispatchEvent(event)) return;
|
|
576
|
+
} else if ("object" === typeof process && "function" === typeof process.emit) {
|
|
577
|
+
process.emit("uncaughtException", error);
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
console.error(error);
|
|
581
|
+
}, didWarnAboutMessageChannel = false, enqueueTaskImpl = null, actScopeDepth = 0, didWarnNoAwaitAct = false, isFlushing = false, queueSeveralMicrotasks = "function" === typeof queueMicrotask ? function(callback) {
|
|
582
|
+
queueMicrotask(function() {
|
|
583
|
+
return queueMicrotask(callback);
|
|
584
|
+
});
|
|
585
|
+
} : enqueueTask;
|
|
586
|
+
deprecatedAPIs = Object.freeze({
|
|
587
|
+
__proto__: null,
|
|
588
|
+
c: function(size) {
|
|
589
|
+
return resolveDispatcher().useMemoCache(size);
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
var fnName = {
|
|
593
|
+
map: mapChildren,
|
|
594
|
+
forEach: function(children, forEachFunc, forEachContext) {
|
|
595
|
+
mapChildren(
|
|
596
|
+
children,
|
|
597
|
+
function() {
|
|
598
|
+
forEachFunc.apply(this, arguments);
|
|
599
|
+
},
|
|
600
|
+
forEachContext
|
|
601
|
+
);
|
|
602
|
+
},
|
|
603
|
+
count: function(children) {
|
|
604
|
+
var n = 0;
|
|
605
|
+
mapChildren(children, function() {
|
|
606
|
+
n++;
|
|
607
|
+
});
|
|
608
|
+
return n;
|
|
609
|
+
},
|
|
610
|
+
toArray: function(children) {
|
|
611
|
+
return mapChildren(children, function(child) {
|
|
612
|
+
return child;
|
|
613
|
+
}) || [];
|
|
614
|
+
},
|
|
615
|
+
only: function(children) {
|
|
616
|
+
if (!isValidElement(children))
|
|
617
|
+
throw Error(
|
|
618
|
+
"React.Children.only expected to receive a single React element child."
|
|
619
|
+
);
|
|
620
|
+
return children;
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
624
|
+
exports.Children = fnName;
|
|
625
|
+
exports.Component = Component;
|
|
626
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
627
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
628
|
+
exports.PureComponent = PureComponent;
|
|
629
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
630
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
631
|
+
exports.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = ReactSharedInternals;
|
|
632
|
+
exports.__COMPILER_RUNTIME = deprecatedAPIs;
|
|
633
|
+
exports.act = function(callback) {
|
|
634
|
+
var prevActQueue = ReactSharedInternals.actQueue, prevActScopeDepth = actScopeDepth;
|
|
635
|
+
actScopeDepth++;
|
|
636
|
+
var queue = ReactSharedInternals.actQueue = null !== prevActQueue ? prevActQueue : [], didAwaitActCall = false;
|
|
637
|
+
try {
|
|
638
|
+
var result = callback();
|
|
639
|
+
} catch (error) {
|
|
640
|
+
ReactSharedInternals.thrownErrors.push(error);
|
|
641
|
+
}
|
|
642
|
+
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
643
|
+
throw popActScope(prevActQueue, prevActScopeDepth), callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
644
|
+
if (null !== result && "object" === typeof result && "function" === typeof result.then) {
|
|
645
|
+
var thenable = result;
|
|
646
|
+
queueSeveralMicrotasks(function() {
|
|
647
|
+
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
648
|
+
"You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"
|
|
649
|
+
));
|
|
650
|
+
});
|
|
651
|
+
return {
|
|
652
|
+
then: function(resolve, reject) {
|
|
653
|
+
didAwaitActCall = true;
|
|
654
|
+
thenable.then(
|
|
655
|
+
function(returnValue) {
|
|
656
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
657
|
+
if (0 === prevActScopeDepth) {
|
|
658
|
+
try {
|
|
659
|
+
flushActQueue(queue), enqueueTask(function() {
|
|
660
|
+
return recursivelyFlushAsyncActWork(
|
|
661
|
+
returnValue,
|
|
662
|
+
resolve,
|
|
663
|
+
reject
|
|
664
|
+
);
|
|
665
|
+
});
|
|
666
|
+
} catch (error$0) {
|
|
667
|
+
ReactSharedInternals.thrownErrors.push(error$0);
|
|
668
|
+
}
|
|
669
|
+
if (0 < ReactSharedInternals.thrownErrors.length) {
|
|
670
|
+
var _thrownError = aggregateErrors(
|
|
671
|
+
ReactSharedInternals.thrownErrors
|
|
672
|
+
);
|
|
673
|
+
ReactSharedInternals.thrownErrors.length = 0;
|
|
674
|
+
reject(_thrownError);
|
|
675
|
+
}
|
|
676
|
+
} else resolve(returnValue);
|
|
677
|
+
},
|
|
678
|
+
function(error) {
|
|
679
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
680
|
+
0 < ReactSharedInternals.thrownErrors.length ? (error = aggregateErrors(
|
|
681
|
+
ReactSharedInternals.thrownErrors
|
|
682
|
+
), ReactSharedInternals.thrownErrors.length = 0, reject(error)) : reject(error);
|
|
683
|
+
}
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
var returnValue$jscomp$0 = result;
|
|
689
|
+
popActScope(prevActQueue, prevActScopeDepth);
|
|
690
|
+
0 === prevActScopeDepth && (flushActQueue(queue), 0 !== queue.length && queueSeveralMicrotasks(function() {
|
|
691
|
+
didAwaitActCall || didWarnNoAwaitAct || (didWarnNoAwaitAct = true, console.error(
|
|
692
|
+
"A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"
|
|
693
|
+
));
|
|
694
|
+
}), ReactSharedInternals.actQueue = null);
|
|
695
|
+
if (0 < ReactSharedInternals.thrownErrors.length)
|
|
696
|
+
throw callback = aggregateErrors(ReactSharedInternals.thrownErrors), ReactSharedInternals.thrownErrors.length = 0, callback;
|
|
697
|
+
return {
|
|
698
|
+
then: function(resolve, reject) {
|
|
699
|
+
didAwaitActCall = true;
|
|
700
|
+
0 === prevActScopeDepth ? (ReactSharedInternals.actQueue = queue, enqueueTask(function() {
|
|
701
|
+
return recursivelyFlushAsyncActWork(
|
|
702
|
+
returnValue$jscomp$0,
|
|
703
|
+
resolve,
|
|
704
|
+
reject
|
|
705
|
+
);
|
|
706
|
+
})) : resolve(returnValue$jscomp$0);
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
exports.cache = function(fn) {
|
|
711
|
+
return function() {
|
|
712
|
+
return fn.apply(null, arguments);
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
exports.cacheSignal = function() {
|
|
716
|
+
return null;
|
|
717
|
+
};
|
|
718
|
+
exports.captureOwnerStack = function() {
|
|
719
|
+
var getCurrentStack = ReactSharedInternals.getCurrentStack;
|
|
720
|
+
return null === getCurrentStack ? null : getCurrentStack();
|
|
721
|
+
};
|
|
722
|
+
exports.cloneElement = function(element, config, children) {
|
|
723
|
+
if (null === element || void 0 === element)
|
|
724
|
+
throw Error(
|
|
725
|
+
"The argument must be a React element, but you passed " + element + "."
|
|
726
|
+
);
|
|
727
|
+
var props = assign({}, element.props), key = element.key, owner = element._owner;
|
|
728
|
+
if (null != config) {
|
|
729
|
+
var JSCompiler_inline_result;
|
|
730
|
+
a: {
|
|
731
|
+
if (hasOwnProperty.call(config, "ref") && (JSCompiler_inline_result = Object.getOwnPropertyDescriptor(
|
|
732
|
+
config,
|
|
733
|
+
"ref"
|
|
734
|
+
).get) && JSCompiler_inline_result.isReactWarning) {
|
|
735
|
+
JSCompiler_inline_result = false;
|
|
736
|
+
break a;
|
|
737
|
+
}
|
|
738
|
+
JSCompiler_inline_result = void 0 !== config.ref;
|
|
739
|
+
}
|
|
740
|
+
JSCompiler_inline_result && (owner = getOwner());
|
|
741
|
+
hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key);
|
|
742
|
+
for (propName in config)
|
|
743
|
+
!hasOwnProperty.call(config, propName) || "key" === propName || "__self" === propName || "__source" === propName || "ref" === propName && void 0 === config.ref || (props[propName] = config[propName]);
|
|
744
|
+
}
|
|
745
|
+
var propName = arguments.length - 2;
|
|
746
|
+
if (1 === propName) props.children = children;
|
|
747
|
+
else if (1 < propName) {
|
|
748
|
+
JSCompiler_inline_result = Array(propName);
|
|
749
|
+
for (var i = 0; i < propName; i++)
|
|
750
|
+
JSCompiler_inline_result[i] = arguments[i + 2];
|
|
751
|
+
props.children = JSCompiler_inline_result;
|
|
752
|
+
}
|
|
753
|
+
props = ReactElement(
|
|
754
|
+
element.type,
|
|
755
|
+
key,
|
|
756
|
+
props,
|
|
757
|
+
owner,
|
|
758
|
+
element._debugStack,
|
|
759
|
+
element._debugTask
|
|
760
|
+
);
|
|
761
|
+
for (key = 2; key < arguments.length; key++)
|
|
762
|
+
validateChildKeys(arguments[key]);
|
|
763
|
+
return props;
|
|
764
|
+
};
|
|
765
|
+
exports.createContext = function(defaultValue) {
|
|
766
|
+
defaultValue = {
|
|
767
|
+
$$typeof: REACT_CONTEXT_TYPE,
|
|
768
|
+
_currentValue: defaultValue,
|
|
769
|
+
_currentValue2: defaultValue,
|
|
770
|
+
_threadCount: 0,
|
|
771
|
+
Provider: null,
|
|
772
|
+
Consumer: null
|
|
773
|
+
};
|
|
774
|
+
defaultValue.Provider = defaultValue;
|
|
775
|
+
defaultValue.Consumer = {
|
|
776
|
+
$$typeof: REACT_CONSUMER_TYPE,
|
|
777
|
+
_context: defaultValue
|
|
778
|
+
};
|
|
779
|
+
defaultValue._currentRenderer = null;
|
|
780
|
+
defaultValue._currentRenderer2 = null;
|
|
781
|
+
return defaultValue;
|
|
782
|
+
};
|
|
783
|
+
exports.createElement = function(type, config, children) {
|
|
784
|
+
for (var i = 2; i < arguments.length; i++)
|
|
785
|
+
validateChildKeys(arguments[i]);
|
|
786
|
+
i = {};
|
|
787
|
+
var key = null;
|
|
788
|
+
if (null != config)
|
|
789
|
+
for (propName in didWarnAboutOldJSXRuntime || !("__self" in config) || "key" in config || (didWarnAboutOldJSXRuntime = true, console.warn(
|
|
790
|
+
"Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform"
|
|
791
|
+
)), hasValidKey(config) && (checkKeyStringCoercion(config.key), key = "" + config.key), config)
|
|
792
|
+
hasOwnProperty.call(config, propName) && "key" !== propName && "__self" !== propName && "__source" !== propName && (i[propName] = config[propName]);
|
|
793
|
+
var childrenLength = arguments.length - 2;
|
|
794
|
+
if (1 === childrenLength) i.children = children;
|
|
795
|
+
else if (1 < childrenLength) {
|
|
796
|
+
for (var childArray = Array(childrenLength), _i = 0; _i < childrenLength; _i++)
|
|
797
|
+
childArray[_i] = arguments[_i + 2];
|
|
798
|
+
Object.freeze && Object.freeze(childArray);
|
|
799
|
+
i.children = childArray;
|
|
800
|
+
}
|
|
801
|
+
if (type && type.defaultProps)
|
|
802
|
+
for (propName in childrenLength = type.defaultProps, childrenLength)
|
|
803
|
+
void 0 === i[propName] && (i[propName] = childrenLength[propName]);
|
|
804
|
+
key && defineKeyPropWarningGetter(
|
|
805
|
+
i,
|
|
806
|
+
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
807
|
+
);
|
|
808
|
+
var propName = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
809
|
+
return ReactElement(
|
|
810
|
+
type,
|
|
811
|
+
key,
|
|
812
|
+
i,
|
|
813
|
+
getOwner(),
|
|
814
|
+
propName ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
815
|
+
propName ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
816
|
+
);
|
|
817
|
+
};
|
|
818
|
+
exports.createRef = function() {
|
|
819
|
+
var refObject = { current: null };
|
|
820
|
+
Object.seal(refObject);
|
|
821
|
+
return refObject;
|
|
822
|
+
};
|
|
823
|
+
exports.forwardRef = function(render) {
|
|
824
|
+
null != render && render.$$typeof === REACT_MEMO_TYPE ? console.error(
|
|
825
|
+
"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."
|
|
826
|
+
) : "function" !== typeof render ? console.error(
|
|
827
|
+
"forwardRef requires a render function but was given %s.",
|
|
828
|
+
null === render ? "null" : typeof render
|
|
829
|
+
) : 0 !== render.length && 2 !== render.length && console.error(
|
|
830
|
+
"forwardRef render functions accept exactly two parameters: props and ref. %s",
|
|
831
|
+
1 === render.length ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."
|
|
832
|
+
);
|
|
833
|
+
null != render && null != render.defaultProps && console.error(
|
|
834
|
+
"forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?"
|
|
835
|
+
);
|
|
836
|
+
var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render }, ownName;
|
|
837
|
+
Object.defineProperty(elementType, "displayName", {
|
|
838
|
+
enumerable: false,
|
|
839
|
+
configurable: true,
|
|
840
|
+
get: function() {
|
|
841
|
+
return ownName;
|
|
842
|
+
},
|
|
843
|
+
set: function(name) {
|
|
844
|
+
ownName = name;
|
|
845
|
+
render.name || render.displayName || (Object.defineProperty(render, "name", { value: name }), render.displayName = name);
|
|
846
|
+
}
|
|
847
|
+
});
|
|
848
|
+
return elementType;
|
|
849
|
+
};
|
|
850
|
+
exports.isValidElement = isValidElement;
|
|
851
|
+
exports.lazy = function(ctor) {
|
|
852
|
+
ctor = { _status: -1, _result: ctor };
|
|
853
|
+
var lazyType = {
|
|
854
|
+
$$typeof: REACT_LAZY_TYPE,
|
|
855
|
+
_payload: ctor,
|
|
856
|
+
_init: lazyInitializer
|
|
857
|
+
}, ioInfo = {
|
|
858
|
+
name: "lazy",
|
|
859
|
+
start: -1,
|
|
860
|
+
end: -1,
|
|
861
|
+
value: null,
|
|
862
|
+
owner: null,
|
|
863
|
+
debugStack: Error("react-stack-top-frame"),
|
|
864
|
+
debugTask: console.createTask ? console.createTask("lazy()") : null
|
|
865
|
+
};
|
|
866
|
+
ctor._ioInfo = ioInfo;
|
|
867
|
+
lazyType._debugInfo = [{ awaited: ioInfo }];
|
|
868
|
+
return lazyType;
|
|
869
|
+
};
|
|
870
|
+
exports.memo = function(type, compare) {
|
|
871
|
+
null == type && console.error(
|
|
872
|
+
"memo: The first argument must be a component. Instead received: %s",
|
|
873
|
+
null === type ? "null" : typeof type
|
|
874
|
+
);
|
|
875
|
+
compare = {
|
|
876
|
+
$$typeof: REACT_MEMO_TYPE,
|
|
877
|
+
type,
|
|
878
|
+
compare: void 0 === compare ? null : compare
|
|
879
|
+
};
|
|
880
|
+
var ownName;
|
|
881
|
+
Object.defineProperty(compare, "displayName", {
|
|
882
|
+
enumerable: false,
|
|
883
|
+
configurable: true,
|
|
884
|
+
get: function() {
|
|
885
|
+
return ownName;
|
|
886
|
+
},
|
|
887
|
+
set: function(name) {
|
|
888
|
+
ownName = name;
|
|
889
|
+
type.name || type.displayName || (Object.defineProperty(type, "name", { value: name }), type.displayName = name);
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
return compare;
|
|
893
|
+
};
|
|
894
|
+
exports.startTransition = function(scope) {
|
|
895
|
+
var prevTransition = ReactSharedInternals.T, currentTransition = {};
|
|
896
|
+
currentTransition._updatedFibers = /* @__PURE__ */ new Set();
|
|
897
|
+
ReactSharedInternals.T = currentTransition;
|
|
898
|
+
try {
|
|
899
|
+
var returnValue = scope(), onStartTransitionFinish = ReactSharedInternals.S;
|
|
900
|
+
null !== onStartTransitionFinish && onStartTransitionFinish(currentTransition, returnValue);
|
|
901
|
+
"object" === typeof returnValue && null !== returnValue && "function" === typeof returnValue.then && (ReactSharedInternals.asyncTransitions++, returnValue.then(releaseAsyncTransition, releaseAsyncTransition), returnValue.then(noop, reportGlobalError));
|
|
902
|
+
} catch (error) {
|
|
903
|
+
reportGlobalError(error);
|
|
904
|
+
} finally {
|
|
905
|
+
null === prevTransition && currentTransition._updatedFibers && (scope = currentTransition._updatedFibers.size, currentTransition._updatedFibers.clear(), 10 < scope && console.warn(
|
|
906
|
+
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
|
|
907
|
+
)), null !== prevTransition && null !== currentTransition.types && (null !== prevTransition.types && prevTransition.types !== currentTransition.types && console.error(
|
|
908
|
+
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
|
|
909
|
+
), prevTransition.types = currentTransition.types), ReactSharedInternals.T = prevTransition;
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
exports.unstable_useCacheRefresh = function() {
|
|
913
|
+
return resolveDispatcher().useCacheRefresh();
|
|
914
|
+
};
|
|
915
|
+
exports.use = function(usable) {
|
|
916
|
+
return resolveDispatcher().use(usable);
|
|
917
|
+
};
|
|
918
|
+
exports.useActionState = function(action, initialState, permalink) {
|
|
919
|
+
return resolveDispatcher().useActionState(
|
|
920
|
+
action,
|
|
921
|
+
initialState,
|
|
922
|
+
permalink
|
|
923
|
+
);
|
|
924
|
+
};
|
|
925
|
+
exports.useCallback = function(callback, deps) {
|
|
926
|
+
return resolveDispatcher().useCallback(callback, deps);
|
|
927
|
+
};
|
|
928
|
+
exports.useContext = function(Context) {
|
|
929
|
+
var dispatcher = resolveDispatcher();
|
|
930
|
+
Context.$$typeof === REACT_CONSUMER_TYPE && console.error(
|
|
931
|
+
"Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"
|
|
932
|
+
);
|
|
933
|
+
return dispatcher.useContext(Context);
|
|
934
|
+
};
|
|
935
|
+
exports.useDebugValue = function(value, formatterFn) {
|
|
936
|
+
return resolveDispatcher().useDebugValue(value, formatterFn);
|
|
937
|
+
};
|
|
938
|
+
exports.useDeferredValue = function(value, initialValue) {
|
|
939
|
+
return resolveDispatcher().useDeferredValue(value, initialValue);
|
|
940
|
+
};
|
|
941
|
+
exports.useEffect = function(create, deps) {
|
|
942
|
+
null == create && console.warn(
|
|
943
|
+
"React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
944
|
+
);
|
|
945
|
+
return resolveDispatcher().useEffect(create, deps);
|
|
946
|
+
};
|
|
947
|
+
exports.useEffectEvent = function(callback) {
|
|
948
|
+
return resolveDispatcher().useEffectEvent(callback);
|
|
949
|
+
};
|
|
950
|
+
exports.useId = function() {
|
|
951
|
+
return resolveDispatcher().useId();
|
|
952
|
+
};
|
|
953
|
+
exports.useImperativeHandle = function(ref, create, deps) {
|
|
954
|
+
return resolveDispatcher().useImperativeHandle(ref, create, deps);
|
|
955
|
+
};
|
|
956
|
+
exports.useInsertionEffect = function(create, deps) {
|
|
957
|
+
null == create && console.warn(
|
|
958
|
+
"React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
959
|
+
);
|
|
960
|
+
return resolveDispatcher().useInsertionEffect(create, deps);
|
|
961
|
+
};
|
|
962
|
+
exports.useLayoutEffect = function(create, deps) {
|
|
963
|
+
null == create && console.warn(
|
|
964
|
+
"React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"
|
|
965
|
+
);
|
|
966
|
+
return resolveDispatcher().useLayoutEffect(create, deps);
|
|
967
|
+
};
|
|
968
|
+
exports.useMemo = function(create, deps) {
|
|
969
|
+
return resolveDispatcher().useMemo(create, deps);
|
|
970
|
+
};
|
|
971
|
+
exports.useOptimistic = function(passthrough, reducer) {
|
|
972
|
+
return resolveDispatcher().useOptimistic(passthrough, reducer);
|
|
973
|
+
};
|
|
974
|
+
exports.useReducer = function(reducer, initialArg, init) {
|
|
975
|
+
return resolveDispatcher().useReducer(reducer, initialArg, init);
|
|
976
|
+
};
|
|
977
|
+
exports.useRef = function(initialValue) {
|
|
978
|
+
return resolveDispatcher().useRef(initialValue);
|
|
979
|
+
};
|
|
980
|
+
exports.useState = function(initialState) {
|
|
981
|
+
return resolveDispatcher().useState(initialState);
|
|
982
|
+
};
|
|
983
|
+
exports.useSyncExternalStore = function(subscribe, getSnapshot, getServerSnapshot) {
|
|
984
|
+
return resolveDispatcher().useSyncExternalStore(
|
|
985
|
+
subscribe,
|
|
986
|
+
getSnapshot,
|
|
987
|
+
getServerSnapshot
|
|
988
|
+
);
|
|
989
|
+
};
|
|
990
|
+
exports.useTransition = function() {
|
|
991
|
+
return resolveDispatcher().useTransition();
|
|
992
|
+
};
|
|
993
|
+
exports.version = "19.2.0";
|
|
994
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
995
|
+
})();
|
|
996
|
+
}
|
|
997
|
+
});
|
|
998
|
+
|
|
999
|
+
// node_modules/react/index.js
|
|
1000
|
+
var require_react = __commonJS({
|
|
1001
|
+
"node_modules/react/index.js"(exports, module) {
|
|
1002
|
+
"use strict";
|
|
1003
|
+
if (false) {
|
|
1004
|
+
module.exports = null;
|
|
1005
|
+
} else {
|
|
1006
|
+
module.exports = require_react_development();
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
|
|
1
1011
|
// src/provider.js
|
|
2
|
-
|
|
1012
|
+
var import_react = __toESM(require_react(), 1);
|
|
3
1013
|
|
|
4
1014
|
// src/securityUtils.js
|
|
5
1015
|
function isSecureContext() {
|
|
@@ -29,19 +1039,19 @@ function getSafeErrorMessage(error) {
|
|
|
29
1039
|
}
|
|
30
1040
|
|
|
31
1041
|
// src/provider.js
|
|
32
|
-
var AuthContext = createContext(null);
|
|
33
|
-
var
|
|
34
|
-
const [ready, setReady] = useState(false);
|
|
35
|
-
const [error, setError] = useState(null);
|
|
36
|
-
const [user, setUser] = useState(null);
|
|
37
|
-
const [loadingUser, setLoadingUser] = useState(true);
|
|
38
|
-
const [sessionTimeout, setSessionTimeout] = useState(null);
|
|
39
|
-
const redirectedRef = useRef(false);
|
|
40
|
-
const sessionTimerRef = useRef(null);
|
|
41
|
-
useEffect(() => {
|
|
1042
|
+
var AuthContext = (0, import_react.createContext)(null);
|
|
1043
|
+
var FlowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) => {
|
|
1044
|
+
const [ready, setReady] = (0, import_react.useState)(false);
|
|
1045
|
+
const [error, setError] = (0, import_react.useState)(null);
|
|
1046
|
+
const [user, setUser] = (0, import_react.useState)(null);
|
|
1047
|
+
const [loadingUser, setLoadingUser] = (0, import_react.useState)(true);
|
|
1048
|
+
const [sessionTimeout, setSessionTimeout] = (0, import_react.useState)(null);
|
|
1049
|
+
const redirectedRef = (0, import_react.useRef)(false);
|
|
1050
|
+
const sessionTimerRef = (0, import_react.useRef)(null);
|
|
1051
|
+
(0, import_react.useEffect)(() => {
|
|
42
1052
|
checkSecureContext();
|
|
43
1053
|
}, []);
|
|
44
|
-
useEffect(() => {
|
|
1054
|
+
(0, import_react.useEffect)(() => {
|
|
45
1055
|
if (!publishableKey || !publishableKey.trim()) {
|
|
46
1056
|
setError("Missing publishable key");
|
|
47
1057
|
setReady(false);
|
|
@@ -58,7 +1068,7 @@ var flowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
|
|
|
58
1068
|
setError(null);
|
|
59
1069
|
setReady(true);
|
|
60
1070
|
}, [publishableKey, baseUrl]);
|
|
61
|
-
const normalizedBase = useCallback(() => {
|
|
1071
|
+
const normalizedBase = (0, import_react.useCallback)(() => {
|
|
62
1072
|
return baseUrl?.replace(/\/+$/, "") || "";
|
|
63
1073
|
}, [baseUrl]);
|
|
64
1074
|
const redirectTo = (url, { replace = true } = {}) => {
|
|
@@ -75,7 +1085,7 @@ var flowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
|
|
|
75
1085
|
window.location.href = url;
|
|
76
1086
|
}
|
|
77
1087
|
};
|
|
78
|
-
const resetSessionTimeout = useCallback(() => {
|
|
1088
|
+
const resetSessionTimeout = (0, import_react.useCallback)(() => {
|
|
79
1089
|
if (sessionTimerRef.current) {
|
|
80
1090
|
clearTimeout(sessionTimerRef.current);
|
|
81
1091
|
}
|
|
@@ -84,7 +1094,7 @@ var flowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
|
|
|
84
1094
|
logout();
|
|
85
1095
|
}, 24 * 60 * 60 * 1e3);
|
|
86
1096
|
}, []);
|
|
87
|
-
const fetchMe = useCallback(async () => {
|
|
1097
|
+
const fetchMe = (0, import_react.useCallback)(async () => {
|
|
88
1098
|
setLoadingUser(true);
|
|
89
1099
|
try {
|
|
90
1100
|
const base = normalizedBase();
|
|
@@ -120,7 +1130,7 @@ var flowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
|
|
|
120
1130
|
return null;
|
|
121
1131
|
}
|
|
122
1132
|
}, [normalizedBase, resetSessionTimeout]);
|
|
123
|
-
useEffect(() => {
|
|
1133
|
+
(0, import_react.useEffect)(() => {
|
|
124
1134
|
if (!ready) return;
|
|
125
1135
|
fetchMe();
|
|
126
1136
|
const onStorage = (e) => {
|
|
@@ -138,7 +1148,7 @@ var flowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
|
|
|
138
1148
|
}
|
|
139
1149
|
};
|
|
140
1150
|
}, [ready, fetchMe]);
|
|
141
|
-
useEffect(() => {
|
|
1151
|
+
(0, import_react.useEffect)(() => {
|
|
142
1152
|
if (!ready) return;
|
|
143
1153
|
if (loadingUser) return;
|
|
144
1154
|
if (!user) {
|
|
@@ -150,7 +1160,7 @@ var flowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
|
|
|
150
1160
|
redirectTo(redirect, { replace: true });
|
|
151
1161
|
}
|
|
152
1162
|
}, [ready, loadingUser, user, redirect]);
|
|
153
|
-
const completeLogin = useCallback(async (opts = {}) => {
|
|
1163
|
+
const completeLogin = (0, import_react.useCallback)(async (opts = {}) => {
|
|
154
1164
|
const { redirectTo: redirectUrl, replace = true } = opts;
|
|
155
1165
|
const u = await fetchMe();
|
|
156
1166
|
try {
|
|
@@ -163,7 +1173,7 @@ var flowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
|
|
|
163
1173
|
}
|
|
164
1174
|
return u;
|
|
165
1175
|
}, [fetchMe, redirect]);
|
|
166
|
-
const logout = useCallback(async (opts = {}) => {
|
|
1176
|
+
const logout = (0, import_react.useCallback)(async (opts = {}) => {
|
|
167
1177
|
const { callServer = true, redirectTo: redirectUrl, replace = true } = opts;
|
|
168
1178
|
const base = normalizedBase();
|
|
169
1179
|
if (callServer && base) {
|
|
@@ -195,17 +1205,17 @@ var flowlinkAuthProvider = ({ children, publishableKey, baseUrl, redirect }) =>
|
|
|
195
1205
|
logout,
|
|
196
1206
|
completeLogin
|
|
197
1207
|
};
|
|
198
|
-
return /* @__PURE__ */
|
|
1208
|
+
return /* @__PURE__ */ import_react.default.createElement(AuthContext.Provider, { value }, error ? /* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "20px", background: "#220000", color: "white" } }, /* @__PURE__ */ import_react.default.createElement("h2", null, "flowlink Auth Error"), /* @__PURE__ */ import_react.default.createElement("p", null, error)) : !ready ? null : children);
|
|
199
1209
|
};
|
|
200
1210
|
var useAuth = () => {
|
|
201
|
-
const ctx = useContext(AuthContext);
|
|
202
|
-
if (!ctx) throw new Error("useAuth must be used within
|
|
1211
|
+
const ctx = (0, import_react.useContext)(AuthContext);
|
|
1212
|
+
if (!ctx) throw new Error("useAuth must be used within FlowlinkAuthProvider");
|
|
203
1213
|
return ctx;
|
|
204
1214
|
};
|
|
205
|
-
var provider_default =
|
|
1215
|
+
var provider_default = FlowlinkAuthProvider;
|
|
206
1216
|
|
|
207
1217
|
// src/SignIn.jsx
|
|
208
|
-
|
|
1218
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
209
1219
|
function SignIn({ onSuccess } = {}) {
|
|
210
1220
|
const {
|
|
211
1221
|
publishableKey,
|
|
@@ -218,11 +1228,11 @@ function SignIn({ onSuccess } = {}) {
|
|
|
218
1228
|
fetchMe,
|
|
219
1229
|
setUser
|
|
220
1230
|
} = useAuth();
|
|
221
|
-
const [email, setEmail] =
|
|
222
|
-
const [password, setPassword] =
|
|
223
|
-
const [loading, setLoading] =
|
|
224
|
-
const [error, setError] =
|
|
225
|
-
const [message, setMessage] =
|
|
1231
|
+
const [email, setEmail] = (0, import_react2.useState)("");
|
|
1232
|
+
const [password, setPassword] = (0, import_react2.useState)("");
|
|
1233
|
+
const [loading, setLoading] = (0, import_react2.useState)(false);
|
|
1234
|
+
const [error, setError] = (0, import_react2.useState)(null);
|
|
1235
|
+
const [message, setMessage] = (0, import_react2.useState)(null);
|
|
226
1236
|
if (loadingUser) return null;
|
|
227
1237
|
if (user && redirect) {
|
|
228
1238
|
if (typeof redirectTo === "function") redirectTo(redirect);
|
|
@@ -326,7 +1336,7 @@ function SignIn({ onSuccess } = {}) {
|
|
|
326
1336
|
if (e && typeof e.preventDefault === "function") e.preventDefault();
|
|
327
1337
|
startOAuthFlow("github");
|
|
328
1338
|
};
|
|
329
|
-
return /* @__PURE__ */
|
|
1339
|
+
return /* @__PURE__ */ import_react2.default.createElement("div", { style: overlay }, /* @__PURE__ */ import_react2.default.createElement("div", { style: modal }, /* @__PURE__ */ import_react2.default.createElement("h2", { style: title }, "Sign in"), /* @__PURE__ */ import_react2.default.createElement("p", { style: subtitle }, "Welcome back \u2014 enter your credentials."), /* @__PURE__ */ import_react2.default.createElement("form", { onSubmit: submit, style: { width: "100%" } }, /* @__PURE__ */ import_react2.default.createElement("label", { style: label }, "Email"), /* @__PURE__ */ import_react2.default.createElement(
|
|
330
1340
|
"input",
|
|
331
1341
|
{
|
|
332
1342
|
style: input,
|
|
@@ -335,7 +1345,7 @@ function SignIn({ onSuccess } = {}) {
|
|
|
335
1345
|
type: "email",
|
|
336
1346
|
required: true
|
|
337
1347
|
}
|
|
338
|
-
), /* @__PURE__ */
|
|
1348
|
+
), /* @__PURE__ */ import_react2.default.createElement("label", { style: label }, "Password"), /* @__PURE__ */ import_react2.default.createElement(
|
|
339
1349
|
"input",
|
|
340
1350
|
{
|
|
341
1351
|
style: input,
|
|
@@ -344,7 +1354,7 @@ function SignIn({ onSuccess } = {}) {
|
|
|
344
1354
|
onChange: (e) => setPassword(e.target.value),
|
|
345
1355
|
required: true
|
|
346
1356
|
}
|
|
347
|
-
), /* @__PURE__ */
|
|
1357
|
+
), /* @__PURE__ */ import_react2.default.createElement("div", { style: { marginTop: 12 } }, /* @__PURE__ */ import_react2.default.createElement("button", { style: button, type: "submit", disabled: loading }, loading ? "Signing in\u2026" : "Sign in")), /* @__PURE__ */ import_react2.default.createElement("div", { style: { display: "flex", gap: 8, marginTop: 16 } }, /* @__PURE__ */ import_react2.default.createElement("button", { type: "button", onClick: handleGoogle, style: oauthButtonGoogle, disabled: loading }, "Continue with Google"), /* @__PURE__ */ import_react2.default.createElement("button", { type: "button", onClick: handleGithub, style: oauthButtonGithub, disabled: loading }, "Continue with GitHub")), error && /* @__PURE__ */ import_react2.default.createElement("div", { style: errorBox }, error), message && /* @__PURE__ */ import_react2.default.createElement("div", { style: successBox }, message))));
|
|
348
1358
|
}
|
|
349
1359
|
var overlay = { position: "fixed", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(0,0,0,0.45)", zIndex: 9999, padding: 20 };
|
|
350
1360
|
var modal = { width: "100%", maxWidth: 420, background: "#0f1724", color: "#fff", borderRadius: 12, padding: 22, boxShadow: "0 10px 30px rgba(2,6,23,0.6)", border: "1px solid rgba(255,255,255,0.04)" };
|
|
@@ -359,7 +1369,7 @@ var errorBox = { marginTop: 10, color: "#ffb4b4", fontSize: 13 };
|
|
|
359
1369
|
var successBox = { marginTop: 10, color: "#bef264", fontSize: 13 };
|
|
360
1370
|
|
|
361
1371
|
// src/SignUp.jsx
|
|
362
|
-
|
|
1372
|
+
var import_react3 = __toESM(require_react(), 1);
|
|
363
1373
|
function SignUp() {
|
|
364
1374
|
const {
|
|
365
1375
|
publishableKey,
|
|
@@ -371,12 +1381,12 @@ function SignUp() {
|
|
|
371
1381
|
fetchMe,
|
|
372
1382
|
setUser
|
|
373
1383
|
} = useAuth();
|
|
374
|
-
const [name, setName] =
|
|
375
|
-
const [email, setEmail] =
|
|
376
|
-
const [password, setPassword] =
|
|
377
|
-
const [loading, setLoading] =
|
|
378
|
-
const [error, setError] =
|
|
379
|
-
const [message, setMessage] =
|
|
1384
|
+
const [name, setName] = (0, import_react3.useState)("");
|
|
1385
|
+
const [email, setEmail] = (0, import_react3.useState)("");
|
|
1386
|
+
const [password, setPassword] = (0, import_react3.useState)("");
|
|
1387
|
+
const [loading, setLoading] = (0, import_react3.useState)(false);
|
|
1388
|
+
const [error, setError] = (0, import_react3.useState)(null);
|
|
1389
|
+
const [message, setMessage] = (0, import_react3.useState)(null);
|
|
380
1390
|
if (loadingUser) return null;
|
|
381
1391
|
if (user && redirect) {
|
|
382
1392
|
if (typeof redirectTo === "function") redirectTo(redirect);
|
|
@@ -456,7 +1466,7 @@ function SignUp() {
|
|
|
456
1466
|
if (e && typeof e.preventDefault === "function") e.preventDefault();
|
|
457
1467
|
startOAuthFlow("github");
|
|
458
1468
|
};
|
|
459
|
-
return /* @__PURE__ */
|
|
1469
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", { style: overlay2 }, /* @__PURE__ */ import_react3.default.createElement("div", { style: modal2 }, /* @__PURE__ */ import_react3.default.createElement("h2", { style: title2 }, "Create account"), /* @__PURE__ */ import_react3.default.createElement("form", { onSubmit: submit }, /* @__PURE__ */ import_react3.default.createElement("label", { style: label2 }, "Full name"), /* @__PURE__ */ import_react3.default.createElement(
|
|
460
1470
|
"input",
|
|
461
1471
|
{
|
|
462
1472
|
name: "name",
|
|
@@ -465,7 +1475,7 @@ function SignUp() {
|
|
|
465
1475
|
onChange: (e) => setName(e.target.value),
|
|
466
1476
|
autoComplete: "name"
|
|
467
1477
|
}
|
|
468
|
-
), /* @__PURE__ */
|
|
1478
|
+
), /* @__PURE__ */ import_react3.default.createElement("label", { style: label2 }, "Email"), /* @__PURE__ */ import_react3.default.createElement(
|
|
469
1479
|
"input",
|
|
470
1480
|
{
|
|
471
1481
|
name: "email",
|
|
@@ -476,7 +1486,7 @@ function SignUp() {
|
|
|
476
1486
|
required: true,
|
|
477
1487
|
autoComplete: "email"
|
|
478
1488
|
}
|
|
479
|
-
), /* @__PURE__ */
|
|
1489
|
+
), /* @__PURE__ */ import_react3.default.createElement("label", { style: label2 }, "Password"), /* @__PURE__ */ import_react3.default.createElement(
|
|
480
1490
|
"input",
|
|
481
1491
|
{
|
|
482
1492
|
name: "password",
|
|
@@ -487,7 +1497,7 @@ function SignUp() {
|
|
|
487
1497
|
required: true,
|
|
488
1498
|
autoComplete: "new-password"
|
|
489
1499
|
}
|
|
490
|
-
), /* @__PURE__ */
|
|
1500
|
+
), /* @__PURE__ */ import_react3.default.createElement("div", { style: { marginTop: 12 } }, /* @__PURE__ */ import_react3.default.createElement("button", { style: button2, type: "submit", disabled: loading }, loading ? "Creating..." : "Create account")), /* @__PURE__ */ import_react3.default.createElement("div", { style: { display: "flex", gap: 8, marginTop: 16 } }, /* @__PURE__ */ import_react3.default.createElement(
|
|
491
1501
|
"button",
|
|
492
1502
|
{
|
|
493
1503
|
type: "button",
|
|
@@ -495,7 +1505,7 @@ function SignUp() {
|
|
|
495
1505
|
style: oauthButtonGoogle2
|
|
496
1506
|
},
|
|
497
1507
|
"Continue with Google"
|
|
498
|
-
), /* @__PURE__ */
|
|
1508
|
+
), /* @__PURE__ */ import_react3.default.createElement(
|
|
499
1509
|
"button",
|
|
500
1510
|
{
|
|
501
1511
|
type: "button",
|
|
@@ -503,7 +1513,7 @@ function SignUp() {
|
|
|
503
1513
|
style: oauthButtonGithub2
|
|
504
1514
|
},
|
|
505
1515
|
"Continue with GitHub"
|
|
506
|
-
)), error && /* @__PURE__ */
|
|
1516
|
+
)), error && /* @__PURE__ */ import_react3.default.createElement("div", { style: errorBox2 }, error), message && /* @__PURE__ */ import_react3.default.createElement("div", { style: successBox2 }, message))));
|
|
507
1517
|
}
|
|
508
1518
|
var overlay2 = {
|
|
509
1519
|
position: "fixed",
|
|
@@ -566,9 +1576,21 @@ var oauthButtonGithub2 = {
|
|
|
566
1576
|
var errorBox2 = { marginTop: 10, color: "#ffb4b4", fontSize: 13 };
|
|
567
1577
|
var successBox2 = { marginTop: 10, color: "#bef264", fontSize: 13 };
|
|
568
1578
|
export {
|
|
569
|
-
provider_default as
|
|
1579
|
+
provider_default as FlowlinkAuthProvider,
|
|
570
1580
|
SignIn,
|
|
571
1581
|
SignUp,
|
|
572
1582
|
useAuth
|
|
573
1583
|
};
|
|
574
|
-
|
|
1584
|
+
/*! Bundled license information:
|
|
1585
|
+
|
|
1586
|
+
react/cjs/react.development.js:
|
|
1587
|
+
(**
|
|
1588
|
+
* @license React
|
|
1589
|
+
* react.development.js
|
|
1590
|
+
*
|
|
1591
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1592
|
+
*
|
|
1593
|
+
* This source code is licensed under the MIT license found in the
|
|
1594
|
+
* LICENSE file in the root directory of this source tree.
|
|
1595
|
+
*)
|
|
1596
|
+
*/
|