/**
 * This is the navigator you will modify to display the logged-in screens of your app.
 * You can use RootNavigator to also display an auth flow or other user flows.
 *
 * You'll likely spend most of your time in this file.
 */
// @ts-nocheck
import React, { useEffect } from 'react';

import { createNativeStackNavigator } from '@react-navigation/native-stack';
import { OTP } from '../screens/otp';
import { NationalID } from '../screens/nationalID';
import { Selfie } from '../screens/selfie';
import { Camera } from '../screens/camera';
import { TermScreen } from '../screens/terms/TermScreen';
import { LiveNess } from '../screens/liveness';
import { ESign } from '../screens/eSign';
import { NationalIDBack } from '../screens/nationalIDBack';
import { Contract } from '../screens/contract';
import { Video } from '../screens/uploadVideo';
import { Qualify } from '../screens/qualify';
import { QuickSubmit } from '../screens/quick-submit';
import { CommonSelect } from '../components/select';
import { FullSubmit } from '../screens/full-submit';
import { Introduction } from '../screens/introduction';
import { CIMBSign } from '../screens/cimb-sign';
import { SchedulePayment } from '../screens/schedule-payment';
import { Notification } from '../screens/notification';
import { PaymentList } from '../screens/schedule-payment/payment-list';
import { CIMBxTima } from '../screens/home/CIMBxTima';
import { QuickTerm } from '../screens/terms/QuickTerm';
import { PaymentInfo } from '../screens/detail-loan/PaymentInfo';
import { CimbSelfie } from '../screens/full-submit/selfie';
import { PaymentEvidence } from '../screens/payment-evidence';
import { GuideTransferBank } from '../screens/guide-transfer-bank';
import TransferDetail from '../screens/guide-transfer-bank/TransferDetail';
import { ViewContract } from '../screens/sign-tima/ViewContract';
import { ConfirmContract } from '../screens/sign-tima/ConfirmContract';
import { PaymentAll } from '../screens/detail-loan/PaymentAll';
import { DetailLoan } from '../screens/detail-loan';
import Guideline from '../screens/payment-evidence/Guideline';
import { AcceptPolicy } from '../screens/full-submit/accept_policy';
import { DigitalLending } from '../screens/digital-lending';
import { DetailLoanTima } from '../screens/detail-loan/DetailLoanTima';
import MRZScanner from '../screens/mrz-scanner';
import { LivenessV2 } from '../screens/liveness-v2';
import PreviewContract from '../screens/eSign/PreviewContract';
import appStore from '../AppStore';
import { DigitalSchedulePayment } from '../screens/schedule-payment/DigitalSchedulePayment';
import { QrPayment } from '../screens/detail-loan/QrPayment';
import { ShowQrCode } from '../screens/detail-loan/ShowQrCode';
import { UpdateLoan } from '../screens/loan/UpdateLoan';
import { PreviewSchedulePaymentTopup } from '../screens/loan/PreviewSchedulePaymentTopup';
import { TTSNationalIDFront } from '../screens/toan-trinh-so/TTSNationalIDFront';
import VehicleRegistration from '../screens/toan-trinh-so/VehicleRegistration';
import VehicleRegistrationFront from '../screens/toan-trinh-so/VehicleRegistrationFront';
import VehicleCamera from '../screens/toan-trinh-so/VehicleCamera';
import VehicleRegistrationBack from '../screens/toan-trinh-so/VehicleRegistrationBack';
import RegisterCamera from '../screens/toan-trinh-so/RegisterCamera';
import { OCR } from '../screens/toan-trinh-so/OCR';
import ReviewInformation from '../screens/toan-trinh-so/ReviewInformation';
import ReviewLoan from '../screens/toan-trinh-so/ReviewLoan';
import MSelect from '../components/MSelect';
import ReviewInformationOther from '../screens/toan-trinh-so/ReviewInformationOther';
import TTSNationalIDBack from '../screens/toan-trinh-so/TTSNationalIDBack';
import TTSSelfie from '../screens/toan-trinh-so/TTSSelfie';
import LoanInterestRate from '../screens/toan-trinh-so/LoanInterestRate';
import TTSSignLoan from '../screens/toan-trinh-so/TTSSignLoan';
import TTSOTP from '../screens/toan-trinh-so/TTSOTP';
import RegisterBack from '../screens/toan-trinh-so/RegisterBack';
import CCCDCameraScreen from '../screens/camera/CCCDCameraScreen';
import { Home } from '../screens/home';
import TopupLoanInfo from '../screens/toan-trinh-so/TopupLoanInfo';
import { AssetInformation } from '../screens/v3/AssetInformation';
import MySignViettel from '../screens/mySignViettel';
import LoanBuyCar from '../screens/v3/LoanBuyCar';
import InfoLoanMotobike from '../screens/motobike/InfoLoanMotobike';
import ReviewLoanMotobike from '../screens/motobike/ReviewLoanMotobike';
import PolicyF88 from '../screens/motobike/PolicyF88';

