import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { LandingComponent } from './landing/landing.component';
import { LoginComponent } from './login/login.component';
import { RegistrationComponent } from './registration/registration.component';
import { HeaderComponent } from './header/header.component';
import { RgntDomainComponent } from './rgnt-domain/rgnt-domain.component';
import { DomainApplicationComponent } from './domain-application/domain-application.component';
import { DomainDetailsComponent } from './domain-details/domain-details.component';
import { DomainApplicationDetailsComponent } from './domain-application-details/domain-application-details.component';
import { UserDomainDetailsComponent } from './user-domain-details/user-domain-details.component';
import { OnboardingStepperComponent } from './onboarding-stepper/onboarding-stepper.component';
import { UserSideMenuComponent } from './user-side-menu/user-side-menu.component';
import { DomainInvoicesComponent } from './domain-invoices/domain-invoices.component';
import { DomainInvoiceDetailsComponent } from './domain-invoice-details/domain-invoice-details.component';
import { OrganisationDetailsComponent } from './organisation-details/organisation-details.component';
import { ContactDetailsFormComponent } from './contact-details-form/contact-details-form.component';
import { MainHeaderComponent } from './main-header/main-header.component';
import { AddDomainComponent } from './add-domain/add-domain.component';
import { PreviewComponent } from './preview/preview.component';
import { NameServerComponent } from './name-server/name-server.component';
import { DomainDetailsEditComponent } from './domain-details-edit/domain-details-edit.component';
import { RolesComponent } from './roles/roles.component';

import { VerifyDocumentsComponent } from './verify-documents/verify-documents.component';
import { RegistrationSuccessComponent } from './registration-success/registration-success.component';
import { ForgotPasswordResetComponent } from './forgot-password-reset/forgot-password-reset.component';
import { ForgotPasswordEmailVerificationComponent } from './forgot-password-email-verification/forgot-password-email-verification.component';
import { ForgotPasswordOtpValidationComponent } from './forgot-password-otp-validation/forgot-password-otp-validation.component';
import { ForgotPasswordSuccessComponent } from './forgot-password-success/forgot-password-success.component';
import { ChangePasswordComponent } from './change-password/change-password.component';
import { RegistrarsDashboardComponent } from './registrars-dashboard/registrars-dashboard.component';
import { RgntOfficerDetailsMgmtComponent } from './rgnt-officer-details-mgmt/rgnt-officer-details-mgmt.component';
import { RgntUserManagementComponent } from './rgnt-user-management/rgnt-usr-mgmt.component';
import { RgtrRgntUserMgmtComponent } from './user/rgtr-rgnt-usr-mgmt.component';
import { RgtrUsrMgmtComponent } from './rgtr-usr-mgmt/rgtr-usr-mgmt.component';
import { RgtrDomainComponent } from './rgtr-domain/rgtr-domain.component';
import { DscVerificationComponent } from './dsc-verification/dsc-verification.component';
import { RgntDomainApplicationDetailsComponent } from './rgnt-domain-application-details/rgnt-domain-application-details.component';
import { RgtrLoginComponent } from './rgtr-login/rgtr-login.component';
import { RgtrOtpVerificationComponent } from './rgtr-otp-verification/rgtr-otp-verification.component';
import { RgntOtpVerificationComponent } from './rgnt-otp-verification/rgnt-otp-verification.component';
import { otpGuard } from './otp.guard';
import { RgtrRoleComponent } from './rgtr-role/rgtr-role.component';
import { RgtrDepartmentComponent } from './rgtr-department/rgtr-department.component';
import { InvoiceGenerationComponent } from './invoice-generation/invoice-generation.component';
import { RgtrForgotPasswordResetComponent } from './rgtr-forgot-password-reset/rgtr-forgot-password-reset.component';
import { RgtrForgotPasswordEmailVerificationComponent } from './rgtr-forgot-password-email-verification/rgtr-forgot-password-email-verification.component';
import { RgtrForgotPasswordOtpValidationComponent } from './rgtr-forgot-password-otp-validation/rgtr-forgot-password-otp-validation.component';
import { RgtrForgotPasswordSuccessComponent } from './rgtr-forgot-password-success/rgtr-forgot-password-success.component';
import { SessionTimeoutComponent } from './session-timeout/session-timeout.component';
import { RgtrRgntOfficerDetailsComponent } from './rgtr-rgnt-officer-details/rgtr-rgnt-officer-details.component';
import { PrerequisitesComponent } from './prerequisites/prerequisites.component';
import { AuthenticationErrorComponent } from './authentication-error/authentication-error.component';
import { RgntDashboardComponent } from './rgnt-dashboard/rgnt-dashboard.component';
import { DocumentPreviewComponent } from './document-preview/document-preview.component';
import { ApplicationSubmissionComponent } from './application-submission/application-submission.component';
import { PaymentSubmissionComponent } from './payment-submission/payment-submission.component';
import { FooterPageComponent } from './footer-page/footer-page.component';
import { PaymentResponseComponent } from './payment-response/payment-response.component';

