import { SORT_ASC } from '@/modules/@common/constants/sort';

import {
  CHART_COMMON_DEFAULT_CONFIG,
  COMMON_COMPARISON_OPTIONS,
  COMMON_COMPARISON_PARAMS,
  COMMON_TIME_INTERVAL_OPTIONS,
  COMMON_TIME_INTERVAL_PARAMS,
  COMMON_TIME_INTERVAL_PARAMS_FOR_SELF_SERVE,
  LOG_PARAMS,
} from './chart';
import { STATUS_FILTERS } from './table';

export const DEMAND_TAG_PAGE = 'DEMAND_TAG_PAGE';

export const DEMAND_TAG_PAGE_PATHNAME = '/tags';

export const DEMAND_TAG_PAGE_CONFIRM_FREQUENCY_CAP_MODAL = 'DEMAND_TAG_PAGE_CONFIRM_FREQUENCY_CAP_MODAL';

export const BUDGETING = 'Budgeting';

export const DEMAND_TAG_PAGE_TABLE_HEADERS = [
  {
    id: 'ID',
    label: 'Id',
    isSortable: true,
  },
  {
    id: 'NAME',
    label: 'Name',
    isSortable: true,
    defaultSortOrder: SORT_ASC,
  },
  {
    id: 'TIER_PRIORITY',
    label: 'Tier',
    isSortable: true,
  },
  {
    id: 'priority',
    label: 'Priority',
    isSortable: false,
  },
  {
    id: 'REQUESTS',
    label: 'Requests',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'BIDS',
    label: 'Bids',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'OPPORTUNITIES',
    label: 'Opportunities',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'IMPRESSIONS',
    label: 'Impressions',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'REVENUE',
    label: 'Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'GROSS_REVENUE',
    label: 'Gross Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PROFIT',
    label: 'Profit',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'REQUESTS_FILL',
    label: 'Req Fill',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'OPPORTUNITIES_FILL',
    label: 'Opp Fill',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'RPM',
    label: 'RPM',
    align: 'right',
    withGap: true,
    isSortable: true,
  },
  {
    id: 'GROSS_RPM',
    label: 'Gross RPM',
    align: 'right',
    withGap: true,
    isSortable: true,
  },
  {
    id: 'CTR',
    label: 'CTR',
    align: 'right',
    withGap: true,
    isSortable: true,
  },
  {
    id: 'COMPLETION_RATE',
    label: 'Completion Rate',
    align: 'right',
    withGap: true,
    isSortable: true,
  },
  {
    id: 'ERPM',
    label: 'eRPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'GROSS_ERPM',
    label: 'Gross eRPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'STATUS',
    label: 'Status',
    isSortable: false,
  },
];

export const DEMAND_TAG_PAGE_TABLE_HEADERS_FOR_DISPLAY_FORMAT = [
  {
    id: 'ID',
    label: 'Id',
    isSortable: true,
  },
  {
    id: 'NAME',
    label: 'Name',
    isSortable: true,
    defaultSortOrder: SORT_ASC,
  },
  {
    id: 'TIER_PRIORITY',
    label: 'Tier',
    isSortable: true,
  },
  {
    id: 'priority',
    label: 'Priority',
    isSortable: false,
  },
  {
    id: 'REQUESTS',
    label: 'Requests',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'BIDS',
    label: 'Bids',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'IMPRESSIONS',
    label: 'Impressions',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'REVENUE',
    label: 'Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'GROSS_REVENUE',
    label: 'Gross Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PROFIT',
    label: 'Profit',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'REQUESTS_FILL',
    label: 'Req Fill',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'RPM',
    label: 'RPM',
    align: 'right',
    withGap: true,
    isSortable: true,
  },
  {
    id: 'GROSS_RPM',
    label: 'Gross RPM',
    align: 'right',
    withGap: true,
    isSortable: true,
  },
  {
    id: 'STATUS',
    label: 'Status',
    isSortable: false,
  },
];

