import "./styles.scss";
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import { Route, Routes } from "react-router-dom";
import Layout from "./Layouts";
import routes, { chatsPrefix } from "@/routes";
import Welcome from "@/components/ChatsPath/pages/Welcome";
import Quiz from "./Layouts/Quiz";
import PsychicReading from "@/components/ChatsPath/pages/Answers/PsychicReading";
import Guidance from "@/components/ChatsPath/pages/Guidance";
import Goal from "@/components/ChatsPath/pages/Answers/Goal";
import GoalSetup from "@/components/ChatsPath/pages/GoalSetup";
import Reviews from "@/components/ChatsPath/pages/Reviews";
import RelationshipStatus from "@/components/ChatsPath/pages/Answers/RelationshipStatus";
import Date from "@/components/ChatsPath/pages/Answers/Date";
import ParentStatus from "@/components/ChatsPath/pages/Answers/ParentStatus";
import ProfileIntro from "@/components/ChatsPath/pages/ProfileIntro";
import SatisfiedWithLife from "@/components/ChatsPath/pages/Answers/SatisfiedWithLife";
import WhatEmotion from "@/components/ChatsPath/pages/Answers/WhatEmotion";
import AnswerHub from "@/components/ChatsPath/pages/AnswerHub";
import WhatYouWant from "@/components/ChatsPath/pages/Answers/WhatYouWant";
import MissingInLife from "@/components/ChatsPath/pages/Answers/MissingInLife";
import Recognize from "@/components/ChatsPath/pages/Recognize";
import YourGoal from "@/components/ChatsPath/pages/Answers/YourGoal";
import SomethingWorrying from "@/components/ChatsPath/pages/Answers/SomethingWorrying";
import ProneToOverthinking from "@/components/ChatsPath/pages/Answers/ProneToOverthinking";
import WorriesImpact from "@/components/ChatsPath/pages/Answers/WorriesImpact";
import SensitiveToCriticism from "@/components/ChatsPath/pages/Answers/SensitiveToCriticism";
import HeadOrHeart from "@/components/ChatsPath/pages/Answers/HeadOrHeart";
import HowConfident from "@/components/ChatsPath/pages/Answers/HowConfident";
import NeedGuidance from "@/components/ChatsPath/pages/Answers/NeedGuidance";
import DecisionGuidance from "@/components/ChatsPath/pages/Answers/DecisionGuidance";
import ResonateLove from "@/components/ChatsPath/pages/Answers/ResonateLove";
import ResonateLife from "@/components/ChatsPath/pages/Answers/ResonateLife";
import ResonateFuture from "@/components/ChatsPath/pages/Answers/ResonateFuture";
import PreferencesIntro from "@/components/ChatsPath/pages/PreferencesIntro";
import BelieveInSpirituality from "@/components/ChatsPath/pages/Answers/BelieveInSpirituality";
import ReadingExperience from "@/components/ChatsPath/pages/Answers/ReadingExperience";
import InterestedHowLong from "@/components/ChatsPath/pages/Answers/InterestedHowLong";
import MainReason from "@/components/ChatsPath/pages/Answers/MainReason";
import WhatToExpect from "@/components/ChatsPath/pages/Answers/WhatToExpect";
import GuidanceArea from "@/components/ChatsPath/pages/Answers/GuidanceArea";
import PsychicComfortable from "@/components/ChatsPath/pages/Answers/PsychicComfortable";
import UserName from "@/components/ChatsPath/pages/Answers/UserName";
import Processing from "@/components/ChatsPath/pages/Processing";
import Categories from "@/components/ChatsPath/pages/Categories";
import Auth from "./Layouts/Auth";
import Connecting from "@/components/ChatsPath/pages/Connecting";
import ExpertChat from "@/components/ChatsPath/pages/ExpertChat";
import EmailConfirm from "@/components/ChatsPath/pages/EmailConfirm";
import ThankYou from "@/components/ChatsPath/pages/ThankYou";
import CookieYesController from "../CookieYesController";

const removePrefix = (path: string) => path.replace(chatsPrefix, "");
const removePrefixQuiz = (path: string) =>
  path.replace(`${chatsPrefix}/quiz/`, "");