export const ScreenNames = {
  Main: 'HomeTimaCare',
  Support: 'Support',
  Compare: 'Compare',
  NationalID: 'NationalID',
  Selfie: 'Selfie',
  RegisterMotor: 'RegisterMotor',
  Camera: 'Camera',
  Terms: 'Terms',
  LiveNess: 'LiveNess',
  ESign: 'ESign',
  NationalIDBack: 'NationalIDBack',
  Contract: 'Contract',
  Video: 'Video',
  Qualify: 'Qualify',
  TopUp: 'TopUp',
  QuickSubmit: 'QuickSubmit',
  Introduction: 'Introduction',
  FullSubmit: 'FullSubmit',
  CommonSelect: 'CommonSelect',
  UpdateLoan: 'UpdateLoan',
  CIMBSign: 'CIMBSign',
  SchedulePayment: 'SchedulePayment',
  Notification: 'Notification',
  PaymentList: 'PaymentList',
  CIMBxTima: 'CIMBxTima',
  QuickTerm: 'QuickTerm',
  DetailLoan: 'DetailLoan',
  PaymentInfo: 'PaymentInfo',
  CimbSelfie: 'CimbSelfie',
  PaymentEvidence: 'PaymentEvidence',
  GuideTransferBank: 'GuideTransferBank',
  TransferDetail: 'TransferDetail',
  PaymentAll: 'PaymentAll',
  ViewContract: 'ViewContract',
  ConfirmContract: 'ConfirmContract',
  Guideline: 'Guideline',
  AcceptPolicy: 'AcceptPolicy',
  DigitalLending: 'DigitalLending',
  DetailLoanTima: 'DetailLoanTima',
  MRZScanner: 'MRZScanner',
  LivenessV2: 'LivenessV2',
  PreviewContract: 'PreviewContract',
  DigitalSchedulePayment: 'DigitalSchedulePayment',
  QrPayment: 'QrPayment',
  ShowQrCode: 'ShowQrCode',
  UpdateLoan: 'UpdateLoan',
  PreviewSchedulePaymentTopup: 'PreviewSchedulePaymentTopup',
  TTSNationalIDFront: 'TTSNationalIDFront',
  VehicleRegistration: 'VehicleRegistration',
  VehicleRegistrationFront: 'VehicleRegistrationFront',
  VehicleRegistrationBack: 'VehicleRegistrationBack',
  VehicleCamera: 'VehicleCamera',
  RegisterCamera: 'RegisterCamera',
  OCR: 'OCR',
  ReviewInformation: 'ReviewInformation',
  ReviewLoan: 'ReviewLoan',
  MSelect: 'MSelect',
  ReviewInformationOther: 'ReviewInformationOther',
  TTSNationalIDBack: 'TTSNationalIDBack',
  TTSSelfie: 'TTSSelfie',
  LoanInterestRate: 'LoanInterestRate',
  TTSSignLoan: 'TTSSignLoan',
  TTSOTP: 'TTSOTP',
  RegisterBack: 'RegisterBack',
  CCCDCameraScreen: 'CCCDCameraScreen',
  TopupLoanInfo: 'TopupLoanInfo',
  AssetInformation: 'AssetInformation',
  MySignViettel: 'MySignViettel',
  LoanBuyCar: 'LoanBuyCar',
  InfoLoanMotobike: 'InfoLoanMotobike',
  ReviewLoanMotobike: 'ReviewLoanMotobike',
  PolicyF88: 'PolicyF88',
};

