{"version":3,"file":"AuthGuardLoading.mjs","sources":["../../../../src/lib/auth/authGuards/AuthGuardLoading.tsx"],"sourcesContent":["import { memo, type ReactNode } from 'react';\nimport { Spinner } from '@/lib/ui/feedback/Spinner';\n\n/**\n * Props for the AuthGuardLoading component.\n */\ninterface AuthGuardLoadingProps {\n  /**\n   * Optional custom loading content to display instead of the default spinner.\n   * When provided, this completely replaces the default loading UI.\n   */\n  fallback?: ReactNode;\n\n  /**\n   * Optional CSS class name for the loading container.\n   * @default 'auth-guard-loading'\n   */\n  className?: string;\n\n  /**\n   * Optional label for accessibility (screen readers).\n   * @default 'Checking authentication...'\n   */\n  ariaLabel?: string;\n}\n\n/**\n * Shared loading component for authentication guards.\n *\n * This component provides a consistent loading experience across all auth guards\n * (RequireAuth, RequireRole, RequirePermission) while checking authentication\n * and authorization status.\n *\n * DESIGN RATIONALE:\n * - Eliminates code duplication across auth guard components\n * - Provides a single point of customization for loading states\n * - Ensures consistent UX during authentication checks\n * - Supports accessibility with proper ARIA attributes\n *\n * @example\n * ```tsx\n * // Default usage\n * <AuthGuardLoading />\n *\n * // With custom fallback\n * <AuthGuardLoading fallback={<CustomLoadingScreen />} />\n *\n * // With custom className\n * <AuthGuardLoading className=\"custom-loading-container\" />\n * ```\n */\nexport const AuthGuardLoading = memo(\n  ({\n    fallback,\n    className = 'auth-guard-loading',\n    ariaLabel = 'Checking authentication...',\n  }: AuthGuardLoadingProps) => {\n    // If a custom fallback is provided, render it directly\n    if (typeof fallback !== 'undefined') {\n      return <>{fallback}</>;\n    }\n\n    // Default loading UI with spinner\n    return (\n      <div className={className} role=\"status\" aria-label={ariaLabel} aria-busy=\"true\">\n        <Spinner size=\"lg\" />\n      </div>\n    );\n  }\n);\n"],"names":["AuthGuardLoading","memo","fallback","className","ariaLabel","jsx","Spinner"],"mappings":";;;AAmDO,MAAMA,IAAmBC;AAAA,EAC9B,CAAC;AAAA,IACC,UAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAY;AAAA,EAAA,MAGR,OAAOF,IAAa,6BACZ,UAAAA,EAAA,CAAS,IAKnB,gBAAAG,EAAC,OAAA,EAAI,WAAAF,GAAsB,MAAK,UAAS,cAAYC,GAAW,aAAU,QACxE,UAAA,gBAAAC,EAACC,GAAA,EAAQ,MAAK,MAAK,GACrB;AAGN;"}