import { MainLandingPageComponent } from './main-landing-page/main-landing-page.component';
import { RegistrationGuideComponent } from './registration-guide/registration-guide.component';

import { DscDetailsComponent } from './dsc-details/dsc-details.component';
import { RgtrReportsComponent } from './rgtr-reports/rgtr-reports.component';
import { DomainApplicationPaymentMetricsComponent } from './domain-application-payment-metrics/domain-application-payment-metrics.component';
import { RgntSuperAdminMgmtComponent } from './rgnt-super-admin-mgmt/rgnt-super-admin-mgmt.component';
import { OrphanDataComponent } from './orphan-data/orphan-data.component';

import { registerGuard } from './register.guard';
import { PaymentTimeoutComponent } from './payment-timeout/payment-timeout.component';
import { EppResponseDataComponent } from './epp-response-data/epp-response-data.component';
import { RestoreUserComponent } from './restore-user/restore-user.component';
import { OrphanUsersDataComponent } from './orphan-users-data/orphan-users-data.component';
import { EntityApprovalComponent } from './entity-approval/entity-approval.component';
import { EntityApplicationDetailsComponent } from './entity-application-details/entity-application-details.component';
import { RgntEntityDetailsComponent } from './rgnt-entity-details/rgnt-entity-details.component';
import { RgtrRequestReportsComponent } from './rgtr-request-reports/rgtr-request-reports.component';
import { RgtrModifyRequestReportsComponent } from './rgtr-modify-request-reports/rgtr-modify-request-reports.component';
import { RgtrDscVerificationComponent } from './rgtr-dsc-verification/rgtr-dsc-verification.component';
import { RgntManageRenewalComponent } from './rgnt-manage-renewal/rgnt-manage-renewal.component';
import { SideMenuComponent } from './side-menu/side-menu.component';
import { RgtrRenewalRequestComponent } from './rgtr-renewal-request/rgtr-renewal-request.component';
import { SuperAdminDetailsComponent } from './super-admin-details/super-admin-details.component';
// import { RgtrReportsComponent } from './rgtr-reports/rgtr-reports.component';

