import { FORM_REDUX_FIELD_NAME } from '../../constants';

import { slice } from '../slices';
import createFormSelector from '@/modules/@common/Form/redux/selectors';

const nameSpace = slice.name;

// general
export const idSelector = (state) => state[nameSpace].id;
export const hubSelector = (state) => state[nameSpace].hub;
export const hubOptionsSelector = (state) => state[nameSpace].hubOptions;
export const titleSelector = (state) => state[nameSpace].title;
export const descriptionSelector = (state) => state[nameSpace].description;
export const statusSelector = (state) => state[nameSpace].status;
export const environmentSelector = (state) => state[nameSpace].environment;
export const sourceSelector = (state) => state[nameSpace].source;
export const sourceOptionsSelector = (state) => state[nameSpace].sourceOptions;
export const sourceSearchTextSelector = (state) => state[nameSpace].sourceSearchText;
export const domainSelector = (state) => state[nameSpace].domain;
export const domainOptionsSelector = (state) => state[nameSpace].domainOptions;
// general - features
export const searchSelector = (state) => state[nameSpace].search;
export const deepSearchSelector = (state) => state[nameSpace].deepSearch;
export const genAISelector = (state) => state[nameSpace].genAI;
export const commentsSelector = (state) => state[nameSpace].comments;
export const autoplaySelector = (state) => state[nameSpace].autoplay;
export const autoplayMobileSelector = (state) => state[nameSpace].autoplayMobile;
export const autoplayNextSelector = (state) => state[nameSpace].autoplayNext;
export const soundSelector = (state) => state[nameSpace].sound;
export const soundMobileSelector = (state) => state[nameSpace].soundMobile;
export const seoSelector = (state) => state[nameSpace].seo;
export const sitemapSelector = (state) => state[nameSpace].sitemap;
export const downloadSelector = (state) => state[nameSpace].download;
export const emailShareSelector = (state) => state[nameSpace].emailShare;
export const socialShareSelector = (state) => state[nameSpace].socialShare;
export const shareServiceSelector = (state) => state[nameSpace].shareService;
export const highlightsSelector = (state) => state[nameSpace].highlights;
export const transcriptDownloadSelector = (state) => state[nameSpace].transcriptDownload;
export const slidesSelector = (state) => state[nameSpace].slides;
export const chaptersSelector = (state) => state[nameSpace].chapters;

// lookAndFeel - watch color
export const appearanceSelector = (state) => state[nameSpace].appearance;
export const fontSelector = (state) => state[nameSpace].font;
export const fontSizeSelector = (state) => state[nameSpace].fontSize;
export const colorSelector = (state) => state[nameSpace].color;
export const bgSelector = (state) => state[nameSpace].bg;
export const dockMobileSelector = (state) => state[nameSpace].dockMobile;
export const offsetTopSelector = (state) => state[nameSpace].offsetTop;
export const offsetBottomSelector = (state) => state[nameSpace].offsetBottom;
// lookAndFeel - channel color
export const cTitleSizeSelector = (state) => state[nameSpace].cTitleSize;
export const cTitleColorSelector = (state) => state[nameSpace].cTitleColor;
export const cDescSizeSelector = (state) => state[nameSpace].cDescSize;
export const cDescColorSelector = (state) => state[nameSpace].cDescColor;
export const cVidTitleSizeSelector = (state) => state[nameSpace].cVidTitleSize;
export const cVidTitleColorSelector = (state) => state[nameSpace].cVidTitleColor;
export const cInfoColorSelector = (state) => state[nameSpace].cInfoColor;
// lookAndFeel
export const engagementSelector = (state) => state[nameSpace].engagement;
export const layoutSelector = (state) => state[nameSpace].layout;
export const popupSizeSelector = (state) => state[nameSpace].popupSize;

// searchLookAndFeel - search color
export const sTitleSizeSelector = (state) => state[nameSpace].sTitleSize;
export const sTitleColorSelector = (state) => state[nameSpace].sTitleColor;
export const sVidTitleSizeSelector = (state) => state[nameSpace].sVidTitleSize;
export const sVidTitleColorSelector = (state) => state[nameSpace].sVidTitleColor;
export const sVidInfoSizeSelector = (state) => state[nameSpace].sVidInfoSize;
export const sVidInfoColorSelector = (state) => state[nameSpace].sVidInfoColor;
// searchLookAndFeel
export const searchPlaceholderSelector = (state) => state[nameSpace].searchPlaceholder;
export const searchLabelSelector = (state) => state[nameSpace].searchLabel;

// chips
export const tagsSelector = (state) => state[nameSpace].tags;
export const tagTypesSelector = (state) => state[nameSpace].tagTypes;
export const fixedTagsSelector = (state) => state[nameSpace].fixedTags;
export const excludedTagsSelector = (state) => state[nameSpace].excludedTags;
export const tagPagesSelector = (state) => state[nameSpace].tagPages;
export const tagCountSelector = (state) => state[nameSpace].tagCount;
export const tagMinSelector = (state) => state[nameSpace].tagMin;
export const tagMaxSelector = (state) => state[nameSpace].tagMax;

// advanced
export const languageSelector = (state) => state[nameSpace].language;
export const languagesSelector = (state) => state[nameSpace].languages;
export const tabOrderSelector = (state) => state[nameSpace].tabOrder;
export const dsTagsSelector = (state) => state[nameSpace].dsTags;
export const dsRedirectSelector = (state) => state[nameSpace].dsRedirect;
export const dblClickFlowSelector = (state) => state[nameSpace].dblClickFlow;
export const rtlSelector = (state) => state[nameSpace].rtl;
export const adSelector = (state) => state[nameSpace].ad;
export const adHubIdSelector = (state) => state[nameSpace].adHubId;
export const adWidgetIdSelector = (state) => state[nameSpace].adWidgetId;
export const videoPreviewSelector = (state) => state[nameSpace].videoPreview;
export const delayPreviewSelector = (state) => state[nameSpace].delayPreview;
export const cssSelector = (state) => state[nameSpace].css;

// custom
export const playerSelector = (state) => state[nameSpace].player;
export const inlinePlayerSelector = (state) => state[nameSpace].inlinePlayer;
export const verticalPlayerSelector = (state) => state[nameSpace].verticalPlayer;
export const inlineVerticalPlayerSelector = (state) => state[nameSpace].inlineVerticalPlayer;
export const myWatchSelector = (state) => state[nameSpace].myWatch;
export const widgetOriginSelector = (state) => state[nameSpace].widgetOrigin;
export const jsSelector = (state) => state[nameSpace].js;
export const backMobileSelector = (state) => state[nameSpace].backMobile;
export const genAICountSelector = (state) => state[nameSpace].genAICount;
export const configurationSelector = (state) => state[nameSpace].configuration;

// custom watch fields
export const accountIdSelector = (state) => state[nameSpace].accountId;
export const accountFeaturesSelector = (state) => state[nameSpace].accountFeatures;
export const activeTabIdSelector = (state) => state[nameSpace].activeTabId;
export const formChangedSelector = (state) => state[nameSpace].formChanged;
export const isLoadingSelector = (state) => state[nameSpace].isLoading;
export const folderNameSelector = (state) => state[nameSpace].folderName;

const formSelectors = createFormSelector(FORM_REDUX_FIELD_NAME, nameSpace);

export const scrollFieldSelector = (state) => formSelectors.getScrollField(state);
export const schemeSelector = (state) => formSelectors.schemeSelector(state);
export const fullAccessToStoreFieldsForValidation = (state) => state[nameSpace];
