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