flowlink-auth 2.7.4 → 2.7.5

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/index.js CHANGED
@@ -249,9 +249,9 @@ function SignIn({ onSuccess } = {}) {
249
249
  },
250
250
  body: JSON.stringify({ email, password })
251
251
  });
252
- const ct = res.headers.get("content-type") || "";
252
+ const ct2 = res.headers.get("content-type") || "";
253
253
  let data = {};
254
- if (ct.includes("application/json")) data = await res.json();
254
+ if (ct2.includes("application/json")) data = await res.json();
255
255
  else {
256
256
  const text = await res.text();
257
257
  throw new Error(`Unexpected response (status ${res.status}): ${text.slice(0, 200)}`);
@@ -359,7 +359,439 @@ var errorBox = { marginTop: 10, color: "#ffb4b4", fontSize: 13 };
359
359
  var successBox = { marginTop: 10, color: "#bef264", fontSize: 13 };
360
360
 
361
361
  // src/SignUp.jsx
362
- import React3, { useState as useState3 } from "react";
362
+ import React3, { useState as useState3, useRef as useRef2, useEffect as useEffect2 } from "react";
363
+
364
+ // ../node_modules/react-toastify/dist/index.mjs
365
+ import { isValidElement as $t } from "react";
366
+ import ut, { useEffect as Rt, useLayoutEffect as Bt, useRef as zt } from "react";
367
+ import { cloneElement as Ft, isValidElement as Ut } from "react";
368
+ import ot from "react";
369
+ import et from "react";
370
+
371
+ // ../node_modules/clsx/dist/clsx.mjs
372
+ function r(e) {
373
+ var t, f, n = "";
374
+ if ("string" == typeof e || "number" == typeof e) n += e;
375
+ else if ("object" == typeof e) if (Array.isArray(e)) {
376
+ var o = e.length;
377
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
378
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
379
+ return n;
380
+ }
381
+ function clsx() {
382
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
383
+ return n;
384
+ }
385
+ var clsx_default = clsx;
386
+
387
+ // ../node_modules/react-toastify/dist/index.mjs
388
+ import ct, { useEffect as yo, useRef as To, useState as go } from "react";
389
+ import { useRef as Kt, useSyncExternalStore as Yt } from "react";
390
+ import { useEffect as Zt, useRef as St, useState as kt } from "react";
391
+ import { useEffect as Jt, useLayoutEffect as to } from "react";
392
+ import q, { cloneElement as co, isValidElement as fo } from "react";
393
+ import O, { cloneElement as oo, isValidElement as eo } from "react";
394
+ function Mt(t) {
395
+ if (!t || typeof document == "undefined") return;
396
+ let o = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
397
+ 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));
398
+ }
399
+ 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)}}
400
+ `);
401
+ var L = (t) => typeof t == "number" && !isNaN(t);
402
+ var N = (t) => typeof t == "string";
403
+ var P = (t) => typeof t == "function";
404
+ var mt = (t) => N(t) || L(t);
405
+ var B = (t) => N(t) || P(t) ? t : null;
406
+ var pt = (t, o) => t === false || L(t) && t > 0 ? t : o;
407
+ var z = (t) => $t(t) || N(t) || P(t) || L(t);
408
+ function Z(t, o, e = 300) {
409
+ let { scrollHeight: r2, style: s } = t;
410
+ requestAnimationFrame(() => {
411
+ s.minHeight = "initial", s.height = r2 + "px", s.transition = `all ${e}ms`, requestAnimationFrame(() => {
412
+ s.height = "0", s.padding = "0", s.margin = "0", setTimeout(o, e);
413
+ });
414
+ });
415
+ }
416
+ function $({ enter: t, exit: o, appendPosition: e = false, collapse: r2 = true, collapseDuration: s = 300 }) {
417
+ return function({ children: a, position: d, preventExitTransition: c, done: T, nodeRef: g, isIn: v, playToast: x }) {
418
+ let C = e ? `${t}--${d}` : t, S = e ? `${o}--${d}` : o, E = zt(0);
419
+ return Bt(() => {
420
+ let f = g.current, p = C.split(" "), b = (n) => {
421
+ n.target === g.current && (x(), f.removeEventListener("animationend", b), f.removeEventListener("animationcancel", b), E.current === 0 && n.type !== "animationcancel" && f.classList.remove(...p));
422
+ };
423
+ (() => {
424
+ f.classList.add(...p), f.addEventListener("animationend", b), f.addEventListener("animationcancel", b);
425
+ })();
426
+ }, []), Rt(() => {
427
+ let f = g.current, p = () => {
428
+ f.removeEventListener("animationend", p), r2 ? Z(f, T, s) : T();
429
+ };
430
+ v || (c ? p() : (() => {
431
+ E.current = 1, f.className += ` ${S}`, f.addEventListener("animationend", p);
432
+ })());
433
+ }, [v]), ut.createElement(ut.Fragment, null, a);
434
+ };
435
+ }
436
+ function J(t, o) {
437
+ 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 };
438
+ }
439
+ function tt(t, o, e = false) {
440
+ 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;
441
+ }
442
+ function yt({ closeToast: t, theme: o, ariaLabel: e = "close" }) {
443
+ return ot.createElement("button", { className: `Toastify__close-button Toastify__close-button--${o}`, type: "button", onClick: (r2) => {
444
+ r2.stopPropagation(), t(true);
445
+ }, "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" })));
446
+ }
447
+ 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 }) {
448
+ let v = s || a && d === 0, x = { animationDuration: `${t}ms`, animationPlayState: o ? "running" : "paused" };
449
+ a && (x.transform = `scaleX(${d})`);
450
+ 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 : () => {
451
+ T && e();
452
+ } };
453
+ 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 }));
454
+ }
455
+ var Xt = 1;
456
+ var at = () => `${Xt++}`;
457
+ function _t(t, o, e) {
458
+ 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 = () => {
459
+ a = Array.from(c.values()), T.forEach((i) => i());
460
+ }, x = ({ containerId: i, toastId: n, updateId: u }) => {
461
+ let h = i ? i !== t : t !== 1, m = c.has(n) && u == null;
462
+ return h || m;
463
+ }, C = (i, n) => {
464
+ c.forEach((u) => {
465
+ var h;
466
+ (n == null || n === u.props.toastId) && ((h = u.toggle) == null || h.call(u, i));
467
+ });
468
+ }, S = (i) => {
469
+ var n, u;
470
+ (u = (n = i.props) == null ? void 0 : n.onClose) == null || u.call(n, i.removalReason), i.isActive = false;
471
+ }, E = (i) => {
472
+ if (i == null) c.forEach(S);
473
+ else {
474
+ let n = c.get(i);
475
+ n && S(n);
476
+ }
477
+ v();
478
+ }, f = () => {
479
+ s -= l.length, l = [];
480
+ }, p = (i) => {
481
+ var m, _;
482
+ let { toastId: n, updateId: u } = i.props, h = u == null;
483
+ 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));
484
+ };
485
+ return { id: t, props: d, observe: g, toggle: C, removeToast: E, toasts: c, clearQueue: f, buildToast: (i, n) => {
486
+ if (x(n)) return;
487
+ let { toastId: u, updateId: h, data: m, staleId: _, delay: k } = n, M = h == null;
488
+ M && s++;
489
+ 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) {
490
+ c.get(u).removalReason = D, E(u);
491
+ }, deleteToast() {
492
+ let D = c.get(u);
493
+ if (D != null) {
494
+ if (e(J(D, "removed")), c.delete(u), s--, s < 0 && (s = 0), l.length > 0) {
495
+ p(l.shift());
496
+ return;
497
+ }
498
+ v();
499
+ }
500
+ } };
501
+ 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);
502
+ let R = { content: i, props: A, staleId: _ };
503
+ d.limit && d.limit > 0 && s > d.limit && M ? l.push(R) : L(k) ? setTimeout(() => {
504
+ p(R);
505
+ }, k) : p(R);
506
+ }, setProps(i) {
507
+ d = i;
508
+ }, setToggle: (i, n) => {
509
+ let u = c.get(i);
510
+ u && (u.toggle = n);
511
+ }, isToastActive: (i) => {
512
+ var n;
513
+ return (n = c.get(i)) == null ? void 0 : n.isActive;
514
+ }, getSnapshot: () => a };
515
+ }
516
+ var I = /* @__PURE__ */ new Map();
517
+ var F = [];
518
+ var st = /* @__PURE__ */ new Set();
519
+ var Vt = (t) => st.forEach((o) => o(t));
520
+ var bt = () => I.size > 0;
521
+ function Qt() {
522
+ F.forEach((t) => nt(t.content, t.options)), F = [];
523
+ }
524
+ var vt = (t, { containerId: o }) => {
525
+ var e;
526
+ return (e = I.get(o || 1)) == null ? void 0 : e.toasts.get(t);
527
+ };
528
+ function X(t, o) {
529
+ var r2;
530
+ if (o) return !!((r2 = I.get(o)) != null && r2.isToastActive(t));
531
+ let e = false;
532
+ return I.forEach((s) => {
533
+ s.isToastActive(t) && (e = true);
534
+ }), e;
535
+ }
536
+ function ht(t) {
537
+ if (!bt()) {
538
+ F = F.filter((o) => t != null && o.options.toastId !== t);
539
+ return;
540
+ }
541
+ if (t == null || mt(t)) I.forEach((o) => {
542
+ o.removeToast(t);
543
+ });
544
+ else if (t && ("containerId" in t || "id" in t)) {
545
+ let o = I.get(t.containerId);
546
+ o ? o.removeToast(t.id) : I.forEach((e) => {
547
+ e.removeToast(t.id);
548
+ });
549
+ }
550
+ }
551
+ var Ct = (t = {}) => {
552
+ I.forEach((o) => {
553
+ o.props.limit && (!t.containerId || o.id === t.containerId) && o.clearQueue();
554
+ });
555
+ };
556
+ function nt(t, o) {
557
+ z(t) && (bt() || F.push({ content: t, options: o }), I.forEach((e) => {
558
+ e.buildToast(t, o);
559
+ }));
560
+ }
561
+ function xt(t) {
562
+ var o;
563
+ (o = I.get(t.containerId || 1)) == null || o.setToggle(t.id, t.fn);
564
+ }
565
+ function rt(t, o) {
566
+ I.forEach((e) => {
567
+ (o == null || !(o != null && o.containerId) || (o == null ? void 0 : o.containerId) === e.id) && e.toggle(t, o == null ? void 0 : o.id);
568
+ });
569
+ }
570
+ function Et(t) {
571
+ let o = t.containerId || 1;
572
+ return { subscribe(e) {
573
+ let r2 = _t(o, t, Vt);
574
+ I.set(o, r2);
575
+ let s = r2.observe(e);
576
+ return Qt(), () => {
577
+ s(), I.delete(o);
578
+ };
579
+ }, setProps(e) {
580
+ var r2;
581
+ (r2 = I.get(o)) == null || r2.setProps(e);
582
+ }, getSnapshot() {
583
+ var e;
584
+ return (e = I.get(o)) == null ? void 0 : e.getSnapshot();
585
+ } };
586
+ }
587
+ function Pt(t) {
588
+ return st.add(t), () => {
589
+ st.delete(t);
590
+ };
591
+ }
592
+ function Wt(t) {
593
+ return t && (N(t.toastId) || L(t.toastId)) ? t.toastId : at();
594
+ }
595
+ function U(t, o) {
596
+ return nt(t, o), o.toastId;
597
+ }
598
+ function V(t, o) {
599
+ return { ...o, type: o && o.type || t, toastId: Wt(o) };
600
+ }
601
+ function Q(t) {
602
+ return (o, e) => U(o, V(t, e));
603
+ }
604
+ function y(t, o) {
605
+ return U(t, V("default", o));
606
+ }
607
+ y.loading = (t, o) => U(t, V("default", { isLoading: true, autoClose: false, closeOnClick: false, closeButton: false, draggable: false, ...o }));
608
+ function Gt(t, { pending: o, error: e, success: r2 }, s) {
609
+ let l;
610
+ o && (l = N(o) ? y.loading(o, s) : y.loading(o.render, { ...s, ...o }));
611
+ let a = { isLoading: null, autoClose: null, closeOnClick: null, closeButton: null, draggable: null }, d = (T, g, v) => {
612
+ if (g == null) {
613
+ y.dismiss(l);
614
+ return;
615
+ }
616
+ let x = { type: T, ...a, ...s, data: v }, C = N(g) ? { render: g } : g;
617
+ return l ? y.update(l, { ...x, ...C }) : y(C.render, { ...x, ...C }), v;
618
+ }, c = P(t) ? t() : t;
619
+ return c.then((T) => d("success", r2, T)).catch((T) => d("error", e, T)), c;
620
+ }
621
+ y.promise = Gt;
622
+ y.success = Q("success");
623
+ y.info = Q("info");
624
+ y.error = Q("error");
625
+ y.warning = Q("warning");
626
+ y.warn = y.warning;
627
+ y.dark = (t, o) => U(t, V("default", { theme: "dark", ...o }));
628
+ function qt(t) {
629
+ ht(t);
630
+ }
631
+ y.dismiss = qt;
632
+ y.clearWaitingQueue = Ct;
633
+ y.isActive = X;
634
+ y.update = (t, o = {}) => {
635
+ let e = vt(t, o);
636
+ if (e) {
637
+ let { props: r2, content: s } = e, l = { delay: 100, ...r2, ...o, toastId: o.toastId || t, updateId: at() };
638
+ l.toastId !== t && (l.staleId = t);
639
+ let a = l.render || s;
640
+ delete l.render, U(a, l);
641
+ }
642
+ };
643
+ y.done = (t) => {
644
+ y.update(t, { progress: 1 });
645
+ };
646
+ y.onChange = Pt;
647
+ y.play = (t) => rt(true, t);
648
+ y.pause = (t) => rt(false, t);
649
+ function It(t) {
650
+ var a;
651
+ let { subscribe: o, getSnapshot: e, setProps: r2 } = Kt(Et(t)).current;
652
+ r2(t);
653
+ let s = (a = Yt(o, e, e)) == null ? void 0 : a.slice();
654
+ function l(d) {
655
+ if (!s) return [];
656
+ let c = /* @__PURE__ */ new Map();
657
+ return t.newestOnTop && s.reverse(), s.forEach((T) => {
658
+ let { position: g } = T.props;
659
+ c.has(g) || c.set(g, []), c.get(g).push(T);
660
+ }), Array.from(c, (T) => d(T[0], T[1]));
661
+ }
662
+ return { getToastToRender: l, isToastActive: X, count: s == null ? void 0 : s.length };
663
+ }
664
+ function At(t) {
665
+ 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;
666
+ xt({ id: t.toastId, containerId: t.containerId, fn: e }), Zt(() => {
667
+ if (t.pauseOnFocusLoss) return x(), () => {
668
+ C();
669
+ };
670
+ }, [t.pauseOnFocusLoss]);
671
+ function x() {
672
+ document.hasFocus() || p(), window.addEventListener("focus", f), window.addEventListener("blur", p);
673
+ }
674
+ function C() {
675
+ window.removeEventListener("focus", f), window.removeEventListener("blur", p);
676
+ }
677
+ function S(m) {
678
+ if (t.draggable === true || t.draggable === m.pointerType) {
679
+ b();
680
+ let _ = l.current;
681
+ 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);
682
+ }
683
+ }
684
+ function E(m) {
685
+ let { top: _, bottom: k, left: M, right: A } = l.current.getBoundingClientRect();
686
+ m.nativeEvent.type !== "touchend" && t.pauseOnHover && m.clientX >= M && m.clientX <= A && m.clientY >= _ && m.clientY <= k ? p() : f();
687
+ }
688
+ function f() {
689
+ e(true);
690
+ }
691
+ function p() {
692
+ e(false);
693
+ }
694
+ function b() {
695
+ a.didMove = false, document.addEventListener("pointermove", n), document.addEventListener("pointerup", u);
696
+ }
697
+ function i() {
698
+ document.removeEventListener("pointermove", n), document.removeEventListener("pointerup", u);
699
+ }
700
+ function n(m) {
701
+ let _ = l.current;
702
+ if (a.canDrag && _) {
703
+ 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);
704
+ let k = t.draggableDirection === "x" ? `${a.delta}px, var(--y)` : `0, calc(${a.delta}px + var(--y))`;
705
+ _.style.transform = `translate3d(${k},0)`, _.style.opacity = `${1 - Math.abs(a.delta / a.removalDistance)}`;
706
+ }
707
+ }
708
+ function u() {
709
+ i();
710
+ let m = l.current;
711
+ if (a.canDrag && a.didMove && m) {
712
+ if (a.canDrag = false, Math.abs(a.delta) > a.removalDistance) {
713
+ s(true), t.closeToast(true), t.collapseAll();
714
+ return;
715
+ }
716
+ m.style.transition = "transform 0.2s, opacity 0.2s", m.style.removeProperty("transform"), m.style.removeProperty("opacity");
717
+ }
718
+ }
719
+ let h = { onPointerDown: S, onPointerUp: E };
720
+ return d && c && (h.onMouseEnter = p, t.stacked || (h.onMouseLeave = f)), v && (h.onClick = (m) => {
721
+ g && g(m), a.canCloseOnClick && T(true);
722
+ }), { playToast: f, pauseToast: p, isRunning: o, preventExitTransition: r2, toastRef: l, eventHandlers: h };
723
+ }
724
+ var Ot = typeof window != "undefined" ? to : Jt;
725
+ 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 });
726
+ function ao(t) {
727
+ 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" }));
728
+ }
729
+ function so(t) {
730
+ 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" }));
731
+ }
732
+ function no(t) {
733
+ 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" }));
734
+ }
735
+ function ro(t) {
736
+ 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" }));
737
+ }
738
+ function io() {
739
+ return O.createElement("div", { className: "Toastify__spinner" });
740
+ }
741
+ var W = { info: so, warning: ao, success: no, error: ro, spinner: io };
742
+ var lo = (t) => t in W;
743
+ function Nt({ theme: t, type: o, isLoading: e, icon: r2 }) {
744
+ let s = null, l = { theme: t, type: o };
745
+ 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;
746
+ }
747
+ var wt = (t) => {
748
+ 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;
749
+ 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 })));
750
+ };
751
+ var K = (t, o = false) => ({ enter: `Toastify--animate Toastify__${t}-enter`, exit: `Toastify--animate Toastify__${t}-exit`, appendPosition: o });
752
+ var lt = $(K("bounce", true));
753
+ var mo = $(K("slide", true));
754
+ var po = $(K("zoom"));
755
+ var uo = $(K("flip"));
756
+ 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" };
757
+ function Lt(t) {
758
+ 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;
759
+ function S(f) {
760
+ let p = clsx_default("Toastify__toast-container", `Toastify__toast-container--${f}`, { ["Toastify__toast-container--rtl"]: v });
761
+ return P(T) ? T({ position: f, rtl: v, defaultClassName: p }) : clsx_default(p, B(T));
762
+ }
763
+ function E() {
764
+ e && (s(true), y.play());
765
+ }
766
+ return Ot(() => {
767
+ var f;
768
+ if (e) {
769
+ let p = l.current.querySelectorAll('[data-in="true"]'), b = 12, i = (f = o.position) == null ? void 0 : f.includes("top"), n = 0, u = 0;
770
+ Array.from(p).reverse().forEach((h, m) => {
771
+ let _ = h;
772
+ _.classList.add("Toastify__toast--stacked"), m > 0 && (_.dataset.collapsed = `${r2}`), _.dataset.pos || (_.dataset.pos = i ? "top" : "bot");
773
+ let k = n * (r2 ? 0.2 : 1) + (r2 ? 0 : b * m);
774
+ _.style.setProperty("--y", `${i ? k : k * -1}px`), _.style.setProperty("--g", `${b}`), _.style.setProperty("--s", `${1 - (r2 ? u : 0)}`), n += _.offsetHeight, u += 0.025;
775
+ });
776
+ }
777
+ }, [r2, c, e]), yo(() => {
778
+ function f(p) {
779
+ var i;
780
+ let b = l.current;
781
+ 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());
782
+ }
783
+ return document.addEventListener("keydown", f), () => {
784
+ document.removeEventListener("keydown", f);
785
+ };
786
+ }, [C]), ct.createElement("section", { ref: l, className: "Toastify", id: x, onMouseEnter: () => {
787
+ e && (s(false), y.pause());
788
+ }, onMouseLeave: E, "aria-live": "polite", "aria-atomic": "false", "aria-relevant": "additions text", "aria-label": o["aria-label"] }, a((f, p) => {
789
+ let b = p.length ? { ...g } : { ...g, pointerEvents: "none" };
790
+ 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)));
791
+ }));
792
+ }
793
+
794
+ // src/SignUp.jsx
363
795
  function SignUp() {
364
796
  const {
365
797
  publishableKey,
@@ -375,8 +807,13 @@ function SignUp() {
375
807
  const [email, setEmail] = useState3("");
376
808
  const [password, setPassword] = useState3("");
377
809
  const [loading, setLoading] = useState3(false);
378
- const [error, setError] = useState3(null);
379
810
  const [message, setMessage] = useState3(null);
811
+ const redirectTimer = useRef2(null);
812
+ useEffect2(() => {
813
+ return () => {
814
+ if (redirectTimer.current) clearTimeout(redirectTimer.current);
815
+ };
816
+ }, []);
380
817
  if (loadingUser) return null;
381
818
  if (user && redirect) {
382
819
  if (typeof redirectTo === "function") redirectTo(redirect);
@@ -385,7 +822,7 @@ function SignUp() {
385
822
  }
386
823
  async function submit(e) {
387
824
  e.preventDefault();
388
- setError(null);
825
+ if (loading) return;
389
826
  setMessage(null);
390
827
  setLoading(true);
391
828
  const url = `${(baseUrl || "").replace(/\/+$/, "")}/api/sdk/signup`;
@@ -399,31 +836,39 @@ function SignUp() {
399
836
  },
400
837
  body: JSON.stringify({ name, email, password })
401
838
  });
402
- const data = await res.json().catch(() => ({}));
403
- if (!res.ok) throw new Error(data.error || "Signup failed");
839
+ const data = await res.json().catch(async () => {
840
+ const text = await res.text().catch(() => "");
841
+ return { _raw: text };
842
+ });
843
+ if (!res.ok) {
844
+ const errMsg = data?.error || data?._raw || `Signup failed (${res.status})`;
845
+ throw new Error(errMsg);
846
+ }
404
847
  if (data.user && typeof setUser === "function") setUser(data.user);
405
848
  if (typeof fetchMe === "function") await fetchMe();
406
849
  setMessage("Account created. Redirecting\u2026");
850
+ y.success("Account created. Redirecting\u2026");
407
851
  if (redirect) {
408
- setTimeout(() => {
852
+ redirectTimer.current = setTimeout(() => {
409
853
  if (typeof redirectTo === "function") redirectTo(redirect);
410
854
  else if (typeof window !== "undefined") window.location.assign(redirect);
411
855
  }, 300);
412
856
  }
413
857
  } catch (err) {
414
- setError(err?.message ?? "Network error");
858
+ const text = err?.message ?? "Network error";
859
+ y.error(text);
415
860
  console.error("Signup error:", err);
416
861
  } finally {
417
862
  setLoading(false);
418
863
  }
419
864
  }
420
865
  async function startOAuthFlow(provider) {
421
- setError(null);
866
+ if (loading) return;
422
867
  setLoading(true);
423
868
  try {
424
869
  const rid = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
425
870
  const callbackUrl = encodeURIComponent(`${window.location.origin}/signup`);
426
- const sdkBase = typeof process !== "undefined" && process.env && process.env.NEXT_PUBLIC_FLOWLINK_BASE_URL || baseUrl || window.location.origin.replace(/\/+$/, "");
871
+ const sdkBase = baseUrl || window.location.origin.replace(/\/+$/, "");
427
872
  const startUrl = `${sdkBase}/sdk/auth/start?rid=${rid}&source=${encodeURIComponent(provider)}&callbackUrl=${callbackUrl}`;
428
873
  if (!publishableKey) {
429
874
  throw new Error("Missing publishable key (client side). Set NEXT_PUBLIC_FLOWLINK_PUBLISHABLE_KEY or provide publishableKey in provider.");
@@ -444,7 +889,7 @@ function SignUp() {
444
889
  window.location.href = data.oauthUrl;
445
890
  } catch (err) {
446
891
  console.error("OAuth start error:", err);
447
- setError(err?.message || "OAuth start failed");
892
+ y.error(err?.message || "OAuth start failed");
448
893
  setLoading(false);
449
894
  }
450
895
  }
@@ -456,115 +901,260 @@ function SignUp() {
456
901
  if (e && typeof e.preventDefault === "function") e.preventDefault();
457
902
  startOAuthFlow("github");
458
903
  };
459
- return /* @__PURE__ */ React3.createElement("div", { style: overlay2 }, /* @__PURE__ */ React3.createElement("div", { style: modal2 }, /* @__PURE__ */ React3.createElement("h2", { style: title2 }, "Create account"), /* @__PURE__ */ React3.createElement("form", { onSubmit: submit }, /* @__PURE__ */ React3.createElement("label", { style: label2 }, "Full name"), /* @__PURE__ */ React3.createElement(
904
+ return /* @__PURE__ */ React3.createElement("div", { style: page }, /* @__PURE__ */ React3.createElement(Lt, { position: "top-right", autoClose: 5e3 }), /* @__PURE__ */ React3.createElement("div", { style: card }, /* @__PURE__ */ React3.createElement("div", { style: cardInner }, /* @__PURE__ */ React3.createElement("div", { style: brand }, /* @__PURE__ */ React3.createElement("div", { style: brandRow }, /* @__PURE__ */ React3.createElement("div", { style: logoPlaceholder, "aria-hidden": true }), /* @__PURE__ */ React3.createElement("h1", { style: brandTitle }, "Create account")), /* @__PURE__ */ React3.createElement("div", { style: brandSub }, /* @__PURE__ */ React3.createElement("div", { style: brandLead }, "Sign up to continue"), /* @__PURE__ */ React3.createElement("div", { style: brandMuted }, "Welcome! Create your account."))), /* @__PURE__ */ React3.createElement("div", { style: oauthRow }, /* @__PURE__ */ React3.createElement(
905
+ "button",
906
+ {
907
+ onClick: handleGoogle,
908
+ type: "button",
909
+ style: { ...oauthButton, ...oauthGoogle },
910
+ disabled: loading,
911
+ "aria-disabled": loading
912
+ },
913
+ /* @__PURE__ */ React3.createElement("svg", { width: 18, style: { marginRight: 10 }, viewBox: "-3 0 262 262", xmlns: "http://www.w3.org/2000/svg", fill: "#000000", "aria-hidden": true }, /* @__PURE__ */ React3.createElement("path", { d: "M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027", fill: "#4285F4" }), /* @__PURE__ */ React3.createElement("path", { d: "M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1", fill: "#34A853" }), /* @__PURE__ */ React3.createElement("path", { d: "M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782", fill: "#FBBC05" }), /* @__PURE__ */ React3.createElement("path", { d: "M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251", fill: "#EB4335" })),
914
+ /* @__PURE__ */ React3.createElement("span", null, loading ? "Loading..." : "Continue with Google")
915
+ ), /* @__PURE__ */ React3.createElement(
916
+ "button",
917
+ {
918
+ onClick: handleGithub,
919
+ type: "button",
920
+ style: { ...oauthButton, ...oauthGithub },
921
+ disabled: loading,
922
+ "aria-disabled": loading
923
+ },
924
+ /* @__PURE__ */ React3.createElement("svg", { width: 18, style: { marginRight: 10 }, xmlns: "http://www.w3.org/2000/svg", fill: "white", viewBox: "0 0 20 20", "aria-hidden": true }, /* @__PURE__ */ React3.createElement("path", { fillRule: "evenodd", d: "M10 .333A9.911 9.911 0 0 0 6.866 19.65c.5.092.678-.215.678-.477 0-.237-.01-1.017-.014-1.845-2.757.6-3.338-1.169-3.338-1.169a2.627 2.627 0 0 0-1.1-1.451c-.9-.615.07-.6.07-.6a2.084 2.084 0 0 1 1.518 1.021 2.11 2.11 0 0 0 2.884.823c.044-.503.268-.973.63-1.325-2.2-.25-4.516-1.1-4.516-4.9A3.832 3.832 0 0 1 4.7 7.068a3.56 3.56 0 0 1 .095-2.623s.832-.266 2.726 1.016a9.409 9.409 0 0 1 4.962 0c1.89-1.282 2.717-1.016 2.717-1.016.366.83.402 1.768.1 2.623a3.827 3.827 0 0 1 1.02 2.659c0 3.807-2.319 4.644-4.525 4.889a2.366 2.366 0 0 1 .673 1.834c0 1.326-.012 2.394-.012 2.72 0 .263.18.572.681.475A9.911 9.911 0 0 0 10 .333Z", clipRule: "evenodd" })),
925
+ /* @__PURE__ */ React3.createElement("span", null, loading ? "Loading..." : "Continue with GitHub")
926
+ )), /* @__PURE__ */ React3.createElement("div", { style: dividerRow }, /* @__PURE__ */ React3.createElement("div", { style: line }), /* @__PURE__ */ React3.createElement("div", { style: orText }, "or"), /* @__PURE__ */ React3.createElement("div", { style: line })), /* @__PURE__ */ React3.createElement("form", { onSubmit: submit, style: form }, /* @__PURE__ */ React3.createElement("label", { style: label2, htmlFor: "name" }, /* @__PURE__ */ React3.createElement("span", { style: labelText }, "Name"), /* @__PURE__ */ React3.createElement(
460
927
  "input",
461
928
  {
462
- name: "name",
463
- style: input2,
929
+ id: "name",
930
+ type: "text",
464
931
  value: name,
465
932
  onChange: (e) => setName(e.target.value),
933
+ placeholder: "Your name",
934
+ style: input2,
466
935
  autoComplete: "name"
467
936
  }
468
- ), /* @__PURE__ */ React3.createElement("label", { style: label2 }, "Email"), /* @__PURE__ */ React3.createElement(
937
+ )), /* @__PURE__ */ React3.createElement("label", { style: label2, htmlFor: "email" }, /* @__PURE__ */ React3.createElement("span", { style: labelText }, "Email address"), /* @__PURE__ */ React3.createElement(
469
938
  "input",
470
939
  {
471
- name: "email",
940
+ id: "email",
472
941
  type: "email",
473
- style: input2,
474
942
  value: email,
475
943
  onChange: (e) => setEmail(e.target.value),
476
944
  required: true,
945
+ placeholder: "you@example.com",
946
+ style: input2,
477
947
  autoComplete: "email"
478
948
  }
479
- ), /* @__PURE__ */ React3.createElement("label", { style: label2 }, "Password"), /* @__PURE__ */ React3.createElement(
949
+ )), /* @__PURE__ */ React3.createElement("label", { style: label2, htmlFor: "password" }, /* @__PURE__ */ React3.createElement("span", { style: labelText }, "Password"), /* @__PURE__ */ React3.createElement(
480
950
  "input",
481
951
  {
482
- name: "password",
952
+ id: "password",
483
953
  type: "password",
484
- style: input2,
485
954
  value: password,
486
955
  onChange: (e) => setPassword(e.target.value),
487
956
  required: true,
957
+ placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",
958
+ style: input2,
488
959
  autoComplete: "new-password"
489
960
  }
490
- ), /* @__PURE__ */ React3.createElement("div", { style: { marginTop: 12 } }, /* @__PURE__ */ React3.createElement("button", { style: button2, type: "submit", disabled: loading }, loading ? "Creating..." : "Create account")), /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", gap: 8, marginTop: 16 } }, /* @__PURE__ */ React3.createElement(
491
- "button",
492
- {
493
- type: "button",
494
- onClick: handleGoogle,
495
- style: oauthButtonGoogle2
496
- },
497
- "Continue with Google"
498
- ), /* @__PURE__ */ React3.createElement(
961
+ )), /* @__PURE__ */ React3.createElement(
499
962
  "button",
500
963
  {
501
- type: "button",
502
- onClick: handleGithub,
503
- style: oauthButtonGithub2
964
+ type: "submit",
965
+ style: submitButton,
966
+ disabled: loading,
967
+ "aria-disabled": loading
504
968
  },
505
- "Continue with GitHub"
506
- )), error && /* @__PURE__ */ React3.createElement("div", { style: errorBox2 }, error), message && /* @__PURE__ */ React3.createElement("div", { style: successBox2 }, message))));
969
+ loading ? "Signing up..." : "Sign Up"
970
+ ))), /* @__PURE__ */ React3.createElement("div", { style: below }, /* @__PURE__ */ React3.createElement("div", { style: belowRow }, /* @__PURE__ */ React3.createElement("span", { style: muted }, "Already have an account? "), /* @__PURE__ */ React3.createElement("a", { 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")))));
507
971
  }
508
- var overlay2 = {
972
+ var page = {
509
973
  position: "fixed",
510
974
  inset: 0,
511
- background: "rgba(0,0,0,0.5)",
512
975
  display: "flex",
513
- justifyContent: "center",
514
976
  alignItems: "center",
515
- padding: 20,
977
+ justifyContent: "center",
978
+ padding: 24,
979
+ background: "linear-gradient(to bottom, #0b1220 0%, #071023 40%, #02040a 100%)",
980
+ color: "#f8e9d3",
981
+ minHeight: "100vh",
516
982
  zIndex: 9999
517
983
  };
518
- var modal2 = {
984
+ var card = {
519
985
  width: "100%",
520
- maxWidth: 420,
521
- background: "#0f1724",
522
- borderRadius: 12,
523
- padding: 24,
986
+ maxWidth: 520,
987
+ borderRadius: 18,
988
+ background: "linear-gradient(180deg, rgba(15,19,36,0.9) 0%, rgba(6,10,18,0.95) 100%)",
989
+ border: "1px solid rgba(148,163,184,0.06)",
990
+ boxShadow: "0 10px 30px rgba(2,6,23,0.6)",
991
+ overflow: "hidden",
992
+ display: "flex",
993
+ flexDirection: "column",
994
+ gap: 12
995
+ };
996
+ var cardInner = {
997
+ padding: 26,
998
+ display: "flex",
999
+ flexDirection: "column",
1000
+ gap: 18
1001
+ };
1002
+ var brand = {
1003
+ display: "flex",
1004
+ flexDirection: "column",
1005
+ gap: 8
1006
+ };
1007
+ var brandRow = {
1008
+ display: "flex",
1009
+ alignItems: "center",
1010
+ gap: 12
1011
+ };
1012
+ var logoPlaceholder = {
1013
+ width: 36,
1014
+ height: 36,
1015
+ borderRadius: 999,
1016
+ background: "linear-gradient(135deg,#2b313a,#0f1724)"
1017
+ };
1018
+ var brandTitle = {
1019
+ margin: 0,
1020
+ fontSize: 20,
1021
+ fontWeight: 600,
524
1022
  color: "#fff"
525
1023
  };
526
- var title2 = { margin: 0, fontSize: 20, fontWeight: 600 };
527
- var label2 = { marginTop: 10, display: "block", fontSize: 13 };
1024
+ var brandSub = {
1025
+ display: "flex",
1026
+ flexDirection: "column",
1027
+ gap: 4
1028
+ };
1029
+ var brandLead = {
1030
+ fontSize: 15,
1031
+ color: "rgba(255,255,255,0.95)"
1032
+ };
1033
+ var brandMuted = {
1034
+ fontSize: 13,
1035
+ color: "rgba(255,255,255,0.65)",
1036
+ marginTop: 2
1037
+ };
1038
+ var oauthRow = {
1039
+ display: "flex",
1040
+ gap: 10,
1041
+ marginTop: 8
1042
+ };
1043
+ var oauthButton = {
1044
+ flex: 1,
1045
+ display: "inline-flex",
1046
+ alignItems: "center",
1047
+ justifyContent: "center",
1048
+ padding: "10px 12px",
1049
+ borderRadius: 10,
1050
+ border: "1px solid rgba(148,163,184,0.08)",
1051
+ fontSize: 14,
1052
+ cursor: "pointer",
1053
+ userSelect: "none",
1054
+ gap: 8
1055
+ };
1056
+ var oauthGoogle = {
1057
+ background: "rgba(255,255,255,0.06)",
1058
+ color: "#fff"
1059
+ };
1060
+ var oauthGithub = {
1061
+ background: "rgba(255,255,255,0.03)",
1062
+ color: "#fff"
1063
+ };
1064
+ var dividerRow = {
1065
+ display: "flex",
1066
+ alignItems: "center",
1067
+ gap: 12,
1068
+ marginTop: 14
1069
+ };
1070
+ var line = {
1071
+ flex: 1,
1072
+ height: 1,
1073
+ background: "rgba(148,163,184,0.06)"
1074
+ };
1075
+ var orText = {
1076
+ fontSize: 13,
1077
+ color: "rgba(255,255,255,0.6)",
1078
+ padding: "0 8px"
1079
+ };
1080
+ var form = {
1081
+ display: "flex",
1082
+ flexDirection: "column",
1083
+ gap: 12,
1084
+ marginTop: 6
1085
+ };
1086
+ var label2 = {
1087
+ display: "flex",
1088
+ flexDirection: "column",
1089
+ gap: 6
1090
+ };
1091
+ var labelText = {
1092
+ fontSize: 13,
1093
+ color: "rgba(255,255,255,0.66)"
1094
+ };
528
1095
  var input2 = {
529
1096
  width: "100%",
530
1097
  padding: "10px 12px",
531
- borderRadius: 8,
532
- background: "#0b1220",
533
- color: "#fff",
534
- border: "1px solid #1e293b",
535
- marginTop: 6
1098
+ borderRadius: 10,
1099
+ background: "rgba(11,18,32,0.5)",
1100
+ color: "#f8e9d3",
1101
+ border: "1px solid rgba(148,163,184,0.06)",
1102
+ fontSize: 14,
1103
+ outline: "none",
1104
+ boxSizing: "border-box"
536
1105
  };
537
- var button2 = {
538
- marginTop: 15,
1106
+ var submitButton = {
1107
+ marginTop: 6,
539
1108
  width: "100%",
540
1109
  padding: "10px 12px",
541
- borderRadius: 8,
542
- background: "#2563eb",
1110
+ borderRadius: 10,
1111
+ background: "linear-gradient(180deg,#2563eb,#60a5fa)",
543
1112
  border: "none",
544
1113
  color: "#fff",
545
1114
  fontWeight: 600,
546
- cursor: "pointer"
1115
+ cursor: "pointer",
1116
+ fontSize: 15,
1117
+ display: "inline-flex",
1118
+ alignItems: "center",
1119
+ justifyContent: "center"
547
1120
  };
548
- var oauthButtonGoogle2 = {
549
- flex: 1,
550
- padding: "10px 12px",
551
- borderRadius: 8,
552
- background: "#db4437",
553
- color: "#fff",
554
- border: "none",
555
- cursor: "pointer"
1121
+ var below = {
1122
+ padding: "12px 20px 20px 20px",
1123
+ borderTop: "1px solid rgba(148,163,184,0.03)",
1124
+ display: "flex",
1125
+ flexDirection: "column",
1126
+ gap: 10
556
1127
  };
557
- var oauthButtonGithub2 = {
558
- flex: 1,
559
- padding: "10px 12px",
560
- borderRadius: 8,
561
- background: "#24292f",
562
- color: "#fff",
563
- border: "none",
564
- cursor: "pointer"
1128
+ var belowRow = {
1129
+ textAlign: "center",
1130
+ display: "flex",
1131
+ justifyContent: "center",
1132
+ gap: 8,
1133
+ alignItems: "center"
1134
+ };
1135
+ var muted = {
1136
+ color: "rgba(255,255,255,0.65)",
1137
+ fontSize: 13
1138
+ };
1139
+ var link = {
1140
+ color: "#3b82f6",
1141
+ textDecoration: "none",
1142
+ fontWeight: 600
1143
+ };
1144
+ var dividerThin = {
1145
+ height: 1,
1146
+ background: "rgba(148,163,184,0.05)",
1147
+ marginTop: 6,
1148
+ marginBottom: 6
1149
+ };
1150
+ var secured = {
1151
+ textAlign: "center"
1152
+ };
1153
+ var securedText = {
1154
+ color: "rgba(255,255,255,0.9)",
1155
+ fontSize: 13,
1156
+ fontWeight: 600
565
1157
  };
566
- var errorBox2 = { marginTop: 10, color: "#ffb4b4", fontSize: 13 };
567
- var successBox2 = { marginTop: 10, color: "#bef264", fontSize: 13 };
568
1158
  export {
569
1159
  provider_default as FlowlinkAuthProvider,
570
1160
  SignIn,