import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";

// Get store from router/index.js instead of importing it here to get updated values
const routingTable = function (store) {
    return [
        {
            fmgPageValue: fmgPageValues.VEHICLE,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_FORWARD,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
                },
            ],
        },

        {
            fmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.VEHICLE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_VIN,
                    destinationFmgPageValue: fmgPageValues.VIN_LOOKUP,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN,
                    destinationFmgPageValue: fmgPageValues.ESTIMATE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_SKIP_VIN,
                    destinationFmgPageValue: fmgPageValues.SERVICE_ZIP,
                },
                {
                    scenario:
                        navigationScenarios.CLICKED_FORWARD_WITH_REPAIR_AND_VERIFIED_INSURANCE,
                    destinationFmgPageValue: fmgPageValues.SERVICE_ZIP,
                },
                {
                    scenario:
                        navigationScenarios.CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE,
                    destinationFmgPageValue: fmgPageValues.VIN_LOOKUP,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.VIN_LOOKUP,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.ESTIMATE,
                },
                {
                    scenario: navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_VIN,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
                {
                    scenario: navigationScenarios.CLICKED_VIN_RETRY,
                    destinationFmgPageValue: fmgPageValues.ESTIMATE,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.LICENSE_PLATE_LOOKUP,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.ESTIMATE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
                {
                    scenario: navigationScenarios.CLICKED_VIN_RETRY,
                    destinationFmgPageValue: fmgPageValues.ESTIMATE,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.ADDRESS_LOOKUP,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.ESTIMATE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_VEHICLES,
                    destinationFmgPageValue: fmgPageValues.ADDRESS_VEHICLES,
                },
                {
                    scenario: navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
                {
                    scenario: navigationScenarios.CLICKED_VIN_RETRY,
                    destinationFmgPageValue: fmgPageValues.ESTIMATE,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.ADDRESS_VEHICLES,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.ADDRESS_LOOKUP,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
                {
                    scenario: navigationScenarios.CLICKED_VIN_RETRY,
                    destinationFmgPageValue: fmgPageValues.ESTIMATE,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.ESTIMATE,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
                },
                {
                    scenario: navigationScenarios.SELECTED_MANUAL_VIN,
                    destinationFmgPageValue: fmgPageValues.VIN_LOOKUP,
                },
                {
                    scenario: navigationScenarios.SELECTED_LICENSE_PLATE,
                    destinationFmgPageValue: fmgPageValues.LICENSE_PLATE_LOOKUP,
                },
                {
                    scenario: navigationScenarios.SELECTED_HOME_ADDRESS,
                    destinationFmgPageValue: fmgPageValues.ADDRESS_LOOKUP,
                },
                {
                    scenario: navigationScenarios.SELECTED_NO_VIN,
                    destinationFmgPageValue: fmgPageValues.SERVICE_ZIP,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.SERVICE_ZIP,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.ESTIMATE,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_SKIP_VIN,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.PART_QUESTIONS,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.VIN_LOOKUP,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.SERVICE_ZIP,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.VEHICLE_PARTS,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_PART_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.VIN_LOOKUP,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.SERVICE_ZIP,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.VIN_LOOKUP,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.SERVICE_ZIP,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_PART_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_MULTIPLE_PARTS_TO_CHOOSE,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.VIN_LOOKUP,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.SERVICE_ZIP,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_PART_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_MULTIPLE_PARTS_TO_CHOOSE,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_MOLDING_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.QUOTE,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.VIN_LOOKUP,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.SERVICE_ZIP,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_PART_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_MULTIPLE_PARTS_TO_CHOOSE,
                    destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_MOLDING_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_BACK_WITH_CAPABILITY_QUESTIONS,
                    destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_CASH,
                    destinationFmgPageValue: fmgPageValues.SERVICE_LOCATION,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD_WITH_INSURANCE,
                    destinationFmgPageValue: fmgPageValues.INSURANCE_COMPANY,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.INSURANCE_COMPANY,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD,
                    destinationFmgPageValue: fmgPageValues.INSURANCE_DETAILS,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.SERVICE_LOCATION,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.QUOTE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD,
                    destinationFmgPageValue: fmgPageValues.SCHEDULE,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.SCHEDULE,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.SERVICE_LOCATION,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD,
                    destinationFmgPageValue: fmgPageValues.CUSTOMER_DETAILS,
                },
                {
                    scenario: navigationScenarios.CLICKED_CHANGE_LOCATION,
                    destinationFmgPageValue: fmgPageValues.SERVICE_LOCATION,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.CUSTOMER_DETAILS,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.SCHEDULE,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD,
                    destinationFmgPageValue: fmgPageValues.PAYMENT_METHOD,
                },
                {
                    scenario: navigationScenarios.CLICKED_PAY_NOW,
                    destinationFmgPageValue: fmgPageValues.PAYMENT_METHOD,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.PAYMENT_METHOD,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.CUSTOMER_DETAILS,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD,
                    destinationFmgPageValue: fmgPageValues.CONFIRMATION,
                },
                {
                    scenario: navigationScenarios.CLICKED_PAY_NOW,
                    destinationFmgPageValue: fmgPageValues.PAYMENT,
                },
                {
                    scenario: navigationScenarios.CLICKED_INSURANCE,
                    destinationFmgPageValue: fmgPageValues.INSURANCE_COMPANY,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.PAYMENT,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_BACK,
                    destinationFmgPageValue: fmgPageValues.PAYMENT_METHOD,
                },
                {
                    scenario: navigationScenarios.CLICKED_FORWARD,
                    destinationFmgPageValue: fmgPageValues.CONFIRMATION,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.PAYMENT_PIA_RETURN,
            maps: [
                {
                    scenario: navigationScenarios.PIA_ERROR,
                    destinationFmgPageValue: fmgPageValues.PAYMENT_METHOD,
                },
                {
                    scenario: navigationScenarios.PIA_CC_ERROR,
                    destinationFmgPageValue: fmgPageValues.PAYMENT,
                },
                {
                    scenario: navigationScenarios.PIA_SUCCESS,
                    destinationFmgPageValue: fmgPageValues.CONFIRMATION,
                },
            ],
        },
        {
            fmgPageValue: fmgPageValues.CONFIRMATION,
        },
        // The destination page for return user does not matter.  the router will invoke implicit navigation
        {
            fmgPageValue: fmgPageValues.RETURN_USER,
            maps: [
                {
                    scenario: navigationScenarios.CLICKED_FORWARD,
                    destinationFmgPageValue: fmgPageValues.VEHICLE,
                },
            ],
        },
    ];
};

export { routingTable };
