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

export const SUPPLY_ACCOUNTS_PAGE_PATHNAME = '/supply';

export const SUPPLY_ACCOUNTS_PAGE_TYPE = 'SUPPLY_ACCOUNTS_PAGE';

export const SUPPLY_ACCOUNTS_PAGE_HEADER = 'Supply Accounts';

export const SUPPLY_ACCOUNTS_PAGE_HEADERS = [
  {
    id: 'NAME',
    label: 'Name',
    isSortable: true,
    defaultSortOrder: SORT_ASC,
  },
  {
    id: 'SITES',
    label: 'Sites',
    isSortable: true,
  },
  {
    id: 'PLAYER_LOADS',
    label: 'Player Loads',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'SUPPLY_REQUESTS',
    label: 'Requests',
    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: 'PUB_NET_REVENUE',
    label: 'Pub NET Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'SUPPLY_REQUESTS_FILL',
    label: 'Req Fill',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'OVERALL_FILL',
    label: 'Overall Fill',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PUB_PLAYER_ERPM',
    label: 'Player eRPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PLAYER_ERPM',
    label: 'Player eRPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'GROSS_PLAYER_ERPM',
    label: 'Gross Player eRPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PUB_NET_PLAYER_ERPM',
    label: 'Pub NET Player eRPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
];

export const SUPPLY_ACCOUNTS_PAGE_CELLS = [
  {
    key: 'name',
  },
  {
    key: 'sites',
  },
  {
    key: 'fields.PLAYER_LOADS',
    align: 'right',
    withPercent: true,
  },
  {
    key: 'fields.SUPPLY_REQUESTS',
    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.PUB_NET_REVENUE',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.SUPPLY_REQUESTS_FILL',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.OVERALL_FILL',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.PUB_PLAYER_ERPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.PLAYER_ERPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.GROSS_PLAYER_ERPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.PUB_NET_PLAYER_ERPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
];

export const SUPPLY_ACCOUNTS_PAGE_FIELDS = [
  'PLAYER_LOADS',
  'SUPPLY_REQUESTS',
  'IMPRESSIONS',
  'SUPPLY_REQUESTS_FILL',
  'OVERALL_FILL',
  'REVENUE',
  'GROSS_REVENUE',
  'PUB_PLAYER_ERPM',
  'PLAYER_ERPM',
  'GROSS_PLAYER_ERPM',
  'PUB_NET_REVENUE',
  'PUB_NET_PLAYER_ERPM',
];

export const SUPPLY_ACCOUNTS_PAGE_GRAPHQL_QUERY = `
  query SupplyAccountsDataQuery(
    $fields: [String],
    $sort: MarketplaceSortInputType,
    $from: Int,
    $size: Int,
    $filters: MarketplaceFiltersInputType,
    $allPages: Boolean
  ) {
    supplyAccountsData(
      fields: $fields,
      sort: $sort,
      from: $from,
      size: $size,
      filters: $filters,
      allPages: $allPages
    ) {
      totalCount
      data {
        id
        name
        sites
        fields {
          PLAYER_LOADS {
            value
            change
          }
          SUPPLY_REQUESTS {
            value
            change
          }
          IMPRESSIONS {
            value
            change
          }
          SUPPLY_REQUESTS_FILL {
            value
            change
          }
          OVERALL_FILL {
            value
            change
          }
          REVENUE {
            value
            change
          }
          GROSS_REVENUE {
            value
            change
          }
          PUB_PLAYER_ERPM {
            value
            change
          }
          PLAYER_ERPM {
            value
            change
          }
          GROSS_PLAYER_ERPM {
            value
            change
          }
          PUB_NET_REVENUE {
            value
            change
          }
          PUB_NET_PLAYER_ERPM {
            value
            change
          }
        }
      }
    }
  }
`;

export const SUPPLY_ACCOUNTS_PAGE_SITES_HEADERS = [
  {
    id: 'NAME',
    label: 'Name',
    isSortable: true,
  },
  {
    id: 'SUPPLIES',
    label: 'Supply Tags',
    isSortable: true,
  },
  {
    id: 'PLAYER_LOADS',
    label: 'Player Loads',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'SUPPLY_REQUESTS',
    label: 'Requests',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'IMPRESSIONS',
    label: 'Impressions',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for admin
  {
    id: 'REVENUE',
    label: 'Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for admin
  {
    id: 'GROSS_REVENUE',
    label: 'Gross Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for self serve
  {
    id: 'PUB_REVENUE',
    label: 'Pub Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PUB_NET_REVENUE',
    label: 'Pub NET Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'RPM',
    label: 'RPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for admin
  {
    id: 'GROSS_RPM',
    label: 'Gross RPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PUB_AD_RPM',
    label: 'Ad RPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'SUPPLY_REQUESTS_FILL',
    label: 'Req Fill',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'OVERALL_FILL',
    label: 'Overall Fill',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PUB_PLAYER_ERPM',
    label: 'Player eRPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PLAYER_ERPM',
    label: 'Player eRPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for admin
  {
    id: 'GROSS_PLAYER_ERPM',
    label: 'Gross Player eRPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PUB_NET_PLAYER_ERPM',
    label: 'Pub NET Player eRPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for admin
  {
    id: 'CTR',
    label: 'CTR',
    align: 'right',
    withGap: true,
    isSortable: true,
  },
  // only for admin
  {
    id: 'COMPLETION_RATE',
    label: 'Completion Rate',
    align: 'right',
    withGap: true,
    isSortable: true,
  },
];

export const SUPPLY_ACCOUNTS_PAGE_SITES_CELLS = [
  {
    key: 'name',
  },
  {
    key: 'supplies',
  },
  {
    key: 'fields.PLAYER_LOADS',
    align: 'right',
    withPercent: true,
  },
  {
    key: 'fields.SUPPLY_REQUESTS',
    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.PUB_REVENUE',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.PUB_NET_REVENUE',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.RPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.GROSS_RPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.PUB_AD_RPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.SUPPLY_REQUESTS_FILL',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.OVERALL_FILL',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.PUB_PLAYER_ERPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.PLAYER_ERPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.GROSS_PLAYER_ERPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.PUB_NET_PLAYER_ERPM',
    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,
  },
];

export const SUPPLY_ACCOUNTS_PAGE_SITES_FIELDS = [
  'PLAYER_LOADS',
  'SUPPLY_REQUESTS',
  'IMPRESSIONS',
  'SUPPLY_REQUESTS_FILL',
  'OVERALL_FILL',
  'REVENUE',
  'PUB_REVENUE',
  'GROSS_REVENUE',
  'PUB_PLAYER_ERPM',
  'PLAYER_ERPM',
  'RPM',
  'GROSS_RPM',
  'PUB_AD_RPM',
  'GROSS_PLAYER_ERPM',
  'COMPLETION_RATE',
  'CTR',
  'PUB_NET_REVENUE',
  'PUB_NET_PLAYER_ERPM',
];

export const SUPPLY_ACCOUNTS_PAGE_SITES_GRAPHQL_QUERY = `
  query SiteDataQuery(
    $fields: [String],
    $sort: MarketplaceSortInputType,
    $from: Int,
    $size: Int,
    $filters: MarketplaceFiltersInputType,
    $allPages: Boolean
  ) {
    siteData(
      fields: $fields,
      sort: $sort,
      from: $from,
      size: $size,
      filters: $filters,
      allPages: $allPages
    ) {
      totalCount
      data {
        id
        name
        supplies
        accountId
        fields {
          PLAYER_LOADS {
            value
            change
          }
          SUPPLY_REQUESTS {
            value
            change
          }
          IMPRESSIONS {
            value
            change
          }
          SUPPLY_REQUESTS_FILL {
            value
            change
          }
          OVERALL_FILL {
            value
            change
          }
          REVENUE {
            value
            change
          }
          PUB_REVENUE {
            value
            change
          }
          GROSS_REVENUE {
            value
            change
          }
          PUB_PLAYER_ERPM {
            value
            change
          }
          PLAYER_ERPM {
            value
            change
          }
          GROSS_PLAYER_ERPM {
            value
            change
          }
          RPM {
            value
            change
          }
          GROSS_RPM {
            value
            change
          }
          PUB_AD_RPM {
            value
            change
          }
          COMPLETION_RATE {
            value
            change
          }
          CTR {
            value
            change
          }
          PUB_NET_REVENUE {
            value
            change
          }
          PUB_NET_PLAYER_ERPM {
            value
            change
          }
        }
      }
    }
  }
`;

export const SUPPLY_ACCOUNTS_PAGE_TAGS_HEADERS = [
  {
    id: 'NAME',
    label: 'Name',
    isSortable: true,
  },
  {
    id: 'DEMANDS',
    label: 'Demand Tags',
    isSortable: true,
  },
  {
    id: 'SUPPLY_REQUESTS',
    label: 'Requests',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'IMPRESSIONS',
    label: 'Impressions',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for admin
  {
    id: 'REVENUE',
    label: 'Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for admin
  {
    id: 'GROSS_REVENUE',
    label: 'Gross Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for self serve
  {
    id: 'PUB_REVENUE',
    label: 'Pub Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PUB_NET_REVENUE',
    label: 'Pub NET Revenue',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'RPM',
    label: 'RPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for admin
  {
    id: 'GROSS_RPM',
    label: 'Gross RPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'PUB_AD_RPM',
    label: 'Ad RPM',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'SUPPLY_REQUESTS_FILL',
    label: 'Req Fill',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'SUPPLY_REQUESTS_VIEWABILITY',
    label: 'Requests Viewability',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  {
    id: 'IMPRESSIONS_VIEWABILITY',
    label: 'Impressions Viewability',
    isSortable: true,
    align: 'right',
    withGap: true,
  },
  // only for admin
  {
    id: 'CTR',
    label: 'CTR',
    align: 'right',
    withGap: true,
    isSortable: true,
  },
  // only for admin
  {
    id: 'COMPLETION_RATE',
    label: 'Completion Rate',
    align: 'right',
    withGap: true,
    isSortable: true,
  },
  // only for admin
  {
    id: 'CREATED',
    label: 'Creation Date',
    isSortable: true,
  },
];

export const SUPPLY_ACCOUNTS_PAGE_TAGS_CELLS = [
  {
    key: 'name',
  },
  {
    key: 'demands',
  },
  {
    key: 'fields.SUPPLY_REQUESTS',
    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.PUB_REVENUE',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.PUB_NET_REVENUE',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.RPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.GROSS_RPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.PUB_AD_RPM',
    align: 'right',
    prefix: '$',
    withPercent: true,
  },
  {
    key: 'fields.SUPPLY_REQUESTS_FILL',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.SUPPLY_REQUESTS_VIEWABILITY',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.IMPRESSIONS_VIEWABILITY',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.CTR',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'fields.COMPLETION_RATE',
    align: 'right',
    postfix: '%',
    needMultiply: true,
    withPercent: true,
  },
  {
    key: 'created',
  },
];

export const SUPPLY_ACCOUNTS_PAGE_TAGS_FIELDS = [
  'SUPPLY_REQUESTS',
  'IMPRESSIONS',
  'SUPPLY_REQUESTS_FILL',
  'REVENUE',
  'PUB_REVENUE',
  'GROSS_REVENUE',
  'RPM',
  'GROSS_RPM',
  'PUB_AD_RPM',
  'SUPPLY_REQUESTS_VIEWABILITY',
  'IMPRESSIONS_VIEWABILITY',
  'COMPLETION_RATE',
  'CTR',
  'PUB_NET_REVENUE',
];

export const SUPPLY_ACCOUNTS_PAGE_TAGS_GRAPHQL_QUERY = `
query SupplyTagDataQuery(
  $fields: [String],
  $sort: MarketplaceSortInputType,
  $from: Int,
  $size: Int,
  $filters: MarketplaceFiltersInputType,
  $allPages: Boolean
) {
  supplyTagData(
    fields: $fields,
    sort: $sort,
    from: $from,
    size: $size,
    filters: $filters,
    allPages: $allPages
  ) {
    totalCount
    data {
      id
      name
      demands
      accountId
      siteId
      created
      fields {
        SUPPLY_REQUESTS {
          value
          change
        }
        IMPRESSIONS {
          value
          change
        }
        SUPPLY_REQUESTS_FILL {
          value
          change
        }
        REVENUE {
          value
          change
        }
        PUB_REVENUE {
          value
          change
        }
        GROSS_REVENUE {
          value
          change
        }
        RPM {
          value
          change
        }
        GROSS_RPM {
          value
          change
        }
        PUB_AD_RPM {
          value
          change
        }
        SUPPLY_REQUESTS_VIEWABILITY {
          value
          change
        }
        IMPRESSIONS_VIEWABILITY {
          value
          change
        }
        COMPLETION_RATE {
          value
          change
        }
        CTR {
          value
          change
        }
        PUB_NET_REVENUE {
          value
          change
        }
      }
    }
  }
}
`;

export const SUPPLY_ACCOUNTS_PAGE_CONFIG = {
  type: SUPPLY_ACCOUNTS_PAGE_TYPE,
  pathname: SUPPLY_ACCOUNTS_PAGE_PATHNAME,
  header: SUPPLY_ACCOUNTS_PAGE_HEADER,
  rowsPerPageOptions: [10, 25, 50, 100, 200],
  tabs: [
    {
      label: 'Supply Accounts',
      dataId: 'accounts',
      tableHeaders: SUPPLY_ACCOUNTS_PAGE_HEADERS.filter((item) => !['PUB_PLAYER_ERPM', 'PUB_AD_RPM'].includes(item.id)),
      tableCells: SUPPLY_ACCOUNTS_PAGE_CELLS.filter(
        (item) => !['fields.PUB_PLAYER_ERPM', 'fields.PUB_AD_RPM'].includes(item.key),
      ),
      graphQuery: SUPPLY_ACCOUNTS_PAGE_GRAPHQL_QUERY,
      fields: SUPPLY_ACCOUNTS_PAGE_FIELDS,
      createRowLink: ({ pathname, id, name }) => `${pathname}/${id}?accountName=${encodeURIComponent(name)}`,
    },
    {
      label: 'Sites',
      dataId: 'sites',
      tableHeaders: SUPPLY_ACCOUNTS_PAGE_SITES_HEADERS.filter(
        (item) => !['PUB_PLAYER_ERPM', 'PUB_REVENUE', 'PUB_AD_RPM'].includes(item.id),
      ),
      tableCells: SUPPLY_ACCOUNTS_PAGE_SITES_CELLS.filter(
        (item) => !['fields.PUB_PLAYER_ERPM', 'fields.PUB_REVENUE', 'fields.PUB_AD_RPM'].includes(item.key),
      ),
      graphQuery: SUPPLY_ACCOUNTS_PAGE_SITES_GRAPHQL_QUERY,
      fields: SUPPLY_ACCOUNTS_PAGE_SITES_FIELDS,
      createRowLink: ({ pathname, id, name, accountId }) =>
        `${pathname}/${accountId}/sites/${id}?siteName=${encodeURIComponent(name)}`,
    },
    {
      label: 'Supply Tags',
      dataId: 'tags',
      tableHeaders: SUPPLY_ACCOUNTS_PAGE_TAGS_HEADERS.filter(
        (item) => !['PUB_PLAYER_ERPM', 'PUB_REVENUE', 'PUB_AD_RPM'].includes(item.id),
      ),
      tableCells: SUPPLY_ACCOUNTS_PAGE_TAGS_CELLS.filter(
        (item) => !['fields.PUB_PLAYER_ERPM', 'fields.PUB_REVENUE', 'fields.PUB_AD_RPM'].includes(item.key),
      ),
      graphQuery: SUPPLY_ACCOUNTS_PAGE_TAGS_GRAPHQL_QUERY,
      fields: SUPPLY_ACCOUNTS_PAGE_TAGS_FIELDS,
      createRowLink: ({ pathname, id, name, accountId, siteId }) =>
        `${pathname}/${accountId}/sites/${siteId}/tags/${id}?tagName=${encodeURIComponent(name)}`,
    },
  ],
  selfServeTabs: [
    {
      label: 'Sites',
      dataId: 'sites',
      tableHeaders: SUPPLY_ACCOUNTS_PAGE_SITES_HEADERS.filter(
        (item) =>
          ![
            'PLAYER_ERPM',
            'REVENUE',
            'GROSS_REVENUE',
            'GROSS_RPM',
            'PUB_AD_RPM',
            'GROSS_PLAYER_ERPM',
            'CTR',
            'COMPLETION_RATE',
          ].includes(item.id),
      ),
      tableCells: SUPPLY_ACCOUNTS_PAGE_SITES_CELLS.filter(
        (item) =>
          ![
            'fields.PLAYER_ERPM',
            'fields.REVENUE',
            'fields.GROSS_REVENUE',
            'fields.GROSS_RPM',
            'fields.PUB_AD_RPM',
            'fields.GROSS_PLAYER_ERPM',
            'fields.CTR',
            'fields.COMPLETION_RATE',
          ].includes(item.key),
      ),
      graphQuery: SUPPLY_ACCOUNTS_PAGE_SITES_GRAPHQL_QUERY,
      fields: SUPPLY_ACCOUNTS_PAGE_SITES_FIELDS,
      createRowLink: ({ pathname, id, name, accountId }) =>
        `${pathname}/${accountId}/sites/${id}?siteName=${encodeURIComponent(name)}`,
      defaultConfig: {
        sortBy: 'PLAYER_LOADS',
      },
    },
    {
      label: 'Supply Tags',
      dataId: 'tags',
      tableHeaders: SUPPLY_ACCOUNTS_PAGE_TAGS_HEADERS.filter(
        (item) =>
          ![
            'PLAYER_ERPM',
            'REVENUE',
            'GROSS_REVENUE',
            'GROSS_RPM',
            'PUB_AD_RPM',
            'CTR',
            'COMPLETION_RATE',
            'CREATED',
          ].includes(item.id),
      ),
      tableCells: SUPPLY_ACCOUNTS_PAGE_TAGS_CELLS.filter(
        (item) =>
          ![
            'fields.PLAYER_ERPM',
            'fields.REVENUE',
            'fields.GROSS_REVENUE',
            'fields.GROSS_RPM',
            'fields.PUB_AD_RPM',
            'fields.CTR',
            'fields.COMPLETION_RATE',
            'created',
          ].includes(item.key),
      ),
      graphQuery: SUPPLY_ACCOUNTS_PAGE_TAGS_GRAPHQL_QUERY,
      fields: SUPPLY_ACCOUNTS_PAGE_TAGS_FIELDS,
      createRowLink: ({ pathname, id, name, accountId, siteId }) =>
        `${pathname}/${accountId}/sites/${siteId}/tags/${id}?tagName=${encodeURIComponent(name)}`,
    },
  ],
  defaultConfig: {
    sortBy: 'SUPPLY_REQUESTS',
  },
};
