import { ContextInvalidated, createShadowDOM, onContextInvalidated } from 'chrome-extension-toolkit';
import React from 'react';
import CourseCatalogMain from './components/CourseCatalogMain';
import PopupMain from './components/PopupMain';
import getSiteSupport, { SiteSupport } from './lib/getSiteSupport';
import render from './lib/react';
const support = getSiteSupport(window.location.href);
console.log('support:', support);
if (!support) {
throw new Error('UT Registration Plus does not support this page, even though it should...');
}
// if we are in an iframe, throw an error
if (window.self !== window.top) {
throw new Error('inside an iframe');
}
if (support === SiteSupport.EXTENSION_POPUP) {
render(