export const DEMAND_TAG_PAGE_TABLE_CELLS = [
  {
    key: 'id',
  },
  {
    key: 'name',
  },
  {
    key: 'tier',
  },
  {
    key: 'priority',
  },
  {
    key: 'fields.REQUESTS',
    align: 'right',
    withPercent: true,
  },
  {
    key: 'fields.BIDS',
    align: 'right',
    withPercent: true,
  },
  {
    key: 'fields.OPPORTUNITIES',
    align: 'right',
    withPercent: true,
  },
  {
    key: 'fields.IMPRESSIONS',
    align: 'right',
    withPercent: true,
  },
  {
    key: 'fields.REVENUE',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.GROSS_REVENUE',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.PROFIT',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.REQUESTS_FILL',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.OPPORTUNITIES_FILL',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.RPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.GROSS_RPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.CTR',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.COMPLETION_RATE',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.ERPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.GROSS_ERPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'status',
  },
];

export const DEMAND_TAG_PAGE_TABLE_CELLS_FOR_DISPLAY_FORMAT = [
  {
    key: 'id',
  },
  {
    key: 'name',
  },
  {
    key: 'tier',
  },
  {
    key: 'priority',
  },
  {
    key: 'fields.REQUESTS',
    align: 'right',
    withPercent: true,
  },
  {
    key: 'fields.BIDS',
    align: 'right',
    withPercent: true,
  },
  {
    key: 'fields.IMPRESSIONS',
    align: 'right',
    withPercent: true,
  },
  {
    key: 'fields.REVENUE',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.GROSS_REVENUE',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.PROFIT',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.REQUESTS_FILL',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.RPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.GROSS_RPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'status',
  },
];

export const DEMAND_TAG_PAGE_INFO_ROWS = [
  {
    label: 'Ad Requests',
    value: 'REQUESTS',
  },
  {
    label: 'Ad Impressions',
    value: 'IMPRESSIONS',
  },
  {
    label: 'Request Fill',
    value: 'REQUESTS_FILL',
    postfix: '%',
    needMultiply: true,
  },
  {
    label: 'Ad Opportunities',
    value: 'OPPORTUNITIES',
  },
  {
    label: 'Opportunities Fill',
    value: 'OPPORTUNITIES_FILL',
    postfix: '%',
    needMultiply: true,
  },
  {
    label: 'Revenue',
    value: 'REVENUE',
    prefix: '$',
  },
  {
    label: 'Gross Revenue',
    value: 'GROSS_REVENUE',
    prefix: '$',
  },
  {
    label: 'Profit',
    value: 'PROFIT',
    prefix: '$',
  },
  {
    label: 'RPM',
    value: 'RPM',
    prefix: '$',
  },
  {
    label: 'Gross RPM',
    value: 'GROSS_RPM',
    prefix: '$',
  },
  {
    label: 'eRPM',
    value: 'ERPM',
    prefix: '$',
  },
  {
    label: 'Gross eRPM',
    value: 'GROSS_ERPM',
    prefix: '$',
  },
  {
    label: 'Ad Clicks',
    value: 'CLICKS',
  },
  {
    label: 'CTR',
    value: 'CTR',
    postfix: '%',
    needMultiply: true,
  },
  {
    label: 'Completion Rate',
    value: 'COMPLETION_RATE',
    postfix: '%',
    needMultiply: true,
  },
  {
    label: 'Impression Viewability',
    value: 'IMPRESSIONS_VIEWABILITY',
    postfix: '%',
    needMultiply: true,
  },
];

export const DEMAND_TAG_PAGE_INFO_ROWS_FOR_DISPLAY_FORMAT = [
  {
    label: 'Ad Requests',
    value: 'REQUESTS',
  },
  {
    label: 'Ad Impressions',
    value: 'IMPRESSIONS',
  },
  {
    label: 'Request Fill',
    value: 'REQUESTS_FILL',
    postfix: '%',
    needMultiply: true,
  },
  {
    label: 'Revenue',
    value: 'REVENUE',
    prefix: '$',
  },
  {
    label: 'Gross Revenue',
    value: 'GROSS_REVENUE',
    prefix: '$',
  },
  {
    label: 'Profit',
    value: 'PROFIT',
    prefix: '$',
  },
  {
    label: 'RPM',
    value: 'RPM',
    prefix: '$',
  },
  {
    label: 'Gross RPM',
    value: 'GROSS_RPM',
    prefix: '$',
  },
  {
    label: 'Ad Clicks',
    value: 'CLICKS',
  },
  {
    label: 'Impression Viewability',
    value: 'IMPRESSIONS_VIEWABILITY',
    postfix: '%',
    needMultiply: true,
  },
];

