import { getURLSearchParams } from '@/tools';


const userAgent = navigator.userAgent;

export function platformIsAIO() {
  return /aio\/\w+/i.test(userAgent);
}

export function getSerialNumberSync() {
  const match = userAgent.match(/sn\/(\w+)/i);
  return match?.[ 1 ] ?? (
    function() {
      const query = getURLSearchParams();
      return query.get('serial') ?? query.get('serialNumber') ?? query.get('sn') ?? void 0;
    }
  )();
}

export * from './notify.ui';
export * from './toast.ui';