const Stack = createNativeStackNavigator();

export function PrimaryNavigator(props) {
  return (
    <Stack.Navigator
      initialRouteName={ScreenNames.Main}
      screenOptions={{
        headerShown: false,
      }}
    >
      <Stack.Screen name={ScreenNames.Main} component={Home} />
      <Stack.Screen name={ScreenNames.NationalID} component={NationalID} />
      <Stack.Screen name={ScreenNames.Selfie} component={Selfie} />
      <Stack.Screen name={ScreenNames.Camera} component={Camera} />
      <Stack.Screen name={ScreenNames.Terms} component={TermScreen} />
      <Stack.Screen name={ScreenNames.LiveNess} component={LiveNess} />
      <Stack.Screen name={ScreenNames.ESign} component={ESign} />
      <Stack.Screen
        name={ScreenNames.NationalIDBack}
        component={NationalIDBack}
      />
      <Stack.Screen name={ScreenNames.DetailLoan} component={DetailLoan} />
      <Stack.Screen name={ScreenNames.Contract} component={Contract} />
      <Stack.Screen name={ScreenNames.Video} component={Video} />
      <Stack.Screen name={ScreenNames.Qualify} component={Qualify} />
      <Stack.Screen name={ScreenNames.QuickSubmit} component={QuickSubmit} />
      <Stack.Screen name={ScreenNames.Introduction} component={Introduction} />
      <Stack.Screen name={ScreenNames.FullSubmit} component={FullSubmit} />
      <Stack.Screen name={ScreenNames.CommonSelect} component={CommonSelect} />
      <Stack.Screen name={ScreenNames.CIMBSign} component={CIMBSign} />
      <Stack.Screen
        name={ScreenNames.SchedulePayment}
        component={SchedulePayment}
      />
      <Stack.Screen name={ScreenNames.Notification} component={Notification} />
      <Stack.Screen name={ScreenNames.PaymentList} component={PaymentList} />
      <Stack.Screen name={ScreenNames.CIMBxTima} component={CIMBxTima} />
      <Stack.Screen name={ScreenNames.QuickTerm} component={QuickTerm} />
      <Stack.Screen name={ScreenNames.PaymentInfo} component={PaymentInfo} />
      <Stack.Screen name={ScreenNames.CimbSelfie} component={CimbSelfie} />
      <Stack.Screen
        name={ScreenNames.PaymentEvidence}
        component={PaymentEvidence}
      />
      <Stack.Screen
        name={ScreenNames.GuideTransferBank}
        component={GuideTransferBank}
      />
      <Stack.Screen
        name={ScreenNames.TransferDetail}
        component={TransferDetail}
      />
      <Stack.Screen name={ScreenNames.PaymentAll} component={PaymentAll} />
      <Stack.Screen name={ScreenNames.ViewContract} component={ViewContract} />
      <Stack.Screen
        name={ScreenNames.ConfirmContract}
        component={ConfirmContract}
      />
      <Stack.Screen name={ScreenNames.Guideline} component={Guideline} />
      <Stack.Screen name={ScreenNames.AcceptPolicy} component={AcceptPolicy} />
      <Stack.Screen
        name={ScreenNames.DigitalLending}
        component={DigitalLending}
      />
      <Stack.Screen
        name={ScreenNames.DetailLoanTima}
        component={DetailLoanTima}
      />
      <Stack.Screen name={ScreenNames.MRZScanner} component={MRZScanner} />
      <Stack.Screen name={ScreenNames.LivenessV2} component={LivenessV2} />
      <Stack.Screen
        name={ScreenNames.PreviewContract}
        component={PreviewContract}
      />
      <Stack.Screen
        name={ScreenNames.DigitalSchedulePayment}
        component={DigitalSchedulePayment}
      />
      <Stack.Screen name={ScreenNames.QrPayment} component={QrPayment} />
      <Stack.Screen name={ScreenNames.ShowQrCode} component={ShowQrCode} />
      <Stack.Screen name={ScreenNames.UpdateLoan} component={UpdateLoan} />
      <Stack.Screen
        name={ScreenNames.PreviewSchedulePaymentTopup}
        component={PreviewSchedulePaymentTopup}
      />
      <Stack.Screen
        name={ScreenNames.TTSNationalIDFront}
        component={TTSNationalIDFront}
      />
      <Stack.Screen
        name={ScreenNames.VehicleRegistration}
        component={VehicleRegistration}
      />
      <Stack.Screen
        name={ScreenNames.VehicleRegistrationFront}
        component={VehicleRegistrationFront}
      />
      <Stack.Screen
        name={ScreenNames.VehicleRegistrationBack}
        component={VehicleRegistrationBack}
      />
      <Stack.Screen
        name={ScreenNames.VehicleCamera}
        component={VehicleCamera}
      />
      <Stack.Screen
        name={ScreenNames.RegisterCamera}
        component={RegisterCamera}
      />
      <Stack.Screen name={ScreenNames.OCR} component={OCR} />
      <Stack.Screen
        name={ScreenNames.ReviewInformation}
        component={ReviewInformation}
      />
      <Stack.Screen name={ScreenNames.ReviewLoan} component={ReviewLoan} />
      <Stack.Screen name={ScreenNames.MSelect} component={MSelect} />
      <Stack.Screen
        name={ScreenNames.ReviewInformationOther}
        component={ReviewInformationOther}
      />
      <Stack.Screen
        name={ScreenNames.TTSNationalIDBack}
        component={TTSNationalIDBack}
      />
      <Stack.Screen name={ScreenNames.TTSSelfie} component={TTSSelfie} />
      <Stack.Screen
        name={ScreenNames.LoanInterestRate}
        component={LoanInterestRate}
      />
      <Stack.Screen name={ScreenNames.TTSSignLoan} component={TTSSignLoan} />
      <Stack.Screen name={ScreenNames.TTSOTP} component={TTSOTP} />
      <Stack.Screen name={ScreenNames.RegisterBack} component={RegisterBack} />
      <Stack.Screen
        name={ScreenNames.CCCDCameraScreen}
        component={CCCDCameraScreen}
      />
      <Stack.Screen
        name={ScreenNames.TopupLoanInfo}
        component={TopupLoanInfo}
      />
      <Stack.Screen
        name={ScreenNames.AssetInformation}
        component={AssetInformation}
      />
      <Stack.Screen name={ScreenNames.LoanBuyCar} component={LoanBuyCar} />
      <Stack.Screen
        name={ScreenNames.MySignViettel}
        component={MySignViettel}
      />
      <Stack.Screen
        name={ScreenNames.InfoLoanMotobike}
        component={InfoLoanMotobike}
      />
      <Stack.Screen
        name={ScreenNames.ReviewLoanMotobike}
        component={ReviewLoanMotobike}
      />
      <Stack.Screen name={ScreenNames.PolicyF88} component={PolicyF88} />
    </Stack.Navigator>
  );
}

const exitRoutes = ['welcome'];
export const canExit = (routeName: string) => exitRoutes.includes(routeName);
