export { CLOUD_LABELS, CLOUD_COLORS, CLOUD_ICONS } from './cloud-constants';
export const CLOUD_DOMAIN_PATTERNS: Array<{regex:RegExp;type:string}> = [
  {regex:/pan\.baidu\.com/i,type:'baidu'},{regex:/pan\.quark\.cn/i,type:'quark'},
  {regex:/aliyundrive\.com|alipan\.com/i,type:'aliyun'},{regex:/115\.com|115cdn\.com/i,type:'115'},
  {regex:/cloud\.189\.cn/i,type:'tianyi'},{regex:/123pan\.com|123684\.com|123912\.com/i,type:'123pan'},
  {regex:/drive\.uc\.cn/i,type:'uc'},{regex:/pan\.xunlei\.com/i,type:'xunlei'},{regex:/magnet:/i,type:'magnet'}];
export function detectCloudType(url: string | undefined | null): string {
  if (!url) return 'others';
  for (const {regex,type} of CLOUD_DOMAIN_PATTERNS) if (regex.test(url)) return type;
  return 'others';
}