export const DEMAND_TAG_PAGE_ADD_SUPPLY_TAG_MODAL = 'DEMAND_TAG_PAGE_ADD_SUPPLY_TAG_MODAL';

export const DEMAND_TAG_PAGE_TOTAL_FIELDS = [
  'REQUESTS',
  'IMPRESSIONS',
  'REQUESTS_FILL',
  'OPPORTUNITIES',
  'OPPORTUNITIES_FILL',
  'REVENUE',
  'GROSS_REVENUE',
  'RPM',
  'GROSS_RPM',
  'ERPM',
  'GROSS_ERPM',
  'IMPRESSIONS_VIEWABILITY',
  'CLICKS',
  'CTR',
  'COMPLETION_RATE',
  'PROFIT',
];

export const DEMAND_TAG_PAGE_TOTAL_GRAPHQL_QUERY = `
  query DemandTagDataByIdQuery(
    $fields: [String],
    $filters: MarketplaceFiltersInputType,
    $id: String!
  ) {
    demandTagDataById(
      fields: $fields,
      filters: $filters,
      id: $id
    ) {
      fields {
        REQUESTS {
          value
          change
        }
        IMPRESSIONS {
          value
          change
        }
        REQUESTS_FILL {
          value
          change
        }
        OPPORTUNITIES {
          value
          change
        }
        OPPORTUNITIES_FILL {
          value
          change
        }
        REVENUE {
          value
          change
        }
        GROSS_REVENUE {
          value
          change
        }
        RPM {
          value
          change
        }
        GROSS_RPM {
          value
          change
        }
        ERPM {
          value
          change
        }
        GROSS_ERPM {
          value
          change
        }
        IMPRESSIONS_VIEWABILITY {
          value
          change
        }
        CLICKS {
          value
          change
        }
        CTR {
          value
          change
        }
        COMPLETION_RATE {
          value
          change
        }
        PROFIT {
          value
          change
        }
      }
    }
  }
`;

export const DEMAND_TAG_PAGE_DATA_FIELDS = [
  'REQUESTS',
  'OPPORTUNITIES',
  'IMPRESSIONS',
  'REQUESTS_FILL',
  'OPPORTUNITIES_FILL',
  'REVENUE',
  'GROSS_REVENUE',
  'RPM',
  'GROSS_RPM',
  'ERPM',
  'GROSS_ERPM',
  'CTR',
  'COMPLETION_RATE',
  'BIDS',
  'PROFIT',
];

export const DEMAND_TAG_PAGE_DATA_GRAPHQL_QUERY = `
  query SupplyTagDataQuery(
    $fields: [String],
    $sort: MarketplaceSortInputType,
    $from: Int,
    $size: Int,
    $filters: MarketplaceFiltersInputType
  ) {
    supplyTagData(
      fields: $fields,
      sort: $sort,
      from: $from,
      size: $size,
      filters: $filters
    ) {
      totalCount
      data {
        id
        name
        status
        tier
        priority
        accountId
        siteId
        fields {
          REQUESTS {
            value
            change
          }
          OPPORTUNITIES {
            value
            change
          }
          IMPRESSIONS {
            value
            change
          }
          REQUESTS_FILL {
            value
            change
          }
          OPPORTUNITIES_FILL {
            value
            change
          }
          REVENUE {
            value
            change
          }
          GROSS_REVENUE {
            value
            change
          }
          RPM {
            value
            change
          }
          GROSS_RPM {
            value
            change
          }
          CTR {
            value
            change
          }
          COMPLETION_RATE {
            value
            change
          }
          ERPM {
            value
            change
          }
          GROSS_ERPM {
            value
            change
          }
          BIDS {
            value
            change
          }
          PROFIT {
            value
            change
          }
        }
      }
    }
  }
`;

