"use strict";

exports.__esModule = true;
exports.ListingPageType = void 0;

var _base = require("@sentecacommerce-theme/base");

var _lib = require("@sentecacommerce-theme/lib");

var Aggregate = {
  label: _base.FieldTypeFactory.text({
    required: true
  }),
  aggregationType: _base.FieldTypeFactory["enum"]({
    required: true,
    of: [{
      value: _lib.AggregationTypeEnum.Terms,
      label: 'Terms'
    }, {
      value: _lib.AggregationTypeEnum.Ranges,
      label: 'Ranges'
    }, {
      value: _lib.AggregationTypeEnum.Stats,
      label: 'Stats'
    }]
  }),
  aggregationDefinition: _base.FieldTypeFactory.text({
    required: true
  }),
  filterDefinition: _base.FieldTypeFactory.text({
    required: true
  }),
  order: _base.FieldTypeFactory.number({
    required: true
  }),
  collapsed: _base.FieldTypeFactory["boolean"]({
    defaultValue: false
  }),
  component: _base.FieldTypeFactory["enum"]({
    required: true,
    of: [{
      value: _lib.ComponentTypeEnum.Autocomplete,
      label: 'Autocomplete'
    }, {
      value: _lib.ComponentTypeEnum.Checkbox,
      label: 'Checkbox'
    }, {
      value: _lib.ComponentTypeEnum.Color,
      label: 'Color'
    }, {
      value: _lib.ComponentTypeEnum.Dropdown,
      label: 'Dropdown'
    }, {
      value: _lib.ComponentTypeEnum.Text,
      label: 'Text'
    }, {
      value: _lib.ComponentTypeEnum.TextWithLink,
      label: 'Text with Link'
    }, {
      value: _lib.ComponentTypeEnum.AttributeCheckbox,
      label: 'Attribute Checkbox'
    }]
  })
};

var ListingPageType = _base.ComponentTypeFactory.create('ListingPage', {
  seoAggregates: Aggregate,
  categoryTreeConfig: Aggregate,
  aggregates: _base.FieldTypeFactory.list({
    of: Aggregate
  }),
  sortOptions: _base.FieldTypeFactory.list({
    of: {
      key: _base.FieldTypeFactory.text({
        required: true
      }),
      label: _base.FieldTypeFactory.text({
        required: true
      })
    }
  }),
  defaultSortKey: _base.FieldTypeFactory.text({
    required: true
  }),
  labels: {
    noMatchingItems: _base.FieldTypeFactory.text(),
    seeMore: _base.FieldTypeFactory.text(),
    seeLess: _base.FieldTypeFactory.text(),
    resetAll: _base.FieldTypeFactory.text(),
    clearAllFilters: _base.FieldTypeFactory.text(),
    filters: _base.FieldTypeFactory.text(),
    showResults: _base.FieldTypeFactory.text(),
    show: _base.FieldTypeFactory.text(),
    results: _base.FieldTypeFactory.text(),
    sortBy: _base.FieldTypeFactory.text()
  },
  productsPerPage: _base.FieldTypeFactory.number({
    required: false,
    defaultValue: 24
  })
});

exports.ListingPageType = ListingPageType;
//# sourceMappingURL=listingPage.type.js.map