const ProtectionLevel = {
  NONE: "none",
  // No protection - fully overrideable
  PROTECTED_METADATA: "protected_metadata",
  // Component overrideable, metadata protected
  PROTECTED_RENDER: "protected_render",
  // Metadata overrideable, component protected
  PROTECTED_ALL: "protected_all"
  // Nothing overrideable - full protection
};
const PROTECTED_PATHS = {
  // Root layout - Allow theme metadata (branding), protect render logic (auth/providers)
  "app/layout.tsx": ProtectionLevel.PROTECTED_RENDER,
  // Dashboard auth boundary - Complete protection for security
  "app/dashboard/layout.tsx": ProtectionLevel.PROTECTED_ALL
  // Future examples for different protection levels:
  // 'app/(admin)/layout.tsx': ProtectionLevel.PROTECTED_ALL,        // Admin layouts fully protected
  // 'app/(public)/layout.tsx': ProtectionLevel.PROTECTED_METADATA,  // Allow UI changes, keep branding
  // 'app/api/auth/': ProtectionLevel.PROTECTED_ALL,                 // API routes (directory pattern)
};
function getProtectionLevel(appPath) {
  if (appPath in PROTECTED_PATHS) {
    return PROTECTED_PATHS[appPath];
  }
  for (const [protectedPath, level] of Object.entries(PROTECTED_PATHS)) {
    if (protectedPath.endsWith("/") && appPath.startsWith(protectedPath)) {
      return level;
    }
  }
  return ProtectionLevel.NONE;
}
function isProtectedPath(appPath) {
  return getProtectionLevel(appPath) !== ProtectionLevel.NONE;
}
function canOverrideComponent(appPath) {
  const level = getProtectionLevel(appPath);
  return level === ProtectionLevel.NONE || level === ProtectionLevel.PROTECTED_METADATA;
}
function canOverrideMetadata(appPath) {
  const level = getProtectionLevel(appPath);
  return level === ProtectionLevel.NONE || level === ProtectionLevel.PROTECTED_RENDER;
}
function getProtectionDescription(appPath) {
  const level = getProtectionLevel(appPath);
  switch (level) {
    case ProtectionLevel.NONE:
      return "No protection - fully overrideable";
    case ProtectionLevel.PROTECTED_METADATA:
      return "Component overrideable, metadata protected";
    case ProtectionLevel.PROTECTED_RENDER:
      return "Metadata overrideable, component protected";
    case ProtectionLevel.PROTECTED_ALL:
      return "Fully protected - no overrides allowed";
    default:
      return "Unknown protection level";
  }
}
function getAllProtectedPaths() {
  return { ...PROTECTED_PATHS };
}
function getProtectedPathsList() {
  return Object.keys(PROTECTED_PATHS);
}
export {
  PROTECTED_PATHS,
  ProtectionLevel,
  canOverrideComponent,
  canOverrideMetadata,
  getAllProtectedPaths,
  getProtectedPathsList,
  getProtectionDescription,
  getProtectionLevel,
  isProtectedPath
};