export const DEMAND_TAG_PAGE_HISTOGRAM_GRAPHQL_QUERY = `
  query SupplyTagHistogramQuery(
    $fields: [String],
    $interval: String,
    $timezone: String,
    $filters: [MarketplaceFiltersInputType]
  ) {
    supplyTagHistogram(
      fields: $fields,
      interval: $interval,
      timezone: $timezone,
      filters: $filters
    ) {
      totalCount
      data {
        name
        buckets {
          time
          fields {
            REQUESTS {
              value
              change
            }
            IMPRESSIONS {
              value
              change
            }
            REQUESTS_FILL {
              value
              change
            }
            REVENUE {
              value
              change
            }
            GROSS_REVENUE {
              value
              change
            }
            OPPORTUNITIES_FILL {
              value
              change
            }
          }
        }
      }
    }
  }
`;

export const DEMAND_TAG_PAGE_INFO_GRAPHQL_QUERY = `
  query DemandTagByIdQuery(
    $id: String
  ) {
    demandTagById(
      id: $id
    ) {
      id
      name
      created
      updated
      updatedBy
      daccountId
      advertiserId
      status
      adServer {
        id
        name
        url
      }
      flightsDates{
        startDate
        endDate
      }
      defaultTier
      labels
      timeout
      eventPixels {
        url
        name
        type
      }
      model
      include {
        domains
        geo
        os
        browsers
        playerSizes
        viewability
        devices
      }
      exclude {
        domains
        geo
        os
        browsers
        devices
      }
      budgets {
        budget
        pacing
        type
        timeframe
      }
      frequency {
        status
        value
        amount
        type
        timeframe
      }
      accountName
      advertiserName
      advertiserTier
      type
      platform {
        connectorId
        connectorName
        code
        params {
          name
          value
        }
        supplyChain
        maxFloor
        bidMapping {
          fileName
          data {
            cpm
            code
          }
        }
      }
      rateSource {
        name
        seatId
        adUnitId
        type
      }
      floorPrice {
        floor
        viewableFloor
        override
      }
      viewabilityThreshold
      adjustFloor
      publisherDemand
      format
      priority
      budgetAlarm
      kvTargeting {
        state
        type
        key
        values
        listNames
        keyName
      }
      videoId
      clickThroughUrl
      source
      platformId
    }
  }
`;

