{"version":3,"file":"errorMessages.mjs","sources":["../../../src/lib/monitoring/errorMessages.ts"],"sourcesContent":["/**\n * @file Context-Aware Error Messages\n * @description User-friendly, actionable error messages based on context\n *\n * This module provides structured error messages that are:\n * - Context-aware: Tailored to what the user was trying to do\n * - Actionable: Provides clear suggestions for recovery\n * - User-friendly: Avoids technical jargon for end users\n * - Developer-friendly: Includes technical details in development\n */\n\nimport type { AppError, ErrorCategory } from './errorTypes';\nimport { isDev } from '@/lib/core/config/env-helper';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Context information for generating error messages\n */\nexport interface ErrorMessageContext {\n  /** What the user was trying to do (e.g., \"save your changes\") */\n  userAction?: string;\n  /** Resource being accessed (e.g., \"dashboard\", \"user profile\") */\n  resource?: string;\n  /** Feature name (e.g., \"Reports\", \"Settings\") */\n  feature?: string;\n  /** Additional context metadata */\n  metadata?: Record<string, unknown>;\n}\n\n/**\n * Structured error message for UI rendering\n */\nexport interface StructuredErrorMessage {\n  /** Main error title for display */\n  title: string;\n  /** Detailed description explaining what went wrong */\n  description: string;\n  /** Suggested user actions to recover */\n  suggestions: string[];\n  /** Technical details (development only) */\n  technicalDetails?: string;\n  /** Whether the error is recoverable */\n  recoverable: boolean;\n  /** Suggested wait time before retry (ms) */\n  retryAfter?: number;\n}\n\n/**\n * Toast notification message\n */\nexport interface ToastMessage {\n  /** Short message for toast display */\n  message: string;\n  /** Toast type for styling */\n  type: 'info' | 'warning' | 'error' | 'success';\n  /** Auto-dismiss duration in ms (undefined = manual dismiss) */\n  duration?: number;\n}\n\n// ============================================================================\n// Message Templates\n// ============================================================================\n\ninterface MessageTemplate {\n  title: string;\n  description: (ctx?: ErrorMessageContext) => string;\n  suggestions: (ctx?: ErrorMessageContext) => string[];\n  recoverable: boolean;\n  retryAfter?: number;\n}\n\nconst MESSAGE_TEMPLATES: Record<ErrorCategory, MessageTemplate> = {\n  network: {\n    title: 'Connection Issue',\n    description: (ctx) =>\n      ctx?.userAction !== undefined && ctx?.userAction !== null && ctx?.userAction !== ''\n        ? `We couldn't ${ctx.userAction} because of a network issue.`\n        : 'Unable to connect to our servers.',\n    suggestions: () => [\n      'Check your internet connection',\n      'Try again in a few moments',\n      'If the problem persists, try refreshing the page',\n    ],\n    recoverable: true,\n    retryAfter: 3000,\n  },\n\n  authentication: {\n    title: 'Session Expired',\n    description: () => 'Your session has expired for security reasons.',\n    suggestions: () => ['Log in again to continue', 'Your work may have been saved automatically'],\n    recoverable: true,\n  },\n\n  authorization: {\n    title: 'Access Denied',\n    description: (ctx) =>\n      ctx?.resource !== undefined && ctx?.resource !== null && ctx?.resource !== ''\n        ? `You don't have permission to access ${ctx.resource}.`\n        : \"You don't have permission to perform this action.\",\n    suggestions: () => [\n      'Contact your administrator for access',\n      \"Verify you're logged into the correct account\",\n    ],\n    recoverable: false,\n  },\n\n  validation: {\n    title: 'Invalid Input',\n    description: () => 'Please check your input and try again.',\n    suggestions: () => [\n      'Review the highlighted fields',\n      'Ensure all required fields are filled',\n      'Check for formatting issues',\n    ],\n    recoverable: true,\n  },\n\n  server: {\n    title: 'Server Error',\n    description: (ctx) =>\n      ctx?.feature != null && ctx.feature.length > 0\n        ? `We're having trouble with ${ctx.feature} right now.`\n        : 'Something went wrong on our end.',\n    suggestions: () => [\n      'Try again in a few moments',\n      'Our team has been notified',\n      'Check our status page for updates',\n    ],\n    recoverable: true,\n    retryAfter: 5000,\n  },\n\n  client: {\n    title: 'Application Error',\n    description: () => 'Something unexpected happened in the application.',\n    suggestions: () => [\n      'Refresh the page',\n      'Clear your browser cache',\n      'Try using a different browser',\n    ],\n    recoverable: true,\n  },\n\n  timeout: {\n    title: 'Request Timed Out',\n    description: (ctx) =>\n      ctx?.userAction != null && ctx.userAction.length > 0\n        ? `The request to ${ctx.userAction} took too long.`\n        : 'The request took longer than expected.',\n    suggestions: () => [\n      'Check your internet connection',\n      'Try again - the server might be busy',\n      'Consider trying later if the problem persists',\n    ],\n    recoverable: true,\n    retryAfter: 2000,\n  },\n\n  rate_limit: {\n    title: 'Slow Down',\n    description: () => \"You're making requests too quickly.\",\n    suggestions: () => ['Wait a moment before trying again', 'Avoid rapid clicking or refreshing'],\n    recoverable: true,\n    retryAfter: 30000,\n  },\n\n  unknown: {\n    title: 'Unexpected Error',\n    description: () => 'An unexpected error occurred.',\n    suggestions: () => [\n      'Try again',\n      'Refresh the page if the problem continues',\n      'Contact support if this keeps happening',\n    ],\n    recoverable: true,\n    retryAfter: 1000,\n  },\n};\n\n// ============================================================================\n// Main Functions\n// ============================================================================\n\n/**\n * Generate a structured error message based on error and context\n *\n * @param error - The normalized application error\n * @param context - Optional context about what the user was doing\n * @returns Structured error message for UI rendering\n *\n * @example\n * ```tsx\n * const message = getStructuredErrorMessage(error, {\n *   userAction: 'save your document',\n *   feature: 'Documents'\n * });\n *\n * return (\n *   <ErrorDialog\n *     title={message.title}\n *     description={message.description}\n *     actions={message.suggestions}\n *     recoverable={message.recoverable}\n *   />\n * );\n * ```\n */\nexport function getStructuredErrorMessage(\n  error: AppError,\n  context?: ErrorMessageContext\n): StructuredErrorMessage {\n  const template = MESSAGE_TEMPLATES[error.category];\n\n  const result: StructuredErrorMessage = {\n    title: template.title,\n    description: template.description(context),\n    suggestions: template.suggestions(context),\n    recoverable: template.recoverable,\n  };\n\n  if (isDev() && error.stack != null && error.stack.length > 0) {\n    result.technicalDetails = error.stack;\n  }\n\n  if (template.retryAfter !== undefined) {\n    result.retryAfter = template.retryAfter;\n  }\n\n  return result;\n}\n\n/**\n * Get a short toast message for the error\n *\n * @param error - The normalized application error\n * @param context - Optional context\n * @returns String suitable for toast notification\n */\nexport function getToastMessage(error: AppError, context?: ErrorMessageContext): string {\n  const template = MESSAGE_TEMPLATES[error.category];\n  return template.description(context);\n}\n\n/**\n * Get a structured toast notification\n *\n * @param error - The normalized application error\n * @param context - Optional context\n * @returns Toast message with type and duration\n */\nexport function getToastNotification(error: AppError, context?: ErrorMessageContext): ToastMessage {\n  const template = MESSAGE_TEMPLATES[error.category];\n  const message = template.description(context);\n\n  // Determine toast type based on severity and recoverability\n  let type: ToastMessage['type'] = 'error';\n  if (error.severity === 'low') {\n    type = 'warning';\n  }\n\n  // Auto-dismiss only for recoverable errors with retry suggestions\n  const duration = template.recoverable && template.retryAfter != null ? 5000 : undefined;\n\n  const result: ToastMessage = {\n    message,\n    type,\n  };\n\n  if (duration !== undefined) {\n    result.duration = duration;\n  }\n\n  return result;\n}\n\n/**\n * Get a recovery hint for the error\n *\n * @param error - The normalized application error\n * @returns Recovery hint string or null if not recoverable\n */\nexport function getRecoveryHint(error: AppError): string | null {\n  const template = MESSAGE_TEMPLATES[error.category];\n\n  if (!template.recoverable) {\n    return null;\n  }\n\n  if (template.retryAfter != null && template.retryAfter !== 0) {\n    const seconds = Math.ceil(template.retryAfter / 1000);\n    return `Try again in ${seconds} second${seconds > 1 ? 's' : ''}`;\n  }\n\n  return template.suggestions()[0] ?? 'Try again';\n}\n\n/**\n * Convert HTTP status code to user-friendly message\n *\n * @param status - HTTP status code\n * @returns User-friendly message describing the status\n */\nexport function httpStatusToMessage(status: number): string {\n  const messages: Record<number, string> = {\n    400: 'The request was invalid. Please check your input.',\n    401: 'Please log in to continue.',\n    403: \"You don't have permission to do this.\",\n    404: 'The requested resource was not found.',\n    408: 'The request timed out. Please try again.',\n    409: 'There was a conflict. Someone may have made changes.',\n    413: 'The file is too large.',\n    422: \"Please check your input - something doesn't look right.\",\n    429: 'Too many requests. Please slow down.',\n    500: \"Something went wrong on our end. We're looking into it.\",\n    502: \"We're having trouble connecting. Please try again.\",\n    503: 'The service is temporarily unavailable.',\n    504: 'The request timed out. Please try again.',\n  };\n\n  return messages[status] ?? `An error occurred (${status}).`;\n}\n\n/**\n * Create a contextual error message with action and resource\n *\n * @param error - The normalized application error\n * @param action - Action being performed (e.g., \"load\", \"save\", \"delete\")\n * @param resource - Resource being acted upon (optional)\n * @returns Contextual message string\n *\n * @example\n * ```tsx\n * const message = createContextualMessage(error, 'save', 'document');\n * // => \"Unable to connect while saving document. Check your internet connection.\"\n * ```\n */\nexport function createContextualMessage(\n  error: AppError,\n  action: string,\n  resource?: string\n): string {\n  const actionVerbs: Record<string, string> = {\n    load: 'loading',\n    save: 'saving',\n    create: 'creating',\n    update: 'updating',\n    delete: 'deleting',\n    fetch: 'fetching',\n    submit: 'submitting',\n    upload: 'uploading',\n    download: 'downloading',\n    search: 'searching',\n    sync: 'syncing',\n    export: 'exporting',\n    import: 'importing',\n  };\n\n  const verb = actionVerbs[action.toLowerCase()] ?? action;\n  const resourceStr = resource != null && resource !== '' ? ` ${resource}` : '';\n\n  switch (error.category) {\n    case 'network':\n      return `Unable to connect while ${verb}${resourceStr}. Check your internet connection.`;\n    case 'timeout':\n      return `${verb.charAt(0).toUpperCase() + verb.slice(1)}${resourceStr} took too long. Please try again.`;\n    case 'server':\n      return `Server error while ${verb}${resourceStr}. We're looking into it.`;\n    case 'validation':\n      return `Please check your input and try ${verb}${resourceStr} again.`;\n    case 'authorization':\n      return `You don't have permission to ${action}${resourceStr}.`;\n    case 'authentication':\n      return `Please log in to ${action}${resourceStr}.`;\n    case 'rate_limit':\n      return `Too many requests. Please wait before ${verb}${resourceStr} again.`;\n    default:\n      return `Something went wrong while ${verb}${resourceStr}.`;\n  }\n}\n\n/**\n * Get the appropriate action text for error recovery buttons\n *\n * @param error - The normalized application error\n * @returns Object with primary and secondary action labels\n */\nexport function getRecoveryActions(error: AppError): {\n  primaryAction: string;\n  primaryLabel: string;\n  secondaryAction?: string;\n  secondaryLabel?: string;\n} {\n  switch (error.category) {\n    case 'network':\n    case 'timeout':\n    case 'server':\n      return {\n        primaryAction: 'retry',\n        primaryLabel: 'Try Again',\n        secondaryAction: 'dismiss',\n        secondaryLabel: 'Dismiss',\n      };\n\n    case 'authentication':\n      return {\n        primaryAction: 'login',\n        primaryLabel: 'Log In',\n        secondaryAction: 'dismiss',\n        secondaryLabel: 'Later',\n      };\n\n    case 'authorization':\n      return {\n        primaryAction: 'goBack',\n        primaryLabel: 'Go Back',\n        secondaryAction: 'contact',\n        secondaryLabel: 'Request Access',\n      };\n\n    case 'validation':\n      return {\n        primaryAction: 'fix',\n        primaryLabel: 'Fix Issues',\n      };\n\n    case 'rate_limit':\n      return {\n        primaryAction: 'wait',\n        primaryLabel: 'Wait & Retry',\n      };\n\n    default:\n      return {\n        primaryAction: 'retry',\n        primaryLabel: 'Try Again',\n        secondaryAction: 'reload',\n        secondaryLabel: 'Reload Page',\n      };\n  }\n}\n\n/**\n * Format an error for logging (includes technical details)\n *\n * @param error - The normalized application error\n * @param context - Optional context\n * @returns Formatted string for logging\n */\nexport function formatErrorForLogging(error: AppError, context?: ErrorMessageContext): string {\n  const parts: string[] = [\n    `[${error.category.toUpperCase()}] ${error.message}`,\n    `ID: ${error.id}`,\n    `Severity: ${error.severity}`,\n    `Timestamp: ${error.timestamp}`,\n  ];\n\n  if (context?.userAction != null && context.userAction !== '') {\n    parts.push(`User Action: ${context.userAction}`);\n  }\n\n  if (context?.feature != null && context.feature !== '') {\n    parts.push(`Feature: ${context.feature}`);\n  }\n\n  if (context?.resource != null && context.resource !== '') {\n    parts.push(`Resource: ${context.resource}`);\n  }\n\n  if (error.code != null && error.code !== '') {\n    parts.push(`Code: ${error.code}`);\n  }\n\n  if (error.stack != null && error.stack !== '') {\n    parts.push(`\\nStack:\\n${error.stack}`);\n  }\n\n  return parts.join('\\n');\n}\n\n/**\n * Check if an error message should be shown to the user\n *\n * Some errors (like cancelled requests or background sync errors)\n * should be handled silently.\n *\n * @param error - The normalized application error\n * @returns Whether to display the error to the user\n */\nexport function shouldShowError(error: AppError): boolean {\n  // Don't show cancelled/aborted errors\n  if (error.message.toLowerCase().includes('abort')) {\n    return false;\n  }\n\n  if (error.message.toLowerCase().includes('cancel')) {\n    return false;\n  }\n\n  // Don't show low severity errors in production\n  return !(!isDev() && error.severity === 'low');\n}\n"],"names":["MESSAGE_TEMPLATES","ctx","getStructuredErrorMessage","error","context","template","result","isDev","getToastMessage","getToastNotification","message","type","duration","getRecoveryHint","seconds","httpStatusToMessage","status","createContextualMessage","action","resource","verb","resourceStr","getRecoveryActions","formatErrorForLogging","parts","shouldShowError"],"mappings":";AA0EA,MAAMA,IAA4D;AAAA,EAChE,SAAS;AAAA,IACP,OAAO;AAAA,IACP,aAAa,CAACC,MACZA,GAAK,eAAe,UAAaA,GAAK,eAAe,QAAQA,GAAK,eAAe,KAC7E,eAAeA,EAAI,UAAU,iCAC7B;AAAA,IACN,aAAa,MAAM;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF,aAAa;AAAA,IACb,YAAY;AAAA,EAAA;AAAA,EAGd,gBAAgB;AAAA,IACd,OAAO;AAAA,IACP,aAAa,MAAM;AAAA,IACnB,aAAa,MAAM,CAAC,4BAA4B,6CAA6C;AAAA,IAC7F,aAAa;AAAA,EAAA;AAAA,EAGf,eAAe;AAAA,IACb,OAAO;AAAA,IACP,aAAa,CAACA,MACZA,GAAK,aAAa,UAAaA,GAAK,aAAa,QAAQA,GAAK,aAAa,KACvE,uCAAuCA,EAAI,QAAQ,MACnD;AAAA,IACN,aAAa,MAAM;AAAA,MACjB;AAAA,MACA;AAAA,IAAA;AAAA,IAEF,aAAa;AAAA,EAAA;AAAA,EAGf,YAAY;AAAA,IACV,OAAO;AAAA,IACP,aAAa,MAAM;AAAA,IACnB,aAAa,MAAM;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF,aAAa;AAAA,EAAA;AAAA,EAGf,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,aAAa,CAACA,MACZA,GAAK,WAAW,QAAQA,EAAI,QAAQ,SAAS,IACzC,6BAA6BA,EAAI,OAAO,gBACxC;AAAA,IACN,aAAa,MAAM;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAEF,aAAa;AAAA,IACb,YAAY;AAAA,EAAA;AAAA,EAGd,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,aAAa,MAAM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