flowlink-auth 2.7.7 → 2.7.8

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.
Files changed (3) hide show
  1. package/dist/index.js +242 -582
  2. package/package.json +1 -1
  3. package/src/SignUp.jsx +205 -113
package/dist/index.js CHANGED
@@ -13,13 +13,13 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
13
13
  var __commonJS = (cb, mod) => function __require2() {
14
14
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
15
  };
16
- var __copyProps = (to2, from, except, desc) => {
16
+ var __copyProps = (to, from, except, desc) => {
17
17
  if (from && typeof from === "object" || typeof from === "function") {
18
18
  for (let key of __getOwnPropNames(from))
19
- if (!__hasOwnProp.call(to2, key) && key !== except)
20
- __defProp(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
21
  }
22
- return to2;
22
+ return to;
23
23
  };
24
24
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
25
  // If the importer is in node compatibility mode or this is not an ESM
@@ -660,15 +660,15 @@ var require_sorted_routes = __commonJS({
660
660
  routes.push(...this.children.get("[]")._smoosh(`${prefix}[${this.slugName}]/`));
661
661
  }
662
662
  if (!this.placeholder) {
663
- const r2 = prefix === "/" ? "/" : prefix.slice(0, -1);
663
+ const r = prefix === "/" ? "/" : prefix.slice(0, -1);
664
664
  if (this.optionalRestSlugName != null) {
665
- throw Object.defineProperty(new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${r2}" and "${r2}[[...${this.optionalRestSlugName}]]").`), "__NEXT_ERROR_CODE", {
665
+ throw Object.defineProperty(new Error(`You cannot define a route with the same specificity as a optional catch-all route ("${r}" and "${r}[[...${this.optionalRestSlugName}]]").`), "__NEXT_ERROR_CODE", {
666
666
  value: "E458",
667
667
  enumerable: false,
668
668
  configurable: true
669
669
  });
670
670
  }
671
- routes.unshift(r2);
671
+ routes.unshift(r);
672
672
  }
673
673
  if (this.restSlugName !== null) {
674
674
  routes.push(...this.children.get("[...]")._smoosh(`${prefix}[...${this.restSlugName}]/`));
@@ -1145,28 +1145,28 @@ var require_path_to_regexp = __commonJS({
1145
1145
  n.pathToRegexp = n.tokensToRegexp = n.regexpToFunction = n.match = n.tokensToFunction = n.compile = n.parse = void 0;
1146
1146
  function lexer(e2) {
1147
1147
  var n2 = [];
1148
- var r2 = 0;
1149
- while (r2 < e2.length) {
1150
- var t = e2[r2];
1148
+ var r = 0;
1149
+ while (r < e2.length) {
1150
+ var t = e2[r];
1151
1151
  if (t === "*" || t === "+" || t === "?") {
1152
- n2.push({ type: "MODIFIER", index: r2, value: e2[r2++] });
1152
+ n2.push({ type: "MODIFIER", index: r, value: e2[r++] });
1153
1153
  continue;
1154
1154
  }
1155
1155
  if (t === "\\") {
1156
- n2.push({ type: "ESCAPED_CHAR", index: r2++, value: e2[r2++] });
1156
+ n2.push({ type: "ESCAPED_CHAR", index: r++, value: e2[r++] });
1157
1157
  continue;
1158
1158
  }
1159
1159
  if (t === "{") {
1160
- n2.push({ type: "OPEN", index: r2, value: e2[r2++] });
1160
+ n2.push({ type: "OPEN", index: r, value: e2[r++] });
1161
1161
  continue;
1162
1162
  }
1163
1163
  if (t === "}") {
1164
- n2.push({ type: "CLOSE", index: r2, value: e2[r2++] });
1164
+ n2.push({ type: "CLOSE", index: r, value: e2[r++] });
1165
1165
  continue;
1166
1166
  }
1167
1167
  if (t === ":") {
1168
1168
  var a = "";
1169
- var i = r2 + 1;
1169
+ var i = r + 1;
1170
1170
  while (i < e2.length) {
1171
1171
  var o = e2.charCodeAt(i);
1172
1172
  if (o >= 48 && o <= 57 || o >= 65 && o <= 90 || o >= 97 && o <= 122 || o === 95) {
@@ -1175,15 +1175,15 @@ var require_path_to_regexp = __commonJS({
1175
1175
  }
1176
1176
  break;
1177
1177
  }
1178
- if (!a) throw new TypeError("Missing parameter name at ".concat(r2));
1179
- n2.push({ type: "NAME", index: r2, value: a });
1180
- r2 = i;
1178
+ if (!a) throw new TypeError("Missing parameter name at ".concat(r));
1179
+ n2.push({ type: "NAME", index: r, value: a });
1180
+ r = i;
1181
1181
  continue;
1182
1182
  }
1183
1183
  if (t === "(") {
1184
1184
  var c = 1;
1185
1185
  var f = "";
1186
- var i = r2 + 1;
1186
+ var i = r + 1;
1187
1187
  if (e2[i] === "?") {
1188
1188
  throw new TypeError('Pattern cannot start with "?" at '.concat(i));
1189
1189
  }
@@ -1206,34 +1206,34 @@ var require_path_to_regexp = __commonJS({
1206
1206
  }
1207
1207
  f += e2[i++];
1208
1208
  }
1209
- if (c) throw new TypeError("Unbalanced pattern at ".concat(r2));
1210
- if (!f) throw new TypeError("Missing pattern at ".concat(r2));
1211
- n2.push({ type: "PATTERN", index: r2, value: f });
1212
- r2 = i;
1209
+ if (c) throw new TypeError("Unbalanced pattern at ".concat(r));
1210
+ if (!f) throw new TypeError("Missing pattern at ".concat(r));
1211
+ n2.push({ type: "PATTERN", index: r, value: f });
1212
+ r = i;
1213
1213
  continue;
1214
1214
  }
1215
- n2.push({ type: "CHAR", index: r2, value: e2[r2++] });
1215
+ n2.push({ type: "CHAR", index: r, value: e2[r++] });
1216
1216
  }
1217
- n2.push({ type: "END", index: r2, value: "" });
1217
+ n2.push({ type: "END", index: r, value: "" });
1218
1218
  return n2;
1219
1219
  }
1220
1220
  function parse(e2, n2) {
1221
1221
  if (n2 === void 0) {
1222
1222
  n2 = {};
1223
1223
  }
1224
- var r2 = lexer(e2);
1224
+ var r = lexer(e2);
1225
1225
  var t = n2.prefixes, a = t === void 0 ? "./" : t, i = n2.delimiter, o = i === void 0 ? "/#?" : i;
1226
1226
  var c = [];
1227
1227
  var f = 0;
1228
1228
  var u = 0;
1229
1229
  var p = "";
1230
1230
  var tryConsume = function(e3) {
1231
- if (u < r2.length && r2[u].type === e3) return r2[u++].value;
1231
+ if (u < r.length && r[u].type === e3) return r[u++].value;
1232
1232
  };
1233
1233
  var mustConsume = function(e3) {
1234
1234
  var n3 = tryConsume(e3);
1235
1235
  if (n3 !== void 0) return n3;
1236
- var t2 = r2[u], a2 = t2.type, i2 = t2.index;
1236
+ var t2 = r[u], a2 = t2.type, i2 = t2.index;
1237
1237
  throw new TypeError("Unexpected ".concat(a2, " at ").concat(i2, ", expected ").concat(e3));
1238
1238
  };
1239
1239
  var consumeText = function() {
@@ -1245,22 +1245,22 @@ var require_path_to_regexp = __commonJS({
1245
1245
  return e3;
1246
1246
  };
1247
1247
  var isSafe = function(e3) {
1248
- for (var n3 = 0, r3 = o; n3 < r3.length; n3++) {
1249
- var t2 = r3[n3];
1248
+ for (var n3 = 0, r2 = o; n3 < r2.length; n3++) {
1249
+ var t2 = r2[n3];
1250
1250
  if (e3.indexOf(t2) > -1) return true;
1251
1251
  }
1252
1252
  return false;
1253
1253
  };
1254
1254
  var safePattern = function(e3) {
1255
1255
  var n3 = c[c.length - 1];
1256
- var r3 = e3 || (n3 && typeof n3 === "string" ? n3 : "");
1257
- if (n3 && !r3) {
1256
+ var r2 = e3 || (n3 && typeof n3 === "string" ? n3 : "");
1257
+ if (n3 && !r2) {
1258
1258
  throw new TypeError('Must have text between two parameters, missing text after "'.concat(n3.name, '"'));
1259
1259
  }
1260
- if (!r3 || isSafe(r3)) return "[^".concat(escapeString(o), "]+?");
1261
- return "(?:(?!".concat(escapeString(r3), ")[^").concat(escapeString(o), "])+?");
1260
+ if (!r2 || isSafe(r2)) return "[^".concat(escapeString(o), "]+?");
1261
+ return "(?:(?!".concat(escapeString(r2), ")[^").concat(escapeString(o), "])+?");
1262
1262
  };
1263
- while (u < r2.length) {
1263
+ while (u < r.length) {
1264
1264
  var v = tryConsume("CHAR");
1265
1265
  var s = tryConsume("NAME");
1266
1266
  var d = tryConsume("PATTERN");
@@ -1309,21 +1309,21 @@ var require_path_to_regexp = __commonJS({
1309
1309
  if (n2 === void 0) {
1310
1310
  n2 = {};
1311
1311
  }
1312
- var r2 = flags(n2);
1312
+ var r = flags(n2);
1313
1313
  var t = n2.encode, a = t === void 0 ? function(e3) {
1314
1314
  return e3;
1315
1315
  } : t, i = n2.validate, o = i === void 0 ? true : i;
1316
1316
  var c = e2.map((function(e3) {
1317
1317
  if (typeof e3 === "object") {
1318
- return new RegExp("^(?:".concat(e3.pattern, ")$"), r2);
1318
+ return new RegExp("^(?:".concat(e3.pattern, ")$"), r);
1319
1319
  }
1320
1320
  }));
1321
1321
  return function(n3) {
1322
- var r3 = "";
1322
+ var r2 = "";
1323
1323
  for (var t2 = 0; t2 < e2.length; t2++) {
1324
1324
  var i2 = e2[t2];
1325
1325
  if (typeof i2 === "string") {
1326
- r3 += i2;
1326
+ r2 += i2;
1327
1327
  continue;
1328
1328
  }
1329
1329
  var f = n3 ? n3[i2.name] : void 0;
@@ -1342,7 +1342,7 @@ var require_path_to_regexp = __commonJS({
1342
1342
  if (o && !c[t2].test(s)) {
1343
1343
  throw new TypeError('Expected all "'.concat(i2.name, '" to match "').concat(i2.pattern, '", but got "').concat(s, '"'));
1344
1344
  }
1345
- r3 += i2.prefix + s + i2.suffix;
1345
+ r2 += i2.prefix + s + i2.suffix;
1346
1346
  }
1347
1347
  continue;
1348
1348
  }
@@ -1351,44 +1351,44 @@ var require_path_to_regexp = __commonJS({
1351
1351
  if (o && !c[t2].test(s)) {
1352
1352
  throw new TypeError('Expected "'.concat(i2.name, '" to match "').concat(i2.pattern, '", but got "').concat(s, '"'));
1353
1353
  }
1354
- r3 += i2.prefix + s + i2.suffix;
1354
+ r2 += i2.prefix + s + i2.suffix;
1355
1355
  continue;
1356
1356
  }
1357
1357
  if (u) continue;
1358
1358
  var d = p ? "an array" : "a string";
1359
1359
  throw new TypeError('Expected "'.concat(i2.name, '" to be ').concat(d));
1360
1360
  }
1361
- return r3;
1361
+ return r2;
1362
1362
  };
1363
1363
  }
1364
1364
  n.tokensToFunction = tokensToFunction;
1365
1365
  function match(e2, n2) {
1366
- var r2 = [];
1367
- var t = pathToRegexp(e2, r2, n2);
1368
- return regexpToFunction(t, r2, n2);
1366
+ var r = [];
1367
+ var t = pathToRegexp(e2, r, n2);
1368
+ return regexpToFunction(t, r, n2);
1369
1369
  }
1370
1370
  n.match = match;
1371
- function regexpToFunction(e2, n2, r2) {
1372
- if (r2 === void 0) {
1373
- r2 = {};
1371
+ function regexpToFunction(e2, n2, r) {
1372
+ if (r === void 0) {
1373
+ r = {};
1374
1374
  }
1375
- var t = r2.decode, a = t === void 0 ? function(e3) {
1375
+ var t = r.decode, a = t === void 0 ? function(e3) {
1376
1376
  return e3;
1377
1377
  } : t;
1378
- return function(r3) {
1379
- var t2 = e2.exec(r3);
1378
+ return function(r2) {
1379
+ var t2 = e2.exec(r2);
1380
1380
  if (!t2) return false;
1381
1381
  var i = t2[0], o = t2.index;
1382
1382
  var c = /* @__PURE__ */ Object.create(null);
1383
1383
  var _loop_1 = function(e3) {
1384
1384
  if (t2[e3] === void 0) return "continue";
1385
- var r4 = n2[e3 - 1];
1386
- if (r4.modifier === "*" || r4.modifier === "+") {
1387
- c[r4.name] = t2[e3].split(r4.prefix + r4.suffix).map((function(e4) {
1388
- return a(e4, r4);
1385
+ var r3 = n2[e3 - 1];
1386
+ if (r3.modifier === "*" || r3.modifier === "+") {
1387
+ c[r3.name] = t2[e3].split(r3.prefix + r3.suffix).map((function(e4) {
1388
+ return a(e4, r3);
1389
1389
  }));
1390
1390
  } else {
1391
- c[r4.name] = a(t2[e3], r4);
1391
+ c[r3.name] = a(t2[e3], r3);
1392
1392
  }
1393
1393
  };
1394
1394
  for (var f = 1; f < t2.length; f++) {
@@ -1406,31 +1406,31 @@ var require_path_to_regexp = __commonJS({
1406
1406
  }
1407
1407
  function regexpToRegexp(e2, n2) {
1408
1408
  if (!n2) return e2;
1409
- var r2 = /\((?:\?<(.*?)>)?(?!\?)/g;
1409
+ var r = /\((?:\?<(.*?)>)?(?!\?)/g;
1410
1410
  var t = 0;
1411
- var a = r2.exec(e2.source);
1411
+ var a = r.exec(e2.source);
1412
1412
  while (a) {
1413
1413
  n2.push({ name: a[1] || t++, prefix: "", suffix: "", modifier: "", pattern: "" });
1414
- a = r2.exec(e2.source);
1414
+ a = r.exec(e2.source);
1415
1415
  }
1416
1416
  return e2;
1417
1417
  }
1418
- function arrayToRegexp(e2, n2, r2) {
1418
+ function arrayToRegexp(e2, n2, r) {
1419
1419
  var t = e2.map((function(e3) {
1420
- return pathToRegexp(e3, n2, r2).source;
1420
+ return pathToRegexp(e3, n2, r).source;
1421
1421
  }));
1422
- return new RegExp("(?:".concat(t.join("|"), ")"), flags(r2));
1422
+ return new RegExp("(?:".concat(t.join("|"), ")"), flags(r));
1423
1423
  }
1424
- function stringToRegexp(e2, n2, r2) {
1425
- return tokensToRegexp(parse(e2, r2), n2, r2);
1424
+ function stringToRegexp(e2, n2, r) {
1425
+ return tokensToRegexp(parse(e2, r), n2, r);
1426
1426
  }
1427
- function tokensToRegexp(e2, n2, r2) {
1428
- if (r2 === void 0) {
1429
- r2 = {};
1427
+ function tokensToRegexp(e2, n2, r) {
1428
+ if (r === void 0) {
1429
+ r = {};
1430
1430
  }
1431
- var t = r2.strict, a = t === void 0 ? false : t, i = r2.start, o = i === void 0 ? true : i, c = r2.end, f = c === void 0 ? true : c, u = r2.encode, p = u === void 0 ? function(e3) {
1431
+ var t = r.strict, a = t === void 0 ? false : t, i = r.start, o = i === void 0 ? true : i, c = r.end, f = c === void 0 ? true : c, u = r.encode, p = u === void 0 ? function(e3) {
1432
1432
  return e3;
1433
- } : u, v = r2.delimiter, s = v === void 0 ? "/#?" : v, d = r2.endsWith, g = d === void 0 ? "" : d;
1433
+ } : u, v = r.delimiter, s = v === void 0 ? "/#?" : v, d = r.endsWith, g = d === void 0 ? "" : d;
1434
1434
  var x = "[".concat(escapeString(g), "]|$");
1435
1435
  var h = "[".concat(escapeString(s), "]");
1436
1436
  var l = o ? "^" : "";
@@ -1440,15 +1440,15 @@ var require_path_to_regexp = __commonJS({
1440
1440
  l += escapeString(p(E));
1441
1441
  } else {
1442
1442
  var w = escapeString(p(E.prefix));
1443
- var y2 = escapeString(p(E.suffix));
1443
+ var y = escapeString(p(E.suffix));
1444
1444
  if (E.pattern) {
1445
1445
  if (n2) n2.push(E);
1446
- if (w || y2) {
1446
+ if (w || y) {
1447
1447
  if (E.modifier === "+" || E.modifier === "*") {
1448
1448
  var R = E.modifier === "*" ? "?" : "";
1449
- l += "(?:".concat(w, "((?:").concat(E.pattern, ")(?:").concat(y2).concat(w, "(?:").concat(E.pattern, "))*)").concat(y2, ")").concat(R);
1449
+ l += "(?:".concat(w, "((?:").concat(E.pattern, ")(?:").concat(y).concat(w, "(?:").concat(E.pattern, "))*)").concat(y, ")").concat(R);
1450
1450
  } else {
1451
- l += "(?:".concat(w, "(").concat(E.pattern, ")").concat(y2, ")").concat(E.modifier);
1451
+ l += "(?:".concat(w, "(").concat(E.pattern, ")").concat(y, ")").concat(E.modifier);
1452
1452
  }
1453
1453
  } else {
1454
1454
  if (E.modifier === "+" || E.modifier === "*") {
@@ -1457,13 +1457,13 @@ var require_path_to_regexp = __commonJS({
1457
1457
  l += "(".concat(E.pattern, ")").concat(E.modifier);
1458
1458
  }
1459
1459
  } else {
1460
- l += "(?:".concat(w).concat(y2, ")").concat(E.modifier);
1460
+ l += "(?:".concat(w).concat(y, ")").concat(E.modifier);
1461
1461
  }
1462
1462
  }
1463
1463
  }
1464
1464
  if (f) {
1465
1465
  if (!a) l += "".concat(h, "?");
1466
- l += !r2.endsWith ? "$" : "(?=".concat(x, ")");
1466
+ l += !r.endsWith ? "$" : "(?=".concat(x, ")");
1467
1467
  } else {
1468
1468
  var A = e2[e2.length - 1];
1469
1469
  var _ = typeof A === "string" ? h.indexOf(A[A.length - 1]) > -1 : A === void 0;
@@ -1474,13 +1474,13 @@ var require_path_to_regexp = __commonJS({
1474
1474
  l += "(?=".concat(h, "|").concat(x, ")");
1475
1475
  }
1476
1476
  }
1477
- return new RegExp(l, flags(r2));
1477
+ return new RegExp(l, flags(r));
1478
1478
  }
1479
1479
  n.tokensToRegexp = tokensToRegexp;
1480
- function pathToRegexp(e2, n2, r2) {
1480
+ function pathToRegexp(e2, n2, r) {
1481
1481
  if (e2 instanceof RegExp) return regexpToRegexp(e2, n2);
1482
- if (Array.isArray(e2)) return arrayToRegexp(e2, n2, r2);
1483
- return stringToRegexp(e2, n2, r2);
1482
+ if (Array.isArray(e2)) return arrayToRegexp(e2, n2, r);
1483
+ return stringToRegexp(e2, n2, r);
1484
1484
  }
1485
1485
  n.pathToRegexp = pathToRegexp;
1486
1486
  })();
@@ -4013,9 +4013,9 @@ function SignIn({ onSuccess } = {}) {
4013
4013
  },
4014
4014
  body: JSON.stringify({ email, password })
4015
4015
  });
4016
- const ct2 = res.headers.get("content-type") || "";
4016
+ const ct = res.headers.get("content-type") || "";
4017
4017
  let data = {};
4018
- if (ct2.includes("application/json")) data = await res.json();
4018
+ if (ct.includes("application/json")) data = await res.json();
4019
4019
  else {
4020
4020
  const text = await res.text();
4021
4021
  throw new Error(`Unexpected response (status ${res.status}): ${text.slice(0, 200)}`);
@@ -4122,473 +4122,111 @@ var oauthButtonGithub = { flex: 1, padding: "10px 12px", borderRadius: 8, backgr
4122
4122
  var errorBox = { marginTop: 10, color: "#ffb4b4", fontSize: 13 };
4123
4123
  var successBox = { marginTop: 10, color: "#bef264", fontSize: 13 };
4124
4124
 
4125
- // src/SignUp.jsx
4126
- import React3, { useState as useState3, useRef as useRef2, useEffect as useEffect2 } from "react";
4127
-
4128
- // ../node_modules/react-toastify/dist/index.mjs
4129
- import { isValidElement as $t } from "react";
4130
- import ut, { useEffect as Rt, useLayoutEffect as Bt, useRef as zt } from "react";
4131
- import { cloneElement as Ft, isValidElement as Ut } from "react";
4132
- import ot from "react";
4133
- import et from "react";
4134
-
4135
- // ../node_modules/clsx/dist/clsx.mjs
4136
- function r(e) {
4137
- var t, f, n = "";
4138
- if ("string" == typeof e || "number" == typeof e) n += e;
4139
- else if ("object" == typeof e) if (Array.isArray(e)) {
4140
- var o = e.length;
4141
- for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
4142
- } else for (f in e) e[f] && (n && (n += " "), n += f);
4143
- return n;
4144
- }
4145
- function clsx() {
4146
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
4147
- return n;
4148
- }
4149
- var clsx_default = clsx;
4150
-
4151
- // ../node_modules/react-toastify/dist/index.mjs
4152
- import ct, { useEffect as yo, useRef as To, useState as go } from "react";
4153
- import { useRef as Kt, useSyncExternalStore as Yt } from "react";
4154
- import { useEffect as Zt, useRef as St, useState as kt } from "react";
4155
- import { useEffect as Jt, useLayoutEffect as to } from "react";
4156
- import q, { cloneElement as co, isValidElement as fo } from "react";
4157
- import O, { cloneElement as oo, isValidElement as eo } from "react";
4158
- function Mt(t) {
4159
- if (!t || typeof document == "undefined") return;
4160
- let o = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
4161
- e.type = "text/css", o.firstChild ? o.insertBefore(e, o.firstChild) : o.appendChild(e), e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
4162
- }
4163
- Mt(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
4164
- `);
4165
- var L = (t) => typeof t == "number" && !isNaN(t);
4166
- var N = (t) => typeof t == "string";
4167
- var P = (t) => typeof t == "function";
4168
- var mt = (t) => N(t) || L(t);
4169
- var B = (t) => N(t) || P(t) ? t : null;
4170
- var pt = (t, o) => t === false || L(t) && t > 0 ? t : o;
4171
- var z = (t) => $t(t) || N(t) || P(t) || L(t);
4172
- function Z(t, o, e = 300) {
4173
- let { scrollHeight: r2, style: s } = t;
4174
- requestAnimationFrame(() => {
4175
- s.minHeight = "initial", s.height = r2 + "px", s.transition = `all ${e}ms`, requestAnimationFrame(() => {
4176
- s.height = "0", s.padding = "0", s.margin = "0", setTimeout(o, e);
4177
- });
4178
- });
4179
- }
4180
- function $({ enter: t, exit: o, appendPosition: e = false, collapse: r2 = true, collapseDuration: s = 300 }) {
4181
- return function({ children: a, position: d, preventExitTransition: c, done: T, nodeRef: g, isIn: v, playToast: x }) {
4182
- let C = e ? `${t}--${d}` : t, S = e ? `${o}--${d}` : o, E = zt(0);
4183
- return Bt(() => {
4184
- let f = g.current, p = C.split(" "), b = (n) => {
4185
- n.target === g.current && (x(), f.removeEventListener("animationend", b), f.removeEventListener("animationcancel", b), E.current === 0 && n.type !== "animationcancel" && f.classList.remove(...p));
4186
- };
4187
- (() => {
4188
- f.classList.add(...p), f.addEventListener("animationend", b), f.addEventListener("animationcancel", b);
4189
- })();
4190
- }, []), Rt(() => {
4191
- let f = g.current, p = () => {
4192
- f.removeEventListener("animationend", p), r2 ? Z(f, T, s) : T();
4193
- };
4194
- v || (c ? p() : (() => {
4195
- E.current = 1, f.className += ` ${S}`, f.addEventListener("animationend", p);
4196
- })());
4197
- }, [v]), ut.createElement(ut.Fragment, null, a);
4198
- };
4199
- }
4200
- function J(t, o) {
4201
- return { content: tt(t.content, t.props), containerId: t.props.containerId, id: t.props.toastId, theme: t.props.theme, type: t.props.type, data: t.props.data || {}, isLoading: t.props.isLoading, icon: t.props.icon, reason: t.removalReason, status: o };
4202
- }
4203
- function tt(t, o, e = false) {
4204
- return Ut(t) && !N(t.type) ? Ft(t, { closeToast: o.closeToast, toastProps: o, data: o.data, isPaused: e }) : P(t) ? t({ closeToast: o.closeToast, toastProps: o, data: o.data, isPaused: e }) : t;
4205
- }
4206
- function yt({ closeToast: t, theme: o, ariaLabel: e = "close" }) {
4207
- return ot.createElement("button", { className: `Toastify__close-button Toastify__close-button--${o}`, type: "button", onClick: (r2) => {
4208
- r2.stopPropagation(), t(true);
4209
- }, "aria-label": e }, ot.createElement("svg", { "aria-hidden": "true", viewBox: "0 0 14 16" }, ot.createElement("path", { fillRule: "evenodd", d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z" })));
4210
- }
4211
- function gt({ delay: t, isRunning: o, closeToast: e, type: r2 = "default", hide: s, className: l, controlledProgress: a, progress: d, rtl: c, isIn: T, theme: g }) {
4212
- let v = s || a && d === 0, x = { animationDuration: `${t}ms`, animationPlayState: o ? "running" : "paused" };
4213
- a && (x.transform = `scaleX(${d})`);
4214
- let C = clsx_default("Toastify__progress-bar", a ? "Toastify__progress-bar--controlled" : "Toastify__progress-bar--animated", `Toastify__progress-bar-theme--${g}`, `Toastify__progress-bar--${r2}`, { ["Toastify__progress-bar--rtl"]: c }), S = P(l) ? l({ rtl: c, type: r2, defaultClassName: C }) : clsx_default(C, l), E = { [a && d >= 1 ? "onTransitionEnd" : "onAnimationEnd"]: a && d < 1 ? null : () => {
4215
- T && e();
4216
- } };
4217
- return et.createElement("div", { className: "Toastify__progress-bar--wrp", "data-hidden": v }, et.createElement("div", { className: `Toastify__progress-bar--bg Toastify__progress-bar-theme--${g} Toastify__progress-bar--${r2}` }), et.createElement("div", { role: "progressbar", "aria-hidden": v ? "true" : "false", "aria-label": "notification timer", className: S, style: x, ...E }));
4218
- }
4219
- var Xt = 1;
4220
- var at = () => `${Xt++}`;
4221
- function _t(t, o, e) {
4222
- let r2 = 1, s = 0, l = [], a = [], d = o, c = /* @__PURE__ */ new Map(), T = /* @__PURE__ */ new Set(), g = (i) => (T.add(i), () => T.delete(i)), v = () => {
4223
- a = Array.from(c.values()), T.forEach((i) => i());
4224
- }, x = ({ containerId: i, toastId: n, updateId: u }) => {
4225
- let h = i ? i !== t : t !== 1, m = c.has(n) && u == null;
4226
- return h || m;
4227
- }, C = (i, n) => {
4228
- c.forEach((u) => {
4229
- var h;
4230
- (n == null || n === u.props.toastId) && ((h = u.toggle) == null || h.call(u, i));
4231
- });
4232
- }, S = (i) => {
4233
- var n, u;
4234
- (u = (n = i.props) == null ? void 0 : n.onClose) == null || u.call(n, i.removalReason), i.isActive = false;
4235
- }, E = (i) => {
4236
- if (i == null) c.forEach(S);
4237
- else {
4238
- let n = c.get(i);
4239
- n && S(n);
4240
- }
4241
- v();
4242
- }, f = () => {
4243
- s -= l.length, l = [];
4244
- }, p = (i) => {
4245
- var m, _;
4246
- let { toastId: n, updateId: u } = i.props, h = u == null;
4247
- i.staleId && c.delete(i.staleId), i.isActive = true, c.set(n, i), v(), e(J(i, h ? "added" : "updated")), h && ((_ = (m = i.props).onOpen) == null || _.call(m));
4248
- };
4249
- return { id: t, props: d, observe: g, toggle: C, removeToast: E, toasts: c, clearQueue: f, buildToast: (i, n) => {
4250
- if (x(n)) return;
4251
- let { toastId: u, updateId: h, data: m, staleId: _, delay: k } = n, M = h == null;
4252
- M && s++;
4253
- let A = { ...d, style: d.toastStyle, key: r2++, ...Object.fromEntries(Object.entries(n).filter(([D, Y]) => Y != null)), toastId: u, updateId: h, data: m, isIn: false, className: B(n.className || d.toastClassName), progressClassName: B(n.progressClassName || d.progressClassName), autoClose: n.isLoading ? false : pt(n.autoClose, d.autoClose), closeToast(D) {
4254
- c.get(u).removalReason = D, E(u);
4255
- }, deleteToast() {
4256
- let D = c.get(u);
4257
- if (D != null) {
4258
- if (e(J(D, "removed")), c.delete(u), s--, s < 0 && (s = 0), l.length > 0) {
4259
- p(l.shift());
4260
- return;
4261
- }
4262
- v();
4263
- }
4264
- } };
4265
- A.closeButton = d.closeButton, n.closeButton === false || z(n.closeButton) ? A.closeButton = n.closeButton : n.closeButton === true && (A.closeButton = z(d.closeButton) ? d.closeButton : true);
4266
- let R = { content: i, props: A, staleId: _ };
4267
- d.limit && d.limit > 0 && s > d.limit && M ? l.push(R) : L(k) ? setTimeout(() => {
4268
- p(R);
4269
- }, k) : p(R);
4270
- }, setProps(i) {
4271
- d = i;
4272
- }, setToggle: (i, n) => {
4273
- let u = c.get(i);
4274
- u && (u.toggle = n);
4275
- }, isToastActive: (i) => {
4276
- var n;
4277
- return (n = c.get(i)) == null ? void 0 : n.isActive;
4278
- }, getSnapshot: () => a };
4279
- }
4280
- var I = /* @__PURE__ */ new Map();
4281
- var F = [];
4282
- var st = /* @__PURE__ */ new Set();
4283
- var Vt = (t) => st.forEach((o) => o(t));
4284
- var bt = () => I.size > 0;
4285
- function Qt() {
4286
- F.forEach((t) => nt(t.content, t.options)), F = [];
4287
- }
4288
- var vt = (t, { containerId: o }) => {
4289
- var e;
4290
- return (e = I.get(o || 1)) == null ? void 0 : e.toasts.get(t);
4291
- };
4292
- function X(t, o) {
4293
- var r2;
4294
- if (o) return !!((r2 = I.get(o)) != null && r2.isToastActive(t));
4295
- let e = false;
4296
- return I.forEach((s) => {
4297
- s.isToastActive(t) && (e = true);
4298
- }), e;
4299
- }
4300
- function ht(t) {
4301
- if (!bt()) {
4302
- F = F.filter((o) => t != null && o.options.toastId !== t);
4303
- return;
4304
- }
4305
- if (t == null || mt(t)) I.forEach((o) => {
4306
- o.removeToast(t);
4307
- });
4308
- else if (t && ("containerId" in t || "id" in t)) {
4309
- let o = I.get(t.containerId);
4310
- o ? o.removeToast(t.id) : I.forEach((e) => {
4311
- e.removeToast(t.id);
4312
- });
4313
- }
4314
- }
4315
- var Ct = (t = {}) => {
4316
- I.forEach((o) => {
4317
- o.props.limit && (!t.containerId || o.id === t.containerId) && o.clearQueue();
4318
- });
4319
- };
4320
- function nt(t, o) {
4321
- z(t) && (bt() || F.push({ content: t, options: o }), I.forEach((e) => {
4322
- e.buildToast(t, o);
4323
- }));
4324
- }
4325
- function xt(t) {
4326
- var o;
4327
- (o = I.get(t.containerId || 1)) == null || o.setToggle(t.id, t.fn);
4328
- }
4329
- function rt(t, o) {
4330
- I.forEach((e) => {
4331
- (o == null || !(o != null && o.containerId) || (o == null ? void 0 : o.containerId) === e.id) && e.toggle(t, o == null ? void 0 : o.id);
4332
- });
4333
- }
4334
- function Et(t) {
4335
- let o = t.containerId || 1;
4336
- return { subscribe(e) {
4337
- let r2 = _t(o, t, Vt);
4338
- I.set(o, r2);
4339
- let s = r2.observe(e);
4340
- return Qt(), () => {
4341
- s(), I.delete(o);
4342
- };
4343
- }, setProps(e) {
4344
- var r2;
4345
- (r2 = I.get(o)) == null || r2.setProps(e);
4346
- }, getSnapshot() {
4347
- var e;
4348
- return (e = I.get(o)) == null ? void 0 : e.getSnapshot();
4349
- } };
4350
- }
4351
- function Pt(t) {
4352
- return st.add(t), () => {
4353
- st.delete(t);
4354
- };
4355
- }
4356
- function Wt(t) {
4357
- return t && (N(t.toastId) || L(t.toastId)) ? t.toastId : at();
4358
- }
4359
- function U(t, o) {
4360
- return nt(t, o), o.toastId;
4361
- }
4362
- function V(t, o) {
4363
- return { ...o, type: o && o.type || t, toastId: Wt(o) };
4364
- }
4365
- function Q(t) {
4366
- return (o, e) => U(o, V(t, e));
4367
- }
4368
- function y(t, o) {
4369
- return U(t, V("default", o));
4370
- }
4371
- y.loading = (t, o) => U(t, V("default", { isLoading: true, autoClose: false, closeOnClick: false, closeButton: false, draggable: false, ...o }));
4372
- function Gt(t, { pending: o, error: e, success: r2 }, s) {
4373
- let l;
4374
- o && (l = N(o) ? y.loading(o, s) : y.loading(o.render, { ...s, ...o }));
4375
- let a = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, d = (T, g, v) => {
4376
- if (g == null) {
4377
- y.dismiss(l);
4378
- return;
4379
- }
4380
- let x = { type: T, ...a, ...s, data: v }, C = N(g) ? { render: g } : g;
4381
- return l ? y.update(l, { ...x, ...C }) : y(C.render, { ...x, ...C }), v;
4382
- }, c = P(t) ? t() : t;
4383
- return c.then((T) => d("success", r2, T)).catch((T) => d("error", e, T)), c;
4384
- }
4385
- y.promise = Gt;
4386
- y.success = Q("success");
4387
- y.info = Q("info");
4388
- y.error = Q("error");
4389
- y.warning = Q("warning");
4390
- y.warn = y.warning;
4391
- y.dark = (t, o) => U(t, V("default", { theme: "dark", ...o }));
4392
- function qt(t) {
4393
- ht(t);
4394
- }
4395
- y.dismiss = qt;
4396
- y.clearWaitingQueue = Ct;
4397
- y.isActive = X;
4398
- y.update = (t, o = {}) => {
4399
- let e = vt(t, o);
4400
- if (e) {
4401
- let { props: r2, content: s } = e, l = { delay: 100, ...r2, ...o, toastId: o.toastId || t, updateId: at() };
4402
- l.toastId !== t && (l.staleId = t);
4403
- let a = l.render || s;
4404
- delete l.render, U(a, l);
4405
- }
4406
- };
4407
- y.done = (t) => {
4408
- y.update(t, { progress: 1 });
4409
- };
4410
- y.onChange = Pt;
4411
- y.play = (t) => rt(true, t);
4412
- y.pause = (t) => rt(false, t);
4413
- function It(t) {
4414
- var a;
4415
- let { subscribe: o, getSnapshot: e, setProps: r2 } = Kt(Et(t)).current;
4416
- r2(t);
4417
- let s = (a = Yt(o, e, e)) == null ? void 0 : a.slice();
4418
- function l(d) {
4419
- if (!s) return [];
4420
- let c = /* @__PURE__ */ new Map();
4421
- return t.newestOnTop && s.reverse(), s.forEach((T) => {
4422
- let { position: g } = T.props;
4423
- c.has(g) || c.set(g, []), c.get(g).push(T);
4424
- }), Array.from(c, (T) => d(T[0], T[1]));
4425
- }
4426
- return { getToastToRender: l, isToastActive: X, count: s == null ? void 0 : s.length };
4427
- }
4428
- function At(t) {
4429
- let [o, e] = kt(false), [r2, s] = kt(false), l = St(null), a = St({ start: 0, delta: 0, removalDistance: 0, canCloseOnClick: true, canDrag: false, didMove: false }).current, { autoClose: d, pauseOnHover: c, closeToast: T, onClick: g, closeOnClick: v } = t;
4430
- xt({ id: t.toastId, containerId: t.containerId, fn: e }), Zt(() => {
4431
- if (t.pauseOnFocusLoss) return x(), () => {
4432
- C();
4433
- };
4434
- }, [t.pauseOnFocusLoss]);
4435
- function x() {
4436
- document.hasFocus() || p(), window.addEventListener("focus", f), window.addEventListener("blur", p);
4437
- }
4438
- function C() {
4439
- window.removeEventListener("focus", f), window.removeEventListener("blur", p);
4440
- }
4441
- function S(m) {
4442
- if (t.draggable === true || t.draggable === m.pointerType) {
4443
- b();
4444
- let _ = l.current;
4445
- a.canCloseOnClick = true, a.canDrag = true, _.style.transition = "none", t.draggableDirection === "x" ? (a.start = m.clientX, a.removalDistance = _.offsetWidth * (t.draggablePercent / 100)) : (a.start = m.clientY, a.removalDistance = _.offsetHeight * (t.draggablePercent === 80 ? t.draggablePercent * 1.5 : t.draggablePercent) / 100);
4446
- }
4447
- }
4448
- function E(m) {
4449
- let { top: _, bottom: k, left: M, right: A } = l.current.getBoundingClientRect();
4450
- m.nativeEvent.type !== "touchend" && t.pauseOnHover && m.clientX >= M && m.clientX <= A && m.clientY >= _ && m.clientY <= k ? p() : f();
4451
- }
4452
- function f() {
4453
- e(true);
4454
- }
4455
- function p() {
4456
- e(false);
4457
- }
4458
- function b() {
4459
- a.didMove = false, document.addEventListener("pointermove", n), document.addEventListener("pointerup", u);
4460
- }
4461
- function i() {
4462
- document.removeEventListener("pointermove", n), document.removeEventListener("pointerup", u);
4463
- }
4464
- function n(m) {
4465
- let _ = l.current;
4466
- if (a.canDrag && _) {
4467
- a.didMove = true, o && p(), t.draggableDirection === "x" ? a.delta = m.clientX - a.start : a.delta = m.clientY - a.start, a.start !== m.clientX && (a.canCloseOnClick = false);
4468
- let k = t.draggableDirection === "x" ? `${a.delta}px, var(--y)` : `0, calc(${a.delta}px + var(--y))`;
4469
- _.style.transform = `translate3d(${k},0)`, _.style.opacity = `${1 - Math.abs(a.delta / a.removalDistance)}`;
4470
- }
4471
- }
4472
- function u() {
4473
- i();
4474
- let m = l.current;
4475
- if (a.canDrag && a.didMove && m) {
4476
- if (a.canDrag = false, Math.abs(a.delta) > a.removalDistance) {
4477
- s(true), t.closeToast(true), t.collapseAll();
4478
- return;
4479
- }
4480
- m.style.transition = "transform 0.2s, opacity 0.2s", m.style.removeProperty("transform"), m.style.removeProperty("opacity");
4481
- }
4482
- }
4483
- let h = { onPointerDown: S, onPointerUp: E };
4484
- return d && c && (h.onMouseEnter = p, t.stacked || (h.onMouseLeave = f)), v && (h.onClick = (m) => {
4485
- g && g(m), a.canCloseOnClick && T(true);
4486
- }), { playToast: f, pauseToast: p, isRunning: o, preventExitTransition: r2, toastRef: l, eventHandlers: h };
4487
- }
4488
- var Ot = typeof window != "undefined" ? to : Jt;
4489
- var G = ({ theme: t, type: o, isLoading: e, ...r2 }) => O.createElement("svg", { viewBox: "0 0 24 24", width: "100%", height: "100%", fill: t === "colored" ? "currentColor" : `var(--toastify-icon-color-${o})`, ...r2 });
4490
- function ao(t) {
4491
- return O.createElement(G, { ...t }, O.createElement("path", { d: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z" }));
4492
- }
4493
- function so(t) {
4494
- return O.createElement(G, { ...t }, O.createElement("path", { d: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z" }));
4495
- }
4496
- function no(t) {
4497
- return O.createElement(G, { ...t }, O.createElement("path", { d: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z" }));
4498
- }
4499
- function ro(t) {
4500
- return O.createElement(G, { ...t }, O.createElement("path", { d: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z" }));
4501
- }
4502
- function io() {
4503
- return O.createElement("div", { className: "Toastify__spinner" });
4504
- }
4505
- var W = { info: so, warning: ao, success: no, error: ro, spinner: io };
4506
- var lo = (t) => t in W;
4507
- function Nt({ theme: t, type: o, isLoading: e, icon: r2 }) {
4508
- let s = null, l = { theme: t, type: o };
4509
- return r2 === false || (P(r2) ? s = r2({ ...l, isLoading: e }) : eo(r2) ? s = oo(r2, l) : e ? s = W.spinner() : lo(o) && (s = W[o](l))), s;
4510
- }
4511
- var wt = (t) => {
4512
- let { isRunning: o, preventExitTransition: e, toastRef: r2, eventHandlers: s, playToast: l } = At(t), { closeButton: a, children: d, autoClose: c, onClick: T, type: g, hideProgressBar: v, closeToast: x, transition: C, position: S, className: E, style: f, progressClassName: p, updateId: b, role: i, progress: n, rtl: u, toastId: h, deleteToast: m, isIn: _, isLoading: k, closeOnClick: M, theme: A, ariaLabel: R } = t, D = clsx_default("Toastify__toast", `Toastify__toast-theme--${A}`, `Toastify__toast--${g}`, { ["Toastify__toast--rtl"]: u }, { ["Toastify__toast--close-on-click"]: M }), Y = P(E) ? E({ rtl: u, position: S, type: g, defaultClassName: D }) : clsx_default(D, E), ft = Nt(t), dt = !!n || !c, j = { closeToast: x, type: g, theme: A }, H = null;
4513
- return a === false || (P(a) ? H = a(j) : fo(a) ? H = co(a, j) : H = yt(j)), q.createElement(C, { isIn: _, done: m, position: S, preventExitTransition: e, nodeRef: r2, playToast: l }, q.createElement("div", { id: h, tabIndex: 0, onClick: T, "data-in": _, className: Y, ...s, style: f, ref: r2, ..._ && { role: i, "aria-label": R } }, ft != null && q.createElement("div", { className: clsx_default("Toastify__toast-icon", { ["Toastify--animate-icon Toastify__zoom-enter"]: !k }) }, ft), tt(d, t, !o), H, !t.customProgressBar && q.createElement(gt, { ...b && !dt ? { key: `p-${b}` } : {}, rtl: u, theme: A, delay: c, isRunning: o, isIn: _, closeToast: x, hide: v, type: g, className: p, controlledProgress: dt, progress: n || 0 })));
4514
- };
4515
- var K = (t, o = false) => ({ enter: `Toastify--animate Toastify__${t}-enter`, exit: `Toastify--animate Toastify__${t}-exit`, appendPosition: o });
4516
- var lt = $(K("bounce", true));
4517
- var mo = $(K("slide", true));
4518
- var po = $(K("zoom"));
4519
- var uo = $(K("flip"));
4520
- var _o = { position: "top-right", transition: lt, autoClose: 5e3, closeButton: true, pauseOnHover: true, pauseOnFocusLoss: true, draggable: "touch", draggablePercent: 80, draggableDirection: "x", role: "alert", theme: "light", "aria-label": "Notifications Alt+T", hotKeys: (t) => t.altKey && t.code === "KeyT" };
4521
- function Lt(t) {
4522
- let o = { ..._o, ...t }, e = t.stacked, [r2, s] = go(true), l = To(null), { getToastToRender: a, isToastActive: d, count: c } = It(o), { className: T, style: g, rtl: v, containerId: x, hotKeys: C } = o;
4523
- function S(f) {
4524
- let p = clsx_default("Toastify__toast-container", `Toastify__toast-container--${f}`, { ["Toastify__toast-container--rtl"]: v });
4525
- return P(T) ? T({ position: f, rtl: v, defaultClassName: p }) : clsx_default(p, B(T));
4526
- }
4527
- function E() {
4528
- e && (s(true), y.play());
4529
- }
4530
- return Ot(() => {
4531
- var f;
4532
- if (e) {
4533
- let p = l.current.querySelectorAll('[data-in="true"]'), b = 12, i = (f = o.position) == null ? void 0 : f.includes("top"), n = 0, u = 0;
4534
- Array.from(p).reverse().forEach((h, m) => {
4535
- let _ = h;
4536
- _.classList.add("Toastify__toast--stacked"), m > 0 && (_.dataset.collapsed = `${r2}`), _.dataset.pos || (_.dataset.pos = i ? "top" : "bot");
4537
- let k = n * (r2 ? 0.2 : 1) + (r2 ? 0 : b * m);
4538
- _.style.setProperty("--y", `${i ? k : k * -1}px`), _.style.setProperty("--g", `${b}`), _.style.setProperty("--s", `${1 - (r2 ? u : 0)}`), n += _.offsetHeight, u += 0.025;
4539
- });
4540
- }
4541
- }, [r2, c, e]), yo(() => {
4542
- function f(p) {
4543
- var i;
4544
- let b = l.current;
4545
- C(p) && ((i = b.querySelector('[tabIndex="0"]')) == null || i.focus(), s(false), y.pause()), p.key === "Escape" && (document.activeElement === b || b != null && b.contains(document.activeElement)) && (s(true), y.play());
4546
- }
4547
- return document.addEventListener("keydown", f), () => {
4548
- document.removeEventListener("keydown", f);
4549
- };
4550
- }, [C]), ct.createElement("section", { ref: l, className: "Toastify", id: x, onMouseEnter: () => {
4551
- e && (s(false), y.pause());
4552
- }, onMouseLeave: E, "aria-live": "polite", "aria-atomic": "false", "aria-relevant": "additions text", "aria-label": o["aria-label"] }, a((f, p) => {
4553
- let b = p.length ? { ...g } : { ...g, pointerEvents: "none" };
4554
- return ct.createElement("div", { tabIndex: -1, className: S(f), "data-stacked": e, style: b, key: `c-${f}` }, p.map(({ content: i, props: n }) => ct.createElement(wt, { ...n, stacked: e, collapseAll: E, isIn: d(n.toastId, n.containerId), key: `t-${n.key}` }, i)));
4555
- }));
4556
- }
4557
-
4558
4125
  // src/SignUp.jsx
4559
4126
  var import_link = __toESM(require_link2(), 1);
4127
+ import React3, { useState as useState3, useRef as useRef2, useEffect as useEffect2 } from "react";
4560
4128
  function SignUp({ agency = { name: "MyApp", logo: "" } }) {
4129
+ const {
4130
+ publishableKey,
4131
+ baseUrl,
4132
+ redirect,
4133
+ redirectTo,
4134
+ user,
4135
+ loadingUser,
4136
+ fetchMe,
4137
+ setUser
4138
+ } = (typeof useAuth === "function" ? useAuth() : {}) || {};
4561
4139
  const [name, setName] = useState3("");
4562
4140
  const [email, setEmail] = useState3("");
4563
4141
  const [password, setPassword] = useState3("");
4564
4142
  const [loading, setLoading] = useState3(false);
4565
4143
  const [loadingOauth, setLoadingOauth] = useState3({ google: false, github: false });
4566
- const [message, setMessage] = useState3(null);
4567
- const [showKeysPanel, setShowKeysPanel] = useState3(false);
4568
- const [newKeys, setNewKeys] = useState3(null);
4569
4144
  const redirectTimer = useRef2(null);
4145
+ const toastId = useRef2(0);
4146
+ const [toasts, setToasts] = useState3([]);
4570
4147
  useEffect2(() => {
4571
4148
  return () => {
4572
4149
  if (redirectTimer.current) clearTimeout(redirectTimer.current);
4150
+ toasts.forEach((t) => clearTimeout(t._timer));
4573
4151
  };
4574
4152
  }, []);
4153
+ function showToast(type, message, ms = 5e3) {
4154
+ const id = ++toastId.current;
4155
+ const created = Date.now();
4156
+ const t = { id, type, message, created, _timer: null };
4157
+ setToasts((prev) => {
4158
+ const next = [t, ...prev].slice(0, 6);
4159
+ return next;
4160
+ });
4161
+ const timer = setTimeout(() => {
4162
+ setToasts((prev) => prev.filter((x) => x.id !== id));
4163
+ }, ms);
4164
+ t._timer = timer;
4165
+ }
4166
+ function removeToast(id) {
4167
+ setToasts((prev) => {
4168
+ prev.forEach((t) => {
4169
+ if (t.id === id) clearTimeout(t._timer);
4170
+ });
4171
+ return prev.filter((x) => x.id !== id);
4172
+ });
4173
+ }
4174
+ if (loadingUser) return null;
4175
+ if (user && redirect) {
4176
+ if (typeof redirectTo === "function") redirectTo(redirect);
4177
+ else if (typeof window !== "undefined") window.location.assign(redirect);
4178
+ return null;
4179
+ }
4575
4180
  async function submit(e) {
4576
4181
  e.preventDefault();
4577
4182
  if (loading) return;
4578
- setMessage(null);
4579
4183
  setLoading(true);
4184
+ if (!name.trim()) {
4185
+ showToast("error", "Please enter your name.");
4186
+ setLoading(false);
4187
+ return;
4188
+ }
4189
+ if (!email.includes("@")) {
4190
+ showToast("error", "Please enter a valid email address.");
4191
+ setLoading(false);
4192
+ return;
4193
+ }
4194
+ if (password.length < 8) {
4195
+ showToast("error", "Password must be at least 8 characters.");
4196
+ setLoading(false);
4197
+ return;
4198
+ }
4199
+ const url = `${(baseUrl || "").replace(/\/+$/, "")}/api/sdk/signup`;
4580
4200
  try {
4581
- await new Promise((r2) => setTimeout(r2, 700));
4582
- if (!email.includes("@")) throw new Error("Invalid email address");
4583
- if (password.length < 8) throw new Error("Password must be at least 8 characters");
4584
- if (email === "taken@example.com") throw new Error("User already exists");
4585
- setMessage("Account created. Redirecting\u2026");
4586
- y.success("Account created. Redirecting\u2026");
4587
- redirectTimer.current = setTimeout(() => {
4588
- }, 300);
4201
+ const res = await fetch(url, {
4202
+ method: "POST",
4203
+ credentials: "include",
4204
+ headers: {
4205
+ "Content-Type": "application/json",
4206
+ "x-publishable-key": publishableKey || ""
4207
+ },
4208
+ body: JSON.stringify({ name: name.trim(), email: email.trim(), password })
4209
+ });
4210
+ const data = await res.json().catch(async () => {
4211
+ const text = await res.text().catch(() => "");
4212
+ return { _raw: text };
4213
+ });
4214
+ if (!res.ok) {
4215
+ const errMsg = data?.error || data?._raw || `Signup failed (${res.status})`;
4216
+ throw new Error(errMsg);
4217
+ }
4218
+ if (data.user && typeof setUser === "function") setUser(data.user);
4219
+ if (typeof fetchMe === "function") await fetchMe();
4220
+ showToast("success", "Account created. Redirecting\u2026");
4221
+ if (redirect) {
4222
+ redirectTimer.current = setTimeout(() => {
4223
+ if (typeof redirectTo === "function") redirectTo(redirect);
4224
+ else if (typeof window !== "undefined") window.location.assign(redirect);
4225
+ }, 450);
4226
+ }
4589
4227
  } catch (err) {
4590
4228
  const text = err?.message ?? "Network error";
4591
- y.error(text);
4229
+ showToast("error", text);
4592
4230
  console.error("Signup error:", err);
4593
4231
  } finally {
4594
4232
  setLoading(false);
@@ -4598,10 +4236,23 @@ function SignUp({ agency = { name: "MyApp", logo: "" } }) {
4598
4236
  if (loading || loadingOauth[provider]) return;
4599
4237
  setLoadingOauth((prev) => ({ ...prev, [provider]: true }));
4600
4238
  try {
4601
- await new Promise((r2) => setTimeout(r2, 600));
4602
- y.info(`Starting ${provider} sign-in...`);
4239
+ const rid = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
4240
+ const callbackUrl = encodeURIComponent(`${typeof window !== "undefined" ? window.location.origin : ""}/signup`);
4241
+ const sdkBase = baseUrl || (typeof window !== "undefined" ? window.location.origin.replace(/\/+$/, "") : "");
4242
+ const startUrl = `${sdkBase}/sdk/auth/start?rid=${rid}&source=${encodeURIComponent(provider)}&callbackUrl=${callbackUrl}`;
4243
+ if (!publishableKey) {
4244
+ throw new Error("Missing publishable key (client side).");
4245
+ }
4246
+ const res = await fetch(startUrl, {
4247
+ method: "GET",
4248
+ headers: { "x-publishable-key": publishableKey }
4249
+ });
4250
+ const data = await res.json().catch(() => null);
4251
+ if (!res.ok) throw new Error(data?.error || `OAuth start failed (${res.status})`);
4252
+ if (!data?.oauthUrl) throw new Error("SDK start did not return oauthUrl");
4253
+ if (typeof window !== "undefined") window.location.href = data.oauthUrl;
4603
4254
  } catch (err) {
4604
- y.error(err?.message || "OAuth start failed");
4255
+ showToast("error", err?.message || "OAuth start failed");
4605
4256
  console.error("OAuth start error:", err);
4606
4257
  setLoadingOauth((prev) => ({ ...prev, [provider]: false }));
4607
4258
  }
@@ -4614,25 +4265,27 @@ function SignUp({ agency = { name: "MyApp", logo: "" } }) {
4614
4265
  if (e && typeof e.preventDefault === "function") e.preventDefault();
4615
4266
  startOAuthFlow("github");
4616
4267
  };
4617
- return /* @__PURE__ */ React3.createElement("div", { style: overlay2 }, /* @__PURE__ */ React3.createElement(
4618
- Lt,
4268
+ return /* @__PURE__ */ React3.createElement("div", { style: overlay2 }, /* @__PURE__ */ React3.createElement("div", { style: toastContainer }, toasts.map((t) => /* @__PURE__ */ React3.createElement(
4269
+ "div",
4619
4270
  {
4620
- position: "top-right",
4621
- autoClose: 5e3,
4622
- newestOnTop: true,
4623
- closeOnClick: true,
4624
- pauseOnHover: true,
4625
- draggable: true,
4626
- toastStyle: {
4627
- background: "#000000",
4628
- color: "#ffffff",
4629
- borderRadius: 10,
4630
- boxShadow: "0 6px 18px rgba(0,0,0,0.6)",
4631
- padding: "10px 14px",
4632
- fontWeight: 500
4633
- }
4634
- }
4635
- ), /* @__PURE__ */ React3.createElement("div", { style: modal2 }, /* @__PURE__ */ React3.createElement("div", { style: modalInner }, /* @__PURE__ */ React3.createElement("header", { style: header }, /* @__PURE__ */ React3.createElement("div", { style: brandRow }, /* @__PURE__ */ React3.createElement("div", { style: logo }, /* @__PURE__ */ React3.createElement("div", { style: logoCircle, "aria-hidden": true })), /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement("h1", { style: title2 }, "Sign up to ", agency.name), /* @__PURE__ */ React3.createElement("div", { style: subtitle2 }, "Welcome! Create your account.")))), /* @__PURE__ */ React3.createElement("section", { style: oauthSection }, /* @__PURE__ */ React3.createElement(
4271
+ key: t.id,
4272
+ role: "status",
4273
+ "aria-live": "polite",
4274
+ style: {
4275
+ ...toastBase,
4276
+ ...t.type === "error" ? toastError : t.type === "success" ? toastSuccess : toastInfo
4277
+ },
4278
+ onMouseEnter: () => {
4279
+ clearTimeout(t._timer);
4280
+ },
4281
+ onMouseLeave: () => {
4282
+ const timer = setTimeout(() => removeToast(t.id), 3e3);
4283
+ setToasts((prev) => prev.map((x) => x.id === t.id ? { ...x, _timer: timer } : x));
4284
+ }
4285
+ },
4286
+ /* @__PURE__ */ React3.createElement("div", { style: { flex: 1 } }, t.message),
4287
+ /* @__PURE__ */ React3.createElement("button", { "aria-label": "Dismiss", onClick: () => removeToast(t.id), style: toastCloseBtn }, "\u2715")
4288
+ ))), /* @__PURE__ */ React3.createElement("div", { style: modal2 }, /* @__PURE__ */ React3.createElement("div", { style: modalInner }, /* @__PURE__ */ React3.createElement("header", { style: header }, /* @__PURE__ */ React3.createElement("div", { style: brandRow }, /* @__PURE__ */ React3.createElement("div", { style: logo }, /* @__PURE__ */ React3.createElement("div", { style: logoCircle, "aria-hidden": true })), /* @__PURE__ */ React3.createElement("div", null, /* @__PURE__ */ React3.createElement("h1", { style: title2 }, "Sign up to ", agency?.name || "App"), /* @__PURE__ */ React3.createElement("div", { style: subtitle2 }, "Welcome! Create your account.")))), /* @__PURE__ */ React3.createElement("section", { style: oauthSection }, /* @__PURE__ */ React3.createElement(
4636
4289
  "button",
4637
4290
  {
4638
4291
  onClick: handleGoogle,
@@ -4698,7 +4351,7 @@ function SignUp({ agency = { name: "MyApp", logo: "" } }) {
4698
4351
  "aria-disabled": loading
4699
4352
  },
4700
4353
  loading ? "Signing up..." : "Sign Up"
4701
- ))), /* @__PURE__ */ React3.createElement("div", { style: modalFooter }, /* @__PURE__ */ React3.createElement("div", { style: belowRow }, /* @__PURE__ */ React3.createElement("span", { style: muted }, "Already have an account? "), /* @__PURE__ */ React3.createElement(import_link.default, { href: "/sign-in", style: link }, "Sign in")), /* @__PURE__ */ React3.createElement("div", { style: dividerThin }), /* @__PURE__ */ React3.createElement("div", { style: secured }, /* @__PURE__ */ React3.createElement("div", { style: securedText }, "Secured by auth")))), showKeysPanel && newKeys && /* @__PURE__ */ React3.createElement("div", { style: keysOverlay }, /* @__PURE__ */ React3.createElement("div", { style: keysPanel }, /* @__PURE__ */ React3.createElement("h3", { style: { margin: 0, marginBottom: 8 } }, "Your API keys \u2014 copy now"), /* @__PURE__ */ React3.createElement("p", { style: { margin: 0, marginBottom: 12, color: "#4b5563", fontSize: 13 } }, "Secret key is shown only once. Save it securely."), /* @__PURE__ */ React3.createElement("div", { style: { marginBottom: 10 } }, /* @__PURE__ */ React3.createElement("div", { style: { fontSize: 12, color: "#6b7280" } }, "Publishable key (use in client)"), /* @__PURE__ */ React3.createElement("pre", { style: keyBox }, newKeys.publishableKey), /* @__PURE__ */ React3.createElement("button", { onClick: () => navigator.clipboard.writeText(newKeys.publishableKey), style: copyBtn }, "Copy publishable key")), /* @__PURE__ */ React3.createElement("div", { style: { marginBottom: 6 } }, /* @__PURE__ */ React3.createElement("div", { style: { fontSize: 12, color: "#6b7280" } }, "Secret key (server only)"), /* @__PURE__ */ React3.createElement("pre", { style: keyBox }, newKeys.secretKey), /* @__PURE__ */ React3.createElement("button", { onClick: () => navigator.clipboard.writeText(newKeys.secretKey), style: copyBtn }, "Copy secret key")))));
4354
+ ))), /* @__PURE__ */ React3.createElement("div", { style: modalFooter }, /* @__PURE__ */ React3.createElement("div", { style: belowRow }, /* @__PURE__ */ React3.createElement("span", { style: muted }, "Already have an account? "), /* @__PURE__ */ React3.createElement(import_link.default, { href: "/sign-in", style: link }, "Sign in")), /* @__PURE__ */ React3.createElement("div", { style: dividerThin }), /* @__PURE__ */ React3.createElement("div", { style: secured }, /* @__PURE__ */ React3.createElement("div", { style: securedText }, "Secured by auth")))));
4702
4355
  }
4703
4356
  var overlay2 = {
4704
4357
  position: "fixed",
@@ -4707,7 +4360,7 @@ var overlay2 = {
4707
4360
  alignItems: "center",
4708
4361
  justifyContent: "center",
4709
4362
  padding: 20,
4710
- background: "linear-gradient(180deg, rgba(2,6,23,0.25), rgba(2,6,23,0.35))",
4363
+ background: "linear-gradient(180deg, rgba(2,6,23,0.22), rgba(2,6,23,0.32))",
4711
4364
  backdropFilter: "blur(6px)",
4712
4365
  minHeight: "100vh",
4713
4366
  zIndex: 9999
@@ -4716,10 +4369,10 @@ var modal2 = {
4716
4369
  width: "100%",
4717
4370
  maxWidth: 560,
4718
4371
  borderRadius: 14,
4719
- background: "rgba(10,14,20,0.65)",
4720
- // translucent neutral
4721
- border: "1px solid rgba(148,163,184,0.12)",
4722
- // more visible neutral border
4372
+ background: "linear-gradient(180deg, rgba(15,19,24,0.6), rgba(10,12,16,0.6))",
4373
+ // translucent neutral so background peeks through
4374
+ border: "1px solid rgba(99,102,106,0.12)",
4375
+ // slightly stronger neutral border
4723
4376
  boxShadow: "0 20px 50px rgba(2,6,23,0.55), inset 0 1px 0 rgba(255,255,255,0.02)",
4724
4377
  overflow: "hidden",
4725
4378
  display: "flex",
@@ -4831,7 +4484,6 @@ var input2 = {
4831
4484
  background: "rgba(255,255,255,0.02)",
4832
4485
  color: "#e6e6e6",
4833
4486
  border: "1px solid rgba(148,163,184,0.10)",
4834
- // slightly stronger border for visibility
4835
4487
  fontSize: 14,
4836
4488
  outline: "none",
4837
4489
  boxSizing: "border-box",
@@ -4843,7 +4495,6 @@ var submitButton = {
4843
4495
  padding: "10px 12px",
4844
4496
  borderRadius: 10,
4845
4497
  background: "linear-gradient(180deg,#475569,#94a3b8)",
4846
- // neutral blue-gray gradient
4847
4498
  border: "none",
4848
4499
  color: "#fff",
4849
4500
  fontWeight: 600,
@@ -4891,39 +4542,48 @@ var securedText = {
4891
4542
  fontSize: 13,
4892
4543
  fontWeight: 600
4893
4544
  };
4894
- var keysOverlay = {
4545
+ var toastContainer = {
4895
4546
  position: "fixed",
4896
- inset: 0,
4897
- zIndex: 2e4,
4547
+ top: 18,
4548
+ right: 18,
4549
+ width: 360,
4550
+ maxWidth: "calc(100% - 36px)",
4898
4551
  display: "flex",
4899
- alignItems: "center",
4900
- justifyContent: "center",
4901
- background: "rgba(2,6,23,0.45)"
4552
+ flexDirection: "column",
4553
+ gap: 10,
4554
+ zIndex: 6e4
4902
4555
  };
4903
- var keysPanel = {
4904
- background: "#fff",
4905
- color: "#111827",
4906
- padding: 18,
4556
+ var toastBase = {
4557
+ display: "flex",
4558
+ gap: 10,
4559
+ alignItems: "center",
4560
+ padding: "10px 12px",
4907
4561
  borderRadius: 10,
4908
- maxWidth: 720,
4909
- width: "95%",
4910
- boxShadow: "0 12px 40px rgba(2,6,23,0.5)"
4562
+ boxShadow: "0 8px 20px rgba(2,6,23,0.6)",
4563
+ color: "#fff",
4564
+ fontSize: 13,
4565
+ minWidth: 120
4911
4566
  };
4912
- var keyBox = {
4913
- padding: 10,
4914
- background: "#f3f4f6",
4915
- borderRadius: 8,
4916
- overflowX: "auto",
4917
- fontSize: 13
4567
+ var toastError = {
4568
+ background: "#000000",
4569
+ border: "1px solid rgba(255,255,255,0.06)"
4918
4570
  };
4919
- var copyBtn = {
4920
- marginTop: 8,
4921
- padding: "8px 10px",
4922
- borderRadius: 8,
4923
- background: "#111827",
4924
- color: "#fff",
4571
+ var toastSuccess = {
4572
+ background: "#000000",
4573
+ border: "1px solid rgba(255,255,255,0.06)"
4574
+ };
4575
+ var toastInfo = {
4576
+ background: "#000000",
4577
+ border: "1px solid rgba(255,255,255,0.06)"
4578
+ };
4579
+ var toastCloseBtn = {
4580
+ marginLeft: 8,
4581
+ background: "transparent",
4925
4582
  border: "none",
4926
- cursor: "pointer"
4583
+ color: "rgba(255,255,255,0.7)",
4584
+ cursor: "pointer",
4585
+ fontSize: 14,
4586
+ lineHeight: 1
4927
4587
  };
4928
4588
  export {
4929
4589
  provider_default as FlowlinkAuthProvider,