export const DEMAND_TAG_PAGE_CONFIG = {
  type: DEMAND_TAG_PAGE,
  tabs: [
    {
      label: 'Supply Tags',
      dataId: 'main',
      contentKey: 'main',
    },
    {
      label: 'Settings',
      dataId: 'demandTagSettings',
      contentKey: 'demandTagSettings',
    },
    {
      label: 'Pricing',
      dataId: 'demandTagPricing',
      contentKey: 'demandTagPricing',
    },
    {
      label: 'Targeting',
      dataId: 'demandTagTargeting',
      contentKey: 'demandTagTargeting',
    },
    {
      label: 'Frequency Cap',
      dataId: 'demandTagFrequency',
      contentKey: 'demandTagFrequency',
    },
    {
      label: BUDGETING,
      dataId: 'demandTagBudgeting',
      contentKey: 'demandTagBudgeting',
    },
  ],
  targetingTabConfig: {
    geography: true,
    geographyTooltip: false,
    playerSize: true,
    viewability: true,
    viewabilityTargeting: true,
    device: true,
    os: true,
    browser: true,
    kvTargeting: true,
  },
  infoRows: DEMAND_TAG_PAGE_INFO_ROWS,
  rowsInColumn: 10,
  tableSelecting: true,
  tableHeaders: DEMAND_TAG_PAGE_TABLE_HEADERS,
  tableFilters: STATUS_FILTERS,
  tableCells: DEMAND_TAG_PAGE_TABLE_CELLS,
  timeIntervalOptions: COMMON_TIME_INTERVAL_OPTIONS,
  timeIntervalParams: COMMON_TIME_INTERVAL_PARAMS,
  chartLogParams: LOG_PARAMS,
  comparisonOptions: [
    ...COMMON_COMPARISON_OPTIONS,
    {
      label: 'Opportunities Fill',
      value: 'OPPORTUNITIES_FILL',
    },
  ],
  comparisonParams: COMMON_COMPARISON_PARAMS,
  rowsPerPageOptions: [10, 25, 50, 100, 200],
  defaultConfig: {
    ...CHART_COMMON_DEFAULT_CONFIG,
    filterByStatus: STATUS_FILTERS[1].value,
  },
  totalFields: DEMAND_TAG_PAGE_TOTAL_FIELDS,
  totalQuery: DEMAND_TAG_PAGE_TOTAL_GRAPHQL_QUERY,
  dataFields: DEMAND_TAG_PAGE_DATA_FIELDS,
  dataQuery: DEMAND_TAG_PAGE_DATA_GRAPHQL_QUERY,
  histogramQuery: DEMAND_TAG_PAGE_HISTOGRAM_GRAPHQL_QUERY,
  infoQuery: DEMAND_TAG_PAGE_INFO_GRAPHQL_QUERY,
  selfServeConfig: {
    infoRows: DEMAND_TAG_PAGE_INFO_ROWS.filter(
      (item) => !['REVENUE', 'RPM', 'PROFIT', 'ERPM'].includes(item.value),
    ).map((item) => {
      if (item.value === 'GROSS_REVENUE') {
        return { ...item, label: 'Pub Revenue' };
      }
      if (item.value === 'GROSS_RPM') {
        return { ...item, label: 'Ad RPM' };
      }
      if (item.value === 'GROSS_ERPM') {
        return { ...item, label: 'Opp eRPM' };
      }
      return item;
    }),
    timeIntervalParams: COMMON_TIME_INTERVAL_PARAMS_FOR_SELF_SERVE,
    comparisonOptions: [
      ...COMMON_COMPARISON_OPTIONS.filter((item) => !['REVENUE'].includes(item.value)).map((item) => {
        if (item.value === 'GROSS_REVENUE') {
          return { ...item, label: 'Pub Revenue' };
        }
        return item;
      }),
      {
        label: 'Opportunities Fill',
        value: 'OPPORTUNITIES_FILL',
      },
    ],
    tableHeaders: DEMAND_TAG_PAGE_TABLE_HEADERS.filter(
      (item) => !['REVENUE', 'RPM', 'ERPM', 'PROFIT', 'TIER_PRIORITY', 'priority'].includes(item.id),
    ).map((item) => {
      if (item.id === 'GROSS_REVENUE') {
        return { ...item, label: 'Pub Revenue' };
      }
      if (item.id === 'GROSS_RPM') {
        return { ...item, label: 'Ad RPM' };
      }
      if (item.id === 'GROSS_ERPM') {
        return { ...item, label: 'Opp eRPM' };
      }
      return item;
    }),
    tableCells: DEMAND_TAG_PAGE_TABLE_CELLS.filter(
      (item) =>
        !['fields.REVENUE', 'fields.RPM', 'fields.ERPM', 'fields.PROFIT', 'tier', 'priority'].includes(item.key),
    ),
    // defaultConfig for Self Serve MP
    defaultConfig: {
      comparisonFilter: COMMON_COMPARISON_OPTIONS[0].value,
    },
  },
  isOpenNewTab: true,
  showHistoryCSVButton: true,
};

export const DEMAND_TAG_PAGE_TYPE_VALUES = {
  tag: 'TAG',
  hb: 'HB',
  mp4: 'DIRECT_MP4',
};

export const DEMAND_TAG_PAGE_AD_SERVER_TYPE_VALUES = {
  none: 'none',
  list: 'list',
};

export const DEMAND_TAG_DEFAULT_TIER_VALUES = [
  { value: 0 },
  { value: 1 },
  { value: 2 },
  { value: 3 },
  { value: 4 },
  { value: 5 },
  { value: 6 },
  { value: 7 },
  { value: 8 },
  { value: 9 },
];

export const DEMAND_TAG_EVENT_PIXELS_SIZE = 5;

export const DEMAND_TAG_PAGE_EVENT_LIST = [
  {
    label: 'Ad Request',
    value: 'REQUESTS',
  },
  {
    label: 'Ad Impression',
    value: 'IMPRESSIONS',
  },
  {
    label: 'Ad Click',
    value: 'CLICK',
  },
  {
    label: 'Ad Complete',
    value: 'COMPLETE',
  },
];

export const DEMAND_TAG_PAGE_EVENT_TYPES = [
  {
    label: 'Image URL',
    value: 'IMAGE_URL',
  },
  {
    label: 'JavaScript URL',
    value: 'JAVASCRIPT_URL',
  },
];

