import { enableProdMode } from "@angular/core"
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"
import { applyPolyfills, defineCustomElements } from '@duetds/components/lib/loader'

import { AppModule } from "./app/app.module"
import { environment } from "./environments/environment"

if (environment.production) {
  enableProdMode()
}

// Register Duet’s custom elements
applyPolyfills().then(() => {
  defineCustomElements(window)
})

platformBrowserDynamic()
  .bootstrapModule(AppModule)
  .catch(err => console.error(err))