const routes: Routes = [
  {path:'home', component: HomeComponent},
  {path:'organisation-details', component: OrganisationDetailsComponent},
  {path:'contact-details-form', component: ContactDetailsFormComponent},
  // {path:'landing', component: LandingComponent},
  {path:'login', component: LoginComponent},
  {path:'registration', component: RegistrationComponent,canActivate:[registerGuard]},
  {path:'header', component: HeaderComponent},
  {path:'applications', component: DomainApplicationComponent},
  {path:'domain-details', component: DomainDetailsComponent},
  {path: 'domain-application-details', component: DomainApplicationDetailsComponent},
  // {path: '',redirectTo:'/login', pathMatch: 'full'},
  {path:'DomainEditPage',component:DomainDetailsEditComponent},
  {path: 'user-domain-details', component:UserDomainDetailsComponent},
  {path: 'onboarding-stepper', component:OnboardingStepperComponent},
  {path: 'user-side-menu', component:UserSideMenuComponent},
  {path:'invoices', component: DomainInvoicesComponent},

  {path:'admin-invoice-details',component:DomainInvoiceDetailsComponent},
  {path:'',redirectTo:'/register', pathMatch: 'full'},
  // {path:'',component: LandingComponent},
  {path:'mainHeader',component:MainHeaderComponent},
  //{path:'domain-invoices',component:DomainInvoicesComponent},
  //{path:'full-header',component:FullHeaderComponent}
  {path: 'invoice-details', component: DomainInvoiceDetailsComponent},
  {path: 'add-domain', component: AddDomainComponent},
  {path: 'preview', component: PreviewComponent},
  {path: 'name-server', component: NameServerComponent},
  {path: 'verify-documents', component: VerifyDocumentsComponent},
  {path: 'reg-success', component: RegistrationSuccessComponent},
  {path:'f-p-r', component:ForgotPasswordResetComponent},
  {path:'rfg', component:ForgotPasswordEmailVerificationComponent},
  {path:'f-p-o-v', component:ForgotPasswordOtpValidationComponent},
  {path:'r-f-p-r', component:RgtrForgotPasswordResetComponent},
  {path:'r-f-p-e-v', component:RgtrForgotPasswordEmailVerificationComponent},
  {path:'r-f-p-o-v', component:RgtrForgotPasswordOtpValidationComponent},
  {path:'forgot-password-success', component:ForgotPasswordSuccessComponent},
  {path:'r-f-p-s', component:RgtrForgotPasswordSuccessComponent},
  {path:'change-password',component:ChangePasswordComponent},
  {path:'entity-approval',component:EntityApprovalComponent},
  {path:'entity-application-details',component:EntityApplicationDetailsComponent},
  {path:'rgnt-entity-app-details',component:RgntEntityDetailsComponent},
  // settings menu paths
  {path: 'rgnt-ofd', component: RgntOfficerDetailsMgmtComponent},
  {path: 'rgtr-rgnt-ofd', component: RgtrRgntOfficerDetailsComponent},
  {path:'rgtr-login',component:RgtrLoginComponent},
  {path:'pmnt-sbms', component: PaymentSubmissionComponent},
  {path:'payment-status', component: PaymentTimeoutComponent},
  {
    path: 'rgtr-o-V',
    component: RgtrOtpVerificationComponent,
    canActivate: [otpGuard],
    data: { fallbackRoute: '/rgtr-login' } 
  },
  {
    path: 'rgnt-o-V',
    component: RgntOtpVerificationComponent,
    canActivate: [otpGuard],
    data: { fallbackRoute: '/login' } 
  },
  {path:'rgnt-um', component: RgntUserManagementComponent},
  {path:'rgtr-dpt',component:RgtrDepartmentComponent},
  {path: 'rgtr-rgnt-um', component: RgtrRgntUserMgmtComponent},
  {path: 'rgtr-um', component: RgtrUsrMgmtComponent},
  {path: 'rgnt-role', component:RolesComponent},
  {path: 'rgtr-role', component:RgtrRoleComponent},
  {path:'rgnt-domains', component: RgntDomainComponent},
  {path:'rgtr-domains', component: RgtrDomainComponent},
  {path: 'dsc-verification', component: DscVerificationComponent},
  {path: 'rgtr-dashboard', component: RegistrarsDashboardComponent},
  {path: 'rngt-app-details', component: RgntDomainApplicationDetailsComponent},
  {path :'invoice',component :InvoiceGenerationComponent},
  {path :'session-timeout', component:SessionTimeoutComponent},
 {path: 'lazy', loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule) },
 {path: 'prerequisites', component: PrerequisitesComponent},
 {path: 'authentication-error', component: AuthenticationErrorComponent},
 {path: 'rgnt-dshd',component:RgntDashboardComponent},
 {path: 'dcmnt-pvw', component:DocumentPreviewComponent},
 {path:'app-sbms',component: ApplicationSubmissionComponent},
 {path:'app-footer',component:FooterPageComponent},
 {path: 'payment-response', component: PaymentResponseComponent},

 {path:'register', component:MainLandingPageComponent},
 {path:'rg', component:RegistrationGuideComponent},

 {path :'dsc-guide', component:DscDetailsComponent},
 {path :'rg-rpt', component:RgtrReportsComponent},
 {path :'dmn-metrics', component:DomainApplicationPaymentMetricsComponent},
 {path: 'rgnt-spadm', component: RgntSuperAdminMgmtComponent},
 {path: 'rgtr-orphan',component : OrphanDataComponent},
  {path:'esd', component: EppResponseDataComponent},
 {path:'ru', component: RestoreUserComponent},
 {path:'or-u', component:OrphanUsersDataComponent},
 {path:'req-apv', component:RgtrRequestReportsComponent},
 {path:'mod-req', component:RgtrModifyRequestReportsComponent},
 {path:'rgtr-dsc-verification', component:RgtrDscVerificationComponent},
 {path:'manage-renewal', component:RgntManageRenewalComponent},
 {path:'renewal-req', component:RgtrRenewalRequestComponent},
 {path:'su-ad-details', component:SuperAdminDetailsComponent},
 

];

@NgModule({
  imports: [RouterModule.forRoot(routes,{useHash :true})],
  exports: [RouterModule]
})
export class AppRoutingModule { }