export const DEMAND_TAG_PAGE_BUSINESS_MODEL = [
  {
    label: 'Fixed RPM',
    value: 'FIXED_RPM',
  },
  {
    label: 'Dynamic RPM Update',
    value: 'DYNAMIC_RPM',
  },
];

export const DEMAND_TAG_PAGE_BUSINESS_MODEL_HB_NOT_GAM = [
  {
    label: 'HB Dynamic Rate',
    value: 'HB_DYNAMIC_RATE',
  },
  {
    label: 'Fixed RPM',
    value: 'FIXED_RPM',
  },
];

export const DEMAND_TAG_PAGE_SOURCE = [
  {
    label: 'GAM',
    value: 'GAM',
  },
  {
    label: 'SpringServe',
    value: 'SPRINGSERVE',
  },
];

export const DEMAND_TAG_PAGE_PRICING_TYPE = [
  {
    label: 'Ad Unit',
    value: 'AD_UNIT',
  },
  {
    label: 'Report Name',
    value: 'REPORT_NAME',
  },
];

export const DEMAND_TAG_PAGE_OS_LIST = [
  { label: 'Android', value: 'ANDROID' },
  { label: 'IOS', value: 'IOS' },
  { label: 'Win', value: 'WINDOWS' },
  { label: 'Linux', value: 'LINUX' },
  { label: 'Mac', value: 'MAC' },
  { label: 'ChromeOS', value: 'CHROME_OS' },
  { label: 'FireOS', value: 'FIRE_OS' },
  { label: 'Other', value: 'OTHER' },
];

export const DEMAND_TAG_PAGE_DEVICE_LIST = [
  { label: 'Desktop', value: 'DESKTOP' },
  { label: 'Mobile and Tablet', value: 'MOBILE' },
  { label: 'Other', value: 'OTHER' },
];

export const DEMAND_TAG_PAGE_BROWSER_LIST = [
  { label: 'Chrome', value: 'CHROME' },
  { label: 'Edge', value: 'EDGE' },
  { label: 'Safari', value: 'SAFARI' },
  { label: 'Firefox', value: 'FIREFOX' },
  { label: 'IE', value: 'IE' },
  { label: 'Other', value: 'OTHER' },
];

export const DEMAND_TAG_PAGE_BUDGET_TYPES = {
  request: 'REQUEST',
  impression: 'IMPRESSION',
};

export const DEMAND_TAG_PAGE_BUDGET_TYPE_LIST = [
  // {
  //   label: 'Request',
  //   value: DEMAND_TAG_PAGE_BUDGET_TYPES.request,
  // },
  {
    label: 'Impressions',
    value: DEMAND_TAG_PAGE_BUDGET_TYPES.impression,
  },
];

export const DEMAND_TAG_PAGE_BUDGET_TIMEFRAME_TYPES = {
  minute: 'MINUTE',
  hourly: 'HOURLY',
  daily: 'DAILY',
  weekly: 'WEEKLY',
  monthly: 'MONTHLY',
  lifetime: 'LIFETIME',
};

export const DEMAND_TAG_PAGE_BUDGET_TIMEFRAME_LIST = [
  {
    label: 'Hourly',
    value: DEMAND_TAG_PAGE_BUDGET_TIMEFRAME_TYPES.hourly,
  },
  {
    label: 'Daily',
    value: DEMAND_TAG_PAGE_BUDGET_TIMEFRAME_TYPES.daily,
  },
  {
    label: 'Weekly',
    value: DEMAND_TAG_PAGE_BUDGET_TIMEFRAME_TYPES.weekly,
  },
  {
    label: 'Monthly',
    value: DEMAND_TAG_PAGE_BUDGET_TIMEFRAME_TYPES.monthly,
  },
  {
    label: 'Life time',
    value: DEMAND_TAG_PAGE_BUDGET_TIMEFRAME_TYPES.lifetime,
  },
];

export const DEMAND_TAG_PAGE_BUDGET_PACING_TYPES = {
  even: 'EVEN',
  asap: 'ASAP',
};
export const DEMAND_TAG_PAGE_BUDGET_PACING_LIST = [
  {
    label: 'Even',
    value: DEMAND_TAG_PAGE_BUDGET_PACING_TYPES.even,
  },
  {
    label: 'Asap',
    value: DEMAND_TAG_PAGE_BUDGET_PACING_TYPES.asap,
  },
];