function ChatsRoutes() {
  return (
    <Routes>
      <Route element={<Layout />}>
        <Route
          path={removePrefix(routes.client.chatsWelcome())}
          element={<Welcome />}
        />
        <Route
          path={removePrefix(routes.client.chatsGuidance())}
          element={<Guidance />}
        />
        <Route
          path={removePrefix(routes.client.chatsGoalSetup())}
          element={<GoalSetup />}
        />
        <Route
          path={removePrefix(routes.client.chatsReviews())}
          element={<Reviews />}
        />
        <Route
          path={removePrefix(routes.client.chatsProfileIntro())}
          element={<ProfileIntro />}
        />
        <Route
          path={removePrefix(routes.client.chatsAnswerHub())}
          element={<AnswerHub />}
        />
        <Route
          path={removePrefix(routes.client.chatsRecognize())}
          element={<Recognize />}
        />
        <Route
          path={removePrefix(routes.client.chatsPreferencesIntro())}
          element={<PreferencesIntro />}
        />
        <Route
          path={removePrefix(routes.client.chatsQuizProcessing())}
          element={<Processing />}
        />
        <Route element={<Auth />}>
          <Route
            path={removePrefix(routes.client.chatsCategories())}
            element={<Categories />}
          />
        </Route>
        <Route
          path={removePrefix(routes.client.chatsEmailConfirm())}
          element={<EmailConfirm />}
        />
        <Route
          path={removePrefix(routes.client.chatsThankYou())}
          element={<ThankYou />}
        />
        <Route
          path={removePrefix(routes.client.chatsConnecting())}
          element={<Connecting />}
        />
        <Route element={<CookieYesController />}>
          <Route
            path={removePrefix(routes.client.chatsExpert())}
            element={<ExpertChat />}
          />
        </Route>
        <Route
          path={`${removePrefix(routes.client.chatsQuiz())}/*`}
          element={<Quiz />}
        >
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizPsychicReading())}
            element={<PsychicReading />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizGoal())}
            element={<Goal />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizRelationshipStatus())}
            element={<RelationshipStatus />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizDate())}
            element={<Date />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizParentStatus())}
            element={<ParentStatus />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizSatisfiedWithLife())}
            element={<SatisfiedWithLife />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizWhatEmotion())}
            element={<WhatEmotion />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizWhatYouWant())}
            element={<WhatYouWant />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizMissingInLife())}
            element={<MissingInLife />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizYourGoal())}
            element={<YourGoal />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizSomethingWorrying())}
            element={<SomethingWorrying />}
          />
          <Route
            path={removePrefixQuiz(
              routes.client.chatsQuizProneToOverthinking()
            )}
            element={<ProneToOverthinking />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizWorriesImpact())}
            element={<WorriesImpact />}
          />
          <Route
            path={removePrefixQuiz(
              routes.client.chatsQuizSensitiveToCriticism()
            )}
            element={<SensitiveToCriticism />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizHeadOrHeart())}
            element={<HeadOrHeart />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizHowConfident())}
            element={<HowConfident />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizNeedGuidance())}
            element={<NeedGuidance />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizDecisionGuidance())}
            element={<DecisionGuidance />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizResonateLove())}
            element={<ResonateLove />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizResonateLife())}
            element={<ResonateLife />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizResonateFuture())}
            element={<ResonateFuture />}
          />
          <Route
            path={removePrefixQuiz(
              routes.client.chatsQuizBelieveInSpirituality()
            )}
            element={<BelieveInSpirituality />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizReadingExperience())}
            element={<ReadingExperience />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizInterestedHowLong())}
            element={<InterestedHowLong />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizMainReason())}
            element={<MainReason />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizWhatToExpect())}
            element={<WhatToExpect />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizGuidanceArea())}
            element={<GuidanceArea />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizPsychicComfortable())}
            element={<PsychicComfortable />}
          />
          <Route
            path={removePrefixQuiz(routes.client.chatsQuizUserName())}
            element={<UserName />}
          />
        </Route>
      </Route>
    </Routes>
  );
}

export default ChatsRoutes;
