import { APIClient as x, APIWebSocket as I, batchRequests as V, createAPIClient as z, downloadFile as D, handleAPIError as F, isAPIError as M, retryRequest as B, uploadFile as N, withCache as j } from "./api.js";
import { buildRedirectUrl as H, canUserAccessOrganization as J, canUserInviteMembers as Q, canUserManageOrganization as W, createAuthEvent as _, decodeJWT as $, dispatchAuthEvent as K, formatBackupCode as Z, formatSessionDuration as G, generateRandomState as X, getAuthMethodDisplayName as Y, getDeviceInfo as ee, getPasskeySupport as re, getPasswordStrengthLabel as te, getRequiredAuthMethods as oe, getSessionTimeRemaining as ae, getTokenExpiration as ie, getTokenTimeToExpiry as ne, getUserDisplayName as se, getUserInitials as le, getUserPermissionsInOrganization as ue, getUserRoleInOrganization as me, getUserVerificationStatus as ce, hasPermission as de, hasRole as ge, isAuthMethodAvailable as fe, isCommonPassword as he, isPasskeySupported as pe, isSecureContext as Ee, isSessionActive as Se, isTokenExpired as ye, isUserOrganizationOwner as Ce, isUserVerified as Te, parseAuthCallback as Ae, requireSecureContext as Ue, sanitizeRedirectUrl as Re, validateBackupCode as Pe, validatePasswordStrength as be, validateSMSCode as ke, validateTOTPCode as we } from "./auth.js";
import { asyncValidation as Le, combine as Oe, confirmPassword as xe, custom as Ie, email as Ve, isValidEmail as ze, isValidPhone as De, isValidUrl as Fe, isValidUsername as Me, maxLength as Be, minLength as Ne, normalizeEmail as je, normalizePhone as qe, number as He, oneOf as Je, password as Qe, pattern as We, phone as _e, required as $e, sanitizeInput as Ke, url as Ze, username as Ge, validateField as Xe, validateForm as Ye, validateInvitationForm as er, validateOrganizationForm as rr, validatePasswordChangeForm as tr, validatePasswordResetForm as or, validateProfileForm as ar, validateSignInForm as ir, validateSignUpForm as nr } from "./validation.js";
import { CryptoUtils as lr, arrayBufferToBase64 as ur, base64Decode as mr, base64Encode as cr, base64ToArrayBuffer as dr, base64ToUint8Array as gr, base64UrlDecode as fr, base64UrlEncode as hr, calculateChecksum as pr, credentialToJSON as Er, deriveKey as Sr, generateApiKey as yr, generateBackupCodes as Cr, generateCodeChallenge as Tr, generateCodeVerifier as Ar, generateDeviceFingerprint as Ur, generateDeviceFingerprintPromise as Rr, generateNonce as Pr, generatePKCEPair as br, generateRandomBytes as kr, generateRandomString as wr, generateSalt as vr, generateSecureId as Lr, generateSecureToken as Or, generateState as xr, generateTOTPSecret as Ir, getJWTExpiration as Vr, hashPassword as zr, isJWTExpired as Dr, isValidBase64 as Fr, isValidJWT as Mr, jsonToCredentialCreationOptions as Br, jsonToCredentialRequestOptions as Nr, md5 as jr, parseJWT as qr, sha256 as Hr, simpleDecrypt as Jr, simpleEncrypt as Qr, uint8ArrayToBase64 as Wr, urlSafeDecode as _r, urlSafeEncode as $r, verifyChecksum as Kr } from "./crypto.js";
import { URLUtils as Gr, addQueryParams as Xr, buildAuthURL as Yr, buildInvitationURL as et, buildMagicLinkURL as rt, buildOAuthURL as tt, buildPasswordResetURL as ot, buildQueryString as at, buildURL as it, buildVerificationURL as nt, decodeURIComponentSafe as st, encodeURIComponentSafe as lt, extractDomain as ut, extractRootDomain as mt, getCurrentDomain as ct, getCurrentOrigin as dt, getCurrentParams as gt, getCurrentPath as ft, getCurrentURL as ht, getHash as pt, getQueryParam as Et, getURLParams as St, getURLPath as yt, hasQueryParam as Ct, isDomainAllowed as Tt, isSafeRedirectURL as At, isSubdomain as Ut, isValidHttpURL as Rt, isValidHttpsURL as Pt, isValidURL as bt, joinURL as kt, normalizeURL as wt, openInNewTab as vt, parseOAuthCallback as Lt, parseQueryString as Ot, parseURL as xt, redirectTo as It, removeHash as Vt, removeQueryParams as zt, sanitizeRedirectURL as Dt, setHash as Ft } from "./url.js";
import { FormatUtils as Bt, formatAddress as Nt, formatCompactNumber as jt, formatCurrency as qt, formatDate as Ht, formatDateTime as Jt, formatDisplayName as Qt, formatDomain as Wt, formatDuration as _t, formatEmail as $t, formatFileSize as Kt, formatHexColor as Zt, formatId as Gt, formatInitials as Xt, formatJSON as Yt, formatJSONCompact as eo, formatList as ro, formatName as to, formatNumber as oo, formatPercentage as ao, formatPhoneNumber as io, formatRGBAColor as no, formatRGBColor as so, formatRelativeTime as lo, formatTextCase as uo, formatTime as mo, formatTimeAgo as co, formatTokenPreview as go, formatURL as fo, formatValidationError as ho, getTitleAlignment as po, maskEmail as Eo, maskPhoneNumber as So, truncateMiddle as yo, truncateText as Co } from "./format.js";
import { AuthenticationError as Ao, AuthorizationError as Uo, ConfigurationError as Ro, ErrorUtils as Po, FrankAuthBaseError as bo, InvitationError as ko, MFAError as wo, NetworkError as vo, OAuthError as Lo, OrganizationError as Oo, PasskeyError as xo, RateLimitError as Io, ServerError as Vo, SessionError as zo, TimeoutError as Do, ValidationError as Fo, createAuthenticationError as Mo, createAuthorizationError as Bo, createConsoleLogger as No, createError as jo, createErrorBoundaryState as qo, createMFAError as Ho, createNetworkError as Jo, createSessionError as Qo, createValidationError as Wo, formatErrorMessage as _o, getErrorCode as $o, getErrorDetails as Ko, handleError as Zo, handleErrorBoundaryError as Go, isAuthenticationError as Xo, isAuthorizationError as Yo, isFrankAuthError as ea, isMFAError as ra, isNetworkError as ta, isOAuthError as oa, isPasskeyError as aa, isRateLimitError as ia, isRetryableError as na, isServerError as sa, isSessionError as la, isTimeoutError as ua, isValidationError as ma, logError as ca, parseAPIError as da, withRetry as ga } from "./error.js";
import { ThemeUtils as ha, adjustBrightness as pa, adjustHue as Ea, adjustSaturation as Sa, applyCSSVariables as ya, findAccessibleColor as Ca, generateCSSVariables as Ta, generateColorPalette as Aa, generateSemanticColors as Ua, generateTheme as Ra, getComponentStyles as Pa, getComponentVariant as ba, getContrastRatio as ka, getSystemTheme as wa, hexToHsl as va, hslToHex as La, isValidContrast as Oa, loadThemeFromStorage as xa, mergeThemes as Ia, removeCSSVariables as Va, resolveThemeMode as za, saveThemeToStorage as Da, validateTheme as Fa, watchSystemTheme as Ma } from "./theme.js";
import { AuthStorage as Na, AuthStorageUtils as ja, StorageManager as qa, defaultStorage as Ha, getStorageSize as Ja, isStorageAvailable as Qa, memoryStorage as Wa, sessionStorage as _a } from "@frank-auth/sdk";
const l = (e) => new Promise((t) => setTimeout(t, e)), m = (e, t, r) => {
  let o = null;
  return (...a) => {
    const i = () => {
      o = null, r || e(...a);
    }, s = r && !o;
    o && clearTimeout(o), o = setTimeout(i, t), s && e(...a);
  };
}, c = (e, t) => {
  let r;
  return (...o) => {
    r || (e(...o), r = !0, setTimeout(() => r = !1, t));
  };
}, d = (e, t) => {
  const r = { ...e };
  for (const o of t)
    delete r[o];
  return r;
}, g = (e, t) => {
  const r = {};
  for (const o of t)
    o in e && (r[o] = e[o]);
  return r;
}, f = (e) => e == null ? !0 : typeof e == "string" || Array.isArray(e) ? e.length === 0 : typeof e == "object" ? Object.keys(e).length === 0 : !1, n = (e, t) => {
  if (e === t) return !0;
  if (e == null || t == null || typeof e != typeof t) return !1;
  if (Array.isArray(e))
    return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((r, o) => n(r, t[o]));
  if (typeof e == "object") {
    const r = Object.keys(e), o = Object.keys(t);
    return r.length !== o.length ? !1 : r.every((a) => n(e[a], t[a]));
  }
  return !1;
}, h = () => Math.random().toString(36).substring(2) + Date.now().toString(36), p = (e, t, r) => Math.min(Math.max(e, t), r), E = (e, t) => e.reduce((r, o) => (r[t(o)] = o, r), {}), S = (e, t) => e.reduce((r, o) => {
  const a = t(o);
  return r[a] || (r[a] = []), r[a].push(o), r;
}, {}), y = (e) => [...new Set(e)], C = (e, t) => {
  const r = /* @__PURE__ */ new Set();
  return e.filter((o) => {
    const a = t(o);
    return r.has(a) ? !1 : (r.add(a), !0);
  });
}, T = (e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase(), A = (e) => e.replace(/(?:^\w|[A-Z]|\b\w)/g, (t, r) => r === 0 ? t.toLowerCase() : t.toUpperCase()).replace(/\s+/g, ""), U = (e) => e.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), R = (e) => e.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), P = (e, t, r = "...") => e.length <= t ? e : e.substring(0, t - r.length) + r, u = (e, t) => Math.floor(Math.random() * (t - e + 1)) + e, b = (e) => e[u(0, e.length - 1)], k = async (e, t = 3, r = 1e3) => {
  let o;
  for (let a = 1; a <= t; a++)
    try {
      return await e();
    } catch (i) {
      if (o = i, a === t) break;
      await l(r * a);
    }
  throw o;
}, w = (e, t, r = "Operation timed out") => Promise.race([
  e,
  new Promise(
    (o, a) => setTimeout(() => a(new Error(r)), t)
  )
]), v = (e, t) => {
  const r = /* @__PURE__ */ new Map();
  return (...o) => {
    const a = t ? t(...o) : JSON.stringify(o);
    if (r.has(a))
      return r.get(a);
    const i = e(...o);
    return r.set(a, i), i;
  };
};
export {
  x as APIClient,
  I as APIWebSocket,
  Na as AuthStorage,
  ja as AuthStorageUtils,
  Ao as AuthenticationError,
  Uo as AuthorizationError,
  Ro as ConfigurationError,
  lr as CryptoUtils,
  Po as ErrorUtils,
  Bt as FormatUtils,
  bo as FrankAuthBaseError,
  ko as InvitationError,
  wo as MFAError,
  vo as NetworkError,
  Lo as OAuthError,
  Oo as OrganizationError,
  xo as PasskeyError,
  Io as RateLimitError,
  Vo as ServerError,
  zo as SessionError,
  qa as StorageManager,
  ha as ThemeUtils,
  Do as TimeoutError,
  Gr as URLUtils,
  Fo as ValidationError,
  Xr as addQueryParams,
  pa as adjustBrightness,
  Ea as adjustHue,
  Sa as adjustSaturation,
  ya as applyCSSVariables,
  ur as arrayBufferToBase64,
  E as arrayToObject,
  Le as asyncValidation,
  mr as base64Decode,
  cr as base64Encode,
  dr as base64ToArrayBuffer,
  gr as base64ToUint8Array,
  fr as base64UrlDecode,
  hr as base64UrlEncode,
  V as batchRequests,
  Yr as buildAuthURL,
  et as buildInvitationURL,
  rt as buildMagicLinkURL,
  tt as buildOAuthURL,
  ot as buildPasswordResetURL,
  at as buildQueryString,
  H as buildRedirectUrl,
  it as buildURL,
  nt as buildVerificationURL,
  pr as calculateChecksum,
  A as camelCase,
  J as canUserAccessOrganization,
  Q as canUserInviteMembers,
  W as canUserManageOrganization,
  T as capitalize,
  p as clamp,
  Oe as combine,
  xe as confirmPassword,
  z as createAPIClient,
  _ as createAuthEvent,
  Mo as createAuthenticationError,
  Bo as createAuthorizationError,
  No as createConsoleLogger,
  jo as createError,
  qo as createErrorBoundaryState,
  Ho as createMFAError,
  Jo as createNetworkError,
  Qo as createSessionError,
  Wo as createValidationError,
  Er as credentialToJSON,
  Ie as custom,
  m as debounce,
  $ as decodeJWT,
  st as decodeURIComponentSafe,
  Ha as defaultStorage,
  Sr as deriveKey,
  K as dispatchAuthEvent,
  D as downloadFile,
  Ve as email,
  lt as encodeURIComponentSafe,
  ut as extractDomain,
  mt as extractRootDomain,
  Ca as findAccessibleColor,
  Nt as formatAddress,
  Z as formatBackupCode,
  jt as formatCompactNumber,
  qt as formatCurrency,
  Ht as formatDate,
  Jt as formatDateTime,
  Qt as formatDisplayName,
  Wt as formatDomain,
  _t as formatDuration,
  $t as formatEmail,
  _o as formatErrorMessage,
  Kt as formatFileSize,
  Zt as formatHexColor,
  Gt as formatId,
  Xt as formatInitials,
  Yt as formatJSON,
  eo as formatJSONCompact,
  ro as formatList,
  to as formatName,
  oo as formatNumber,
  ao as formatPercentage,
  io as formatPhoneNumber,
  no as formatRGBAColor,
  so as formatRGBColor,
  lo as formatRelativeTime,
  G as formatSessionDuration,
  uo as formatTextCase,
  mo as formatTime,
  co as formatTimeAgo,
  go as formatTokenPreview,
  fo as formatURL,
  ho as formatValidationError,
  yr as generateApiKey,
  Cr as generateBackupCodes,
  Ta as generateCSSVariables,
  Tr as generateCodeChallenge,
  Ar as generateCodeVerifier,
  Aa as generateColorPalette,
  Ur as generateDeviceFingerprint,
  Rr as generateDeviceFingerprintPromise,
  h as generateId,
  Pr as generateNonce,
  br as generatePKCEPair,
  kr as generateRandomBytes,
  X as generateRandomState,
  wr as generateRandomString,
  vr as generateSalt,
  Lr as generateSecureId,
  Or as generateSecureToken,
  Ua as generateSemanticColors,
  xr as generateState,
  Ir as generateTOTPSecret,
  Ra as generateTheme,
  Y as getAuthMethodDisplayName,
  Pa as getComponentStyles,
  ba as getComponentVariant,
  ka as getContrastRatio,
  ct as getCurrentDomain,
  dt as getCurrentOrigin,
  gt as getCurrentParams,
  ft as getCurrentPath,
  ht as getCurrentURL,
  ee as getDeviceInfo,
  $o as getErrorCode,
  Ko as getErrorDetails,
  pt as getHash,
  Vr as getJWTExpiration,
  re as getPasskeySupport,
  te as getPasswordStrengthLabel,
  Et as getQueryParam,
  oe as getRequiredAuthMethods,
  ae as getSessionTimeRemaining,
  Ja as getStorageSize,
  wa as getSystemTheme,
  po as getTitleAlignment,
  ie as getTokenExpiration,
  ne as getTokenTimeToExpiry,
  St as getURLParams,
  yt as getURLPath,
  se as getUserDisplayName,
  le as getUserInitials,
  ue as getUserPermissionsInOrganization,
  me as getUserRoleInOrganization,
  ce as getUserVerificationStatus,
  S as groupBy,
  F as handleAPIError,
  Zo as handleError,
  Go as handleErrorBoundaryError,
  de as hasPermission,
  Ct as hasQueryParam,
  ge as hasRole,
  zr as hashPassword,
  va as hexToHsl,
  La as hslToHex,
  M as isAPIError,
  fe as isAuthMethodAvailable,
  Xo as isAuthenticationError,
  Yo as isAuthorizationError,
  he as isCommonPassword,
  Tt as isDomainAllowed,
  f as isEmpty,
  n as isEqual,
  ea as isFrankAuthError,
  Dr as isJWTExpired,
  ra as isMFAError,
  ta as isNetworkError,
  oa as isOAuthError,
  aa as isPasskeyError,
  pe as isPasskeySupported,
  ia as isRateLimitError,
  na as isRetryableError,
  At as isSafeRedirectURL,
  Ee as isSecureContext,
  sa as isServerError,
  Se as isSessionActive,
  la as isSessionError,
  Qa as isStorageAvailable,
  Ut as isSubdomain,
  ua as isTimeoutError,
  ye as isTokenExpired,
  Ce as isUserOrganizationOwner,
  Te as isUserVerified,
  Fr as isValidBase64,
  Oa as isValidContrast,
  ze as isValidEmail,
  Rt as isValidHttpURL,
  Pt as isValidHttpsURL,
  Mr as isValidJWT,
  De as isValidPhone,
  bt as isValidURL,
  Fe as isValidUrl,
  Me as isValidUsername,
  ma as isValidationError,
  kt as joinURL,
  Br as jsonToCredentialCreationOptions,
  Nr as jsonToCredentialRequestOptions,
  U as kebabCase,
  xa as loadThemeFromStorage,
  ca as logError,
  Eo as maskEmail,
  So as maskPhoneNumber,
  Be as maxLength,
  jr as md5,
  v as memoize,
  Wa as memoryStorage,
  Ia as mergeThemes,
  Ne as minLength,
  je as normalizeEmail,
  qe as normalizePhone,
  wt as normalizeURL,
  He as number,
  d as omit,
  Je as oneOf,
  vt as openInNewTab,
  da as parseAPIError,
  Ae as parseAuthCallback,
  qr as parseJWT,
  Lt as parseOAuthCallback,
  Ot as parseQueryString,
  xt as parseURL,
  Qe as password,
  We as pattern,
  _e as phone,
  g as pick,
  b as randomChoice,
  u as randomInt,
  It as redirectTo,
  Va as removeCSSVariables,
  Vt as removeHash,
  zt as removeQueryParams,
  Ue as requireSecureContext,
  $e as required,
  za as resolveThemeMode,
  k as retry,
  B as retryRequest,
  Ke as sanitizeInput,
  Dt as sanitizeRedirectURL,
  Re as sanitizeRedirectUrl,
  Da as saveThemeToStorage,
  _a as sessionStorage,
  Ft as setHash,
  Hr as sha256,
  Jr as simpleDecrypt,
  Qr as simpleEncrypt,
  l as sleep,
  R as snakeCase,
  c as throttle,
  P as truncate,
  yo as truncateMiddle,
  Co as truncateText,
  Wr as uint8ArrayToBase64,
  y as unique,
  C as uniqueBy,
  N as uploadFile,
  Ze as url,
  _r as urlSafeDecode,
  $r as urlSafeEncode,
  Ge as username,
  Pe as validateBackupCode,
  Xe as validateField,
  Ye as validateForm,
  er as validateInvitationForm,
  rr as validateOrganizationForm,
  tr as validatePasswordChangeForm,
  or as validatePasswordResetForm,
  be as validatePasswordStrength,
  ar as validateProfileForm,
  ke as validateSMSCode,
  ir as validateSignInForm,
  nr as validateSignUpForm,
  we as validateTOTPCode,
  Fa as validateTheme,
  Kr as verifyChecksum,
  Ma as watchSystemTheme,
  j as withCache,
  ga as withRetry,
  w as withTimeout
};
//# sourceMappingURL=index.js.map