export const DEMAND_TAG_EVENT_BUDGETS_SIZE = 5;
export const DEMAND_TAG_FREQUENCY_CAP_TIMEFRAME_LIST = [
  {
    label: 'Minutes',
    value: 'MINUTE',
  },
  {
    label: 'Hour',
    value: 'HOUR',
  },
  {
    label: 'Day',
    value: 'DAY',
  },
];

export const DEMAND_TAG_FREQUENCY_CAP_TYPE_LIST = {
  request: 'REQUEST',
  impressions: 'IMPRESSION',
};

export const DEMAND_TAG_PRICING_TYPE = {
  price: 'DEMAND_PRICE',
  fee: 'DEMAND_FEE',
  adServing: 'DEMAND_AD_SERVING_FEES',
  adRequest: 'DEMAND_AD_REQUEST_FEE',
};

export const DEMAND_TAG_TARGETING_PLAYER_SIZE_TYPE = {
  xs: 'XS',
  s: 'S',
  m: 'M',
  l: 'L',
};

export const DEMAND_TAG_TARGETING_VIEWABILITY_TYPE = {
  inView: 'IN_VIEW',
  nonInView: 'NOT_IN_VIEW',
};

export const DEMAND_TAG_TARGETING_OS_TYPE = {
  android: 'ANDROID',
  ios: 'IOS',
  windows: 'WINDOWS',
  linux: 'LINUX',
  mac: 'MAC',
  chromeOs: 'CHROME_OS',
  fireOS: 'FIRE_OS',
  other: 'OTHER',
};
export const DEMAND_TAG_TARGETING_DEVICE_TYPE = {
  desktop: 'DESKTOP',
  mobile: 'MOBILE',
  tablet: 'TABLET',
  connectedTv: 'CONNECTED_TV',
  other: 'OTHER',
};

export const DEMAND_TAG_FREQUENCY_TAB_STATUS = {
  active: 'ACTIVE',
  disabled: 'DISABLED',
};

export const DEMAND_TAG_SUPPLY_CHAIN_OVERRIDE = {
  enabled: 'ENABLED',
  disabled: 'DISABLED',
};

export const DEMAND_TAG_SUPPLY_CHAIN_VALUE = {
  blank: 'BLANK',
  custom: 'CUSTOM',
};

export const FLOOR_PRICE = {
  publisherDefault: 'publisherDefault',
  override: 'override',
};

export const DEMAND_TAG_STATUS = {
  enabled: 'ACTIVE',
  disabled: 'DISABLED',
};

export const DEMAND_TAG_VIEWABILITY_TARGETING = {
  enabled: 'ACTIVE',
  disabled: 'DISABLED',
};

export const DEMAND_TAG_FORMAT = {
  video: 'VIDEO',
  display: 'DISPLAY',
  sponsored: 'SPONSORED',
};

export const DEMAND_TAG_KEY_VALUE_TARGETING_STATUS = {
  enabled: 'ACTIVE',
  disabled: 'DISABLED',
};

export const DEMAND_TAG_KEY_VALUE_TARGETING_TYPE = {
  value: 'VALUE',
  list: 'LIST',
};

export const DEMAND_TAG_PRIORITY = {
  firstLook: 'FIRST_LOOK',
  openAuction: 'OPEN_AUCTION',
};

export const DEMAND_TAG_PAGE_AD_SERVING_BUSINESS_MODEL_IMPRESSIONS = 'IMPRESSIONS_CPM';
export const DEMAND_TAG_PAGE_AD_SERVING_BUSINESS_MODEL_REV_SHARE = 'REV_SHARE';

export const DEMAND_TAG_PAGE_AD_SERVING_BUSINESS_MODEL_LIST = [
  {
    label: 'Impressions CPM',
    value: DEMAND_TAG_PAGE_AD_SERVING_BUSINESS_MODEL_IMPRESSIONS,
  },
  {
    label: 'Rev-Share',
    value: DEMAND_TAG_PAGE_AD_SERVING_BUSINESS_MODEL_REV_SHARE,
  },
];

export const DEMAND_TAG_HB_GAM_PLATFORMS = ['gam', 'gamfixed'];
