/*!
 * Copyright © 2024 Splunk Inc.
 * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
 * in part without a valid written license from Splunk Inc. is PROHIBITED.
 */
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 82);
/******/ })
/************************************************************************/
/******/ ({

/***/ 0:
/***/ (function(module, exports) {

module.exports = require("@splunk/ui-utils/i18n");

/***/ }),

/***/ 1:
/***/ (function(module, exports) {

module.exports = require("@babel/runtime/helpers/toConsumableArray");

/***/ }),

/***/ 10:
/***/ (function(module, exports) {

module.exports = require("@splunk/themes/variables");

/***/ }),

/***/ 11:
/***/ (function(module, exports) {

module.exports = require("@splunk/visualization-icons/placeholders");

/***/ }),

/***/ 12:
/***/ (function(module, exports) {

module.exports = require("@splunk/visualization-icons");

/***/ }),

/***/ 2:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.VizBehavior = void 0;
var VizBehavior;

(function (VizBehavior) {
  /**
   * Dynamic Options Behavior.
   * This allows visualization options to be powered by data
   *
   * **Example**
   *
   * sparklineValues: ">primary|seriesByIndex(0)"
   * would configure sparklineValues with an array of data points
   * coming from the first series in the primary datasource
   *
   */
  VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
  VizBehavior["EVENTS"] = "events";
  VizBehavior["DOWNSAMPLING"] = "downsampling";
  /**
   * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
   * missing.
   * @type {string}
   */

  VizBehavior["PLACEHOLDER"] = "placeholder";
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
  VizBehavior["TRELLIS"] = "trellis";
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));

/***/ }),

/***/ 26:
/***/ (function(module, exports) {

module.exports = require("@splunk/visualizations-shared/colorConstants");

/***/ }),

/***/ 3:
/***/ (function(module, exports) {

module.exports = require("@splunk/visualizations-shared/schemaUtils");

/***/ }),

/***/ 4:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _toConsumableArray = __webpack_require__(1);

var _defineProperty = __webpack_require__(7);

var __rest = this && this.__rest || function (s, e) {
  var t = {};

  for (var p in s) {
    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
  }

  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
  }
  return t;
};

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;

var lodash_1 = __webpack_require__(6);

var schemaUtils_1 = __webpack_require__(3);

var VizBehavior_1 = __webpack_require__(2);

var dynamicOptionsDSLType = {
  type: 'string',
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
};
/**
 * Helper function to extend an options schema with dynamic options DSL
 * @param optionsSchema a visualization's options schema
 * @returns an updated options schema that additionally allows strings starting with > for each option
 */

function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
  var enhancedOptionsSchema = {};
  Object.keys(optionsSchema).forEach(function (key) {
    var _a = optionsSchema[key],
        title = _a.title,
        description = _a.description,
        readOnly = _a.readOnly,
        writeOnly = _a.writeOnly,
        examples = _a.examples,
        defaultValue = _a.default,
        type = _a.type,
        properties = _a.properties,
        patternProperties = _a.patternProperties,
        remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);

    var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
      title: title
    }), description !== undefined && {
      description: description
    }), readOnly !== undefined && {
      readOnly: readOnly
    }), writeOnly !== undefined && {
      writeOnly: writeOnly
    }), examples !== undefined && {
      examples: examples
    }), defaultValue !== undefined && {
      default: defaultValue
    });

    if (type === 'object') {
      enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
        type: type
      }), properties && {
        properties: enhanceOptionsSchemaWithDynamicOptions(properties)
      });

      if (patternProperties) {
        var enhancedPatternProperties = {};
        Object.keys(patternProperties).forEach(function (opt) {
          enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
        });
        enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
      }
    } else {
      enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
        anyOf: [Object.assign(Object.assign({}, type !== undefined && {
          type: type
        }), remainingSchemaEntry), dynamicOptionsDSLType]
      });
    }
  });
  return enhancedOptionsSchema;
}

exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
/**
 * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
 * this function also collapse all editor panels
 * @param vizConfig a Visualization Config
 * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
 * and containing `open: false` for all editor panels in editorConfig
 */

function enhanceConfig(vizConfig) {
  var enhancedConfig = Object.assign({}, vizConfig);

  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
    enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
  }

  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
    return Object.assign(Object.assign({}, config), {
      open: config.open || false
    });
  });
  return enhancedConfig;
}

exports.enhanceConfig = enhanceConfig;
/**
 * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
 * Created for editor unit tests
 * @param vizConfig a Visualization Config
 * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
 */

function uncollapseEditorConfig(vizConfig) {
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
    return Object.assign(Object.assign({}, config), {
      open: true
    });
  });
  return editorPanelUncollapsedConfig;
}

exports.uncollapseEditorConfig = uncollapseEditorConfig;

function isDynamicOption(option) {
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
}

exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset

/**
 * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
 * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
 * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
 * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
 *
 * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
 */

function hasCompatibleContexts(vizContext, presetContext) {
  var presetContextKeys = Object.keys(presetContext);
  return presetContextKeys.every(function (contextKey) {
    return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
  });
}
/**
 * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
 */


function hasCompatibleOptions(vizOptions, presetOptions) {
  var presetOptionKeys = Object.keys(presetOptions);
  return presetOptionKeys.every(function (optionKey) {
    return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
  });
}
/**
 * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
 * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
 *
 * @param {Object} vizContext - the current vizContext definition
 * @param {Object} vizOptions - the current vizOptions definition
 * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
 */


function getInitialPreset(vizContext, vizOptions, presets) {
  return presets.find(function (preset) {
    var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
    var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
    var presetContextKeys = Object.keys(presetContext);
    var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
    // if not, then the preset is invalid in config.ts

    if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
    return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
  });
}

exports.getInitialPreset = getInitialPreset;
/**
 * generates number precision values for a Select editor
 *
 * @param {Number} numPrecisionValues - number of integer precision values to generate
 * @returns {{ label: string; value; string  }[]} array of { label, value } tuples
 */

function generatePrecisionValues(numPrecisionValues) {
  return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
    return {
      label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
      value: i
    };
  });
}

exports.generatePrecisionValues = generatePrecisionValues;
/**
 * insert layout in layout array, return a new layout array instead of updating the original
 *
 * @param {EditorLayoutConfig[][]} layout - editor layout
 * @param {Number} index - the index to insert layout item(s)
 * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
 * @returns {EditorLayoutConfig[][]} new editor layout with insertion
 */

var insertLayout = function insertLayout(layout, index) {
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
    layoutItems[_key - 2] = arguments[_key];
  }

  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
};

exports.insertLayout = insertLayout;

/***/ }),

/***/ 6:
/***/ (function(module, exports) {

module.exports = require("lodash");

/***/ }),

/***/ 7:
/***/ (function(module, exports) {

module.exports = require("@babel/runtime/helpers/defineProperty");

/***/ }),

/***/ 8:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.VizCategory = void 0;
var VizCategory;

(function (VizCategory) {
  VizCategory["SINGLE_VALUE"] = "Single Value";
  VizCategory["TRENDS"] = "Trends";
  VizCategory["COMPARISONS"] = "Comparisons";
  VizCategory["TABLE"] = "Table";
  VizCategory["GAUGE"] = "Gauge";
  VizCategory["DISTRIBUTIONS"] = "Distributions";
  VizCategory["CHOROPLETH"] = "Choropleth Maps";
  VizCategory["SHAPES"] = "Shapes";
  VizCategory["MISC"] = "misc";
  VizCategory["FLOW"] = "Flow";
  VizCategory["CORRELATION"] = "Correlation";
  VizCategory["SPATIAL"] = "Spatial";
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));

/***/ }),

/***/ 82:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _toConsumableArray = __webpack_require__(1);

Object.defineProperty(exports, "__esModule", {
  value: true
});

var i18n_1 = __webpack_require__(0);

var lodash_1 = __webpack_require__(6);

var schemaUtils_1 = __webpack_require__(3);

var colorConstants_1 = __webpack_require__(26);

var visualization_icons_1 = __webpack_require__(12);

var placeholders_1 = __webpack_require__(11);

var variables_1 = __webpack_require__(10);

var pick_1 = __webpack_require__(9);

var TextAlignCenter_1 = __webpack_require__(83);

var TextAlignLeft_1 = __webpack_require__(84);

var TextAlignRight_1 = __webpack_require__(85);

var configUtils_1 = __webpack_require__(4);

var VizBehavior_1 = __webpack_require__(2);

var consts_1 = __webpack_require__(86);

var VizCategory_1 = __webpack_require__(8);

var dataContract = {
  requiredDataSources: [{
    name: 'primary',
    description: 'DataSource that powers the visualization'
  }],
  optionalDataSources: [],
  initialRequestParams: {
    primary: function primary() {
      var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
      return {
        offset: 0,
        count: options.count ? options.count : 10,
        requestTotalCount: true
      };
    }
  }
};
var size = {
  initialWidth: 300,
  initialHeight: 300
};
var defaultContext = {
  tableAlignByType: [{
    match: 'string',
    value: 'left'
  }, {
    match: 'number',
    value: 'right'
  }, {
    match: 'time',
    value: 'left'
  }, {
    match: 'color',
    value: 'left'
  }, {
    match: 'array',
    value: 'left'
  }, {
    match: 'sparkline',
    value: 'center'
  }, {
    match: 'unknown',
    value: 'left'
  }, {
    match: 'null',
    value: 'left'
  }],
  tableCellTypeByType: [{
    match: 'string',
    value: 'TextCell'
  }, {
    match: 'number',
    value: 'TextCell'
  }, {
    match: 'time',
    value: 'TextCell'
  }, {
    match: 'color',
    value: 'TextCell'
  }, {
    match: 'array',
    value: 'ArrayCell'
  }, {
    match: 'sparkline',
    value: 'SparklineCell'
  }, {
    match: 'unknown',
    value: 'TextCell'
  }, {
    match: 'null',
    value: 'TextCell'
  }],
  // NOTE: These contexts are used by the table background color editor.
  // Please be careful removing/renaming/altering them.
  // There are unit tests and visual test that will capture breakages.
  tableRowColorMaxContrast: {
    colors: ['> themes.textColor', '> themes.inverseTextColor'],
    default: '> themes.textColor'
  },
  tableRowBackgroundColorEvenConfig: {
    channel: 'hsv.v',
    value: '*0.96'
  },
  tableHeaderBackgroundColorConfig: {
    channel: 'hsv.v',
    value: '*0.9'
  },
  tableRowBackgroundColorsByTheme: ['> themes.rowBackgroundColorOdd'],
  tableAltRowBackgroundColorsByTheme: ['> themes.rowBackgroundColorOdd', '> themes.rowBackgroundColorEven'],
  tableRowBackgroundColorsByBackgroundColor: ['> backgroundColor'],
  tableAltRowBackgroundColorsByBackgroundColor: ['> backgroundColor', '> backgroundColor | setColorChannel(tableRowBackgroundColorEvenConfig)']
};
var headerAlignConfigTable = {
  label: (0, i18n_1._)('Header alignment'),
  editor: 'editor.radioBar',
  option: 'tableFormat.headerAlign',
  editorProps: {
    values: [{
      label: (0, i18n_1._)('Left'),
      value: 'left',
      icon: TextAlignLeft_1.default
    }, {
      label: (0, i18n_1._)('Center'),
      value: 'center',
      icon: TextAlignCenter_1.default
    }, {
      label: (0, i18n_1._)('Right'),
      value: 'right',
      icon: TextAlignRight_1.default
    }]
  }
};
var headerAlignConfigColumn = Object.assign(Object.assign({}, headerAlignConfigTable), {
  option: 'headerAlign',
  editorProps: {
    values: [{
      label: (0, i18n_1._)('Auto'),
      value: 'auto'
    }, {
      label: (0, i18n_1._)('Left'),
      value: 'left',
      icon: TextAlignLeft_1.default
    }, {
      label: (0, i18n_1._)('Center'),
      value: 'center',
      icon: TextAlignCenter_1.default
    }, {
      label: (0, i18n_1._)('Right'),
      value: 'right',
      icon: TextAlignRight_1.default
    }]
  }
});
var textOverflowConfigColumn = {
  label: (0, i18n_1._)('Text wrapping'),
  editor: 'editor.radioBar',
  option: 'textOverflow',
  editorProps: {
    values: [{
      label: (0, i18n_1._)('Standard'),
      value: 'break-word'
    }, {
      label: (0, i18n_1._)('Anywhere'),
      value: 'anywhere'
    }, {
      label: (0, i18n_1._)('Trim'),
      value: 'ellipsis'
    }]
  }
};
var textAlignConfigTable = {
  label: (0, i18n_1._)('Cells alignment'),
  editor: 'editor.radioBar',
  option: 'tableFormat.align',
  editorProps: {
    values: [{
      label: (0, i18n_1._)('Auto'),
      value: '> table | type() | matchValue(tableAlignByType)'
    }, {
      label: (0, i18n_1._)('Left'),
      value: 'left',
      icon: TextAlignLeft_1.default
    }, {
      label: (0, i18n_1._)('Center'),
      value: 'center',
      icon: TextAlignCenter_1.default
    }, {
      label: (0, i18n_1._)('Right'),
      value: 'right',
      icon: TextAlignRight_1.default
    }]
  }
};
var textAlignConfigColumn = Object.assign(Object.assign({}, textAlignConfigTable), {
  option: 'align',
  editorProps: {
    values: [{
      label: (0, i18n_1._)('Auto'),
      value: 'auto'
    }, {
      label: (0, i18n_1._)('Left'),
      value: 'left',
      icon: TextAlignLeft_1.default
    }, {
      label: (0, i18n_1._)('Center'),
      value: 'center',
      icon: TextAlignCenter_1.default
    }, {
      label: (0, i18n_1._)('Right'),
      value: 'right',
      icon: TextAlignRight_1.default
    }]
  }
});
var unitPositionConfig = {
  label: (0, i18n_1._)('Units position'),
  editor: 'editor.select',
  option: 'unitPosition',
  editorProps: {
    values: [{
      label: (0, i18n_1._)('Before'),
      value: 'before'
    }, {
      label: (0, i18n_1._)('After'),
      value: 'after'
    }]
  }
};
var unitLabelConfig = {
  label: (0, i18n_1._)('Unit label'),
  option: 'unit',
  editor: 'editor.text'
};
var timeFormattingConfig = {
  label: (0, i18n_1._)('Date & Time formatting'),
  option: 'format',
  editor: 'editor.text',
  editorProps: {
    tooltip: (0, i18n_1._)('For example: DD-MM-YYYY')
  }
};
var sequentialColorConfig = [{
  to: 20,
  value: '#D41F1F'
}, {
  from: 20,
  to: 40,
  value: '#D94E17'
}, {
  from: 40,
  to: 60,
  value: '#CBA700'
}, {
  from: 60,
  to: 80,
  value: '#669922'
}, {
  from: 80,
  value: '#118832'
}];
var matchColorConfig = [{
  match: '',
  value: '#5C33FF'
}];
var optionsSchema = {
  backgroundColor: {
    default: '> themes.defaultBackgroundColor',
    description: 'Specify the color for the background. You might use a data source to apply the color. The default for enterprise light is "#FFFFFF". The default for enterprise dark is "#000000". The default for prisma dark is "#0B0C0E".',
    pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
    type: 'string'
  },
  columnFormat: {
    description: 'Lets you format an individual column in a table. Specify a column in a table as a field, followed by a property. For more information, see the Column Format Align - Left example on the Examples page.',
    type: 'object',
    patternProperties: {
      '.*': {
        description: 'Customization for column property',
        type: 'object',
        properties: {
          align: {
            description: 'Specify the alignment for the whole column. Valid alignments include "left", "center", and "right". You can also pass an array to specify the alignment of each cell. When set to "auto", the column will use the same configuration as tableFormat.align.',
            type: ['string', 'array'],
            items: {
              type: 'string',
              enum: consts_1.validAlignments.concat()
            },
            default: 'auto'
          },
          cellTypes: {
            description: 'Specify how to render data in cells. Valid cell renders include "TextCell", "ArrayCell", "SparklineCell".',
            type: 'array',
            items: {
              type: 'string',
              enum: consts_1.validCellRenderers.concat()
            }
          },
          data: {
            description: 'Specify data points to be displayed in the cells of a column.',
            type: 'array',
            items: {
              oneOf: [{
                type: 'string'
              }, {
                type: 'number'
              }, {
                type: 'array',
                items: {
                  type: ['string', 'number']
                }
              }]
            }
          },
          headerAlign: {
            description: 'Specify the heaader alignment for the whole column. Valid alignments include "left", "center", and "right".  When set to "auto", the column will use the same configuration as tableFormat.headerAlign',
            type: 'string',
            items: {
              type: 'string',
              enum: consts_1.validAlignments.concat()
            },
            default: 'auto'
          },
          rowBackgroundColors: {
            description: 'Specify a list of colors, in hexadecimal code, for the background color of each column of the table. For example, ["#2C333B", "32373D"].',
            type: 'array',
            items: {
              type: 'string',
              pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
            }
          },
          rowColors: {
            description: 'Specify a list of colors, in hexadecimal code, for the text color of the cells of a column. For example, ["#2C333B", "32373D"].',
            type: 'array',
            items: {
              type: 'string',
              pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
            }
          },
          sparklineAreaColors: {
            description: 'Specify a list of colors, in hexadecimal code, for the sparkline area of each column. For example, ["#2C333B", "32373D"].',
            type: 'array',
            items: {
              type: 'string',
              pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
            }
          },
          sparklineColors: {
            description: 'Specify a list of colors, in hexadecimal code, for the sparkline stroke of each column. For example, ["#2C333B", "32373D"].',
            type: 'array',
            items: {
              type: 'string',
              pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
            }
          },
          sparklineTypes: {
            description: 'Choose either area or line formatting for the Sparkline. Valid sparkline types include "line" and "area".',
            type: 'array',
            items: {
              type: 'string',
              enum: consts_1.validSparklineTypes.concat()
            }
          },
          textOverflow: {
            description: 'Controls how the text should be truncated within a particular column. Valid types include "anywhere", "break-word", "ellipsis".  Columns are "break-word" styled by default when "textOverflow" is not configured.',
            type: 'string',
            pattern: (0, schemaUtils_1.getPattern)(consts_1.validTextOverflows),
            enum: consts_1.validTextOverflows.concat()
          },
          width: {
            description: 'Specify, in pixels, the width of the column. The default displays a minimum width of at least 90, unless the table needs to filled further. The minimum width is 30px.',
            type: 'number',
            minimum: 30
          }
        }
      }
    }
  },
  count: {
    description: 'Specify the maximum number of rows to display.',
    type: 'number',
    default: 10
  },
  font: {
    default: 'proportional',
    description: 'Specify the font style to use for table content.',
    type: 'string',
    pattern: (0, schemaUtils_1.getPattern)(['proportional', 'monospace'])
  },
  fontSize: {
    default: 'default',
    description: 'Specify the font size to use for table content. Font sizes range from extra small (10px) to large (16px) with the default being 14px.',
    type: 'string',
    pattern: (0, schemaUtils_1.getPattern)(consts_1.validFontSizes)
  },
  headers: {
    default: '> table | getField()',
    description: "Specify an array of headers to display on the table. Though these can be statically listed, it's best to use the dynamic default, as it will return the fields of your search.",
    type: 'array',
    items: {
      type: 'string'
    }
  },
  headerVisibility: {
    default: 'inline',
    description: 'Specify how to display the table header row.',
    pattern: (0, schemaUtils_1.getPattern)(consts_1.validHeaderVisibilities),
    enum: consts_1.validHeaderVisibilities.concat(),
    type: 'string'
  },
  paginateDataSourceKey: {
    default: 'primary',
    description: 'Specify the data source key for pagination and sorting.',
    type: 'string'
  },
  showInternalFields: {
    default: true,
    description: 'Specify whether to show internal fields that start with an underscore. The _time field will still be shown if false.',
    type: 'boolean'
  },
  showRowNumbers: {
    default: false,
    description: 'Show row numbers in the first column.',
    type: 'boolean'
  },
  table: {
    default: '> primary',
    description: 'Two dimensional array of data to be displayed in the table.',
    type: 'array',
    items: {
      type: 'array',
      items: {
        oneOf: [{
          type: 'string'
        }, {
          type: 'number'
        }, {
          type: 'array',
          items: {
            type: ['string', 'number']
          }
        }]
      }
    }
  },
  tableFormat: {
    description: 'Lets you set global options for a table.',
    type: 'object',
    properties: {
      align: {
        default: '> table | type() | matchValue(tableAlignByType)',
        description: 'Specify alignment for the whole table. Valid alignments include "left", "center", and "right". You can also pass a 2 dimensional array to specify the alignment of each cell. By default, the table will be aligned by type.',
        type: ['string', 'array'],
        items: {
          type: 'array',
          items: {
            type: 'string',
            enum: consts_1.validAlignments.concat()
          }
        }
      },
      cellTypes: {
        default: '> table | type() | matchValue(tableCellTypeByType)',
        description: 'Specify how to render data in cells. Valid cell renders include "TextCell", "ArrayCell", "SparklineCell".',
        type: 'array',
        items: {
          type: 'array',
          items: {
            type: 'string',
            enum: consts_1.validCellRenderers.concat()
          }
        }
      },
      data: {
        description: 'Two dimensional data to be displayed in the table. This is usually formatted data instead of raw data from search.',
        type: 'array',
        items: {
          type: 'array',
          items: {
            oneOf: [{
              type: 'string'
            }, {
              type: 'number'
            }, {
              type: 'array',
              items: {
                type: ['string', 'number']
              }
            }]
          }
        }
      },
      headerAlign: {
        description: 'Specify the header alignment for the whole table. Valid alignments include "left", "center", and "right".',
        type: 'string',
        items: {
          type: 'string',
          enum: consts_1.validAlignments.concat()
        },
        default: 'left'
      },
      headerBackgroundColor: {
        default: '> themes.defaultHeaderBackgroundColor',
        description: 'Specify the table header background color using a hexadecimal code. For example, "#FFFFFF".',
        pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
        type: 'string'
      },
      headerColor: {
        description: 'Specify the table header text color using a hexadecimal code. For example, "#FFFFFF".',
        pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
        type: 'string'
      },
      rowBackgroundColors: {
        default: '> table | seriesByIndex(0) | pick(tableAltRowBackgroundColorsByTheme)',
        description: 'Specify a list of colors, in hexadecimal code, for the background color of each row of the table. For example, ["#2C333B", "32373D"].',
        type: 'array',
        items: {
          type: 'array',
          items: {
            type: 'string',
            pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
          }
        }
      },
      rowColors: {
        description: 'Specify a list of colors, in hexadecimal code, for the text color of each row of the table. For example, ["#2C333B", "32373D"].',
        type: 'array',
        items: {
          type: 'array',
          items: {
            type: 'string',
            pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
          }
        }
      },
      sparklineAreaColors: {
        description: 'Specify a list of colors, in hexadecimal code, for the sparkline area of each row of the table. For example, ["#2C333B", "32373D"].',
        type: 'array',
        items: {
          type: 'array',
          items: {
            type: 'string',
            pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
          }
        }
      },
      sparklineColors: {
        description: 'Specify a list of colors, in hexadecimal code, for the sparkline stroke of each row of the table. For example, ["#2C333B", "32373D"].',
        type: 'array',
        items: {
          type: 'array',
          items: {
            type: 'string',
            pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
          }
        }
      },
      sparklineTypes: {
        description: 'Choose either area or line formatting for the Sparkline.',
        type: 'array',
        items: {
          type: 'array',
          items: {
            type: 'string',
            enum: consts_1.validSparklineTypes.concat()
          }
        }
      },
      textOverflow: {
        description: 'Specify the text overflow for the whole column. Valid overflows include "break-word", "anywhere", and "ellipsis".',
        type: 'string',
        items: {
          type: 'string',
          enum: consts_1.validTextOverflows.concat()
        },
        default: 'break-word'
      }
    }
  }
};
var themes = {
  defaultBackgroundColor: function defaultBackgroundColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: variables_1.default.black(props),
        light: variables_1.default.backgroundColor(props)
      },
      prisma: variables_1.default.backgroundColorSidebar(props)
    })(props);
  },
  defaultHeaderBackgroundColor: function defaultHeaderBackgroundColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: variables_1.default.gray20(props),
        light: variables_1.default.gray92(props)
      },
      prisma: variables_1.default.backgroundColor(props)
    })(props);
  },
  rowBackgroundColorEven: function rowBackgroundColorEven(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: variables_1.default.black(props),
        light: variables_1.default.gray96(props)
      },
      prisma: variables_1.default.backgroundColorPage(props)
    })(props);
  },
  rowBackgroundColorOdd: function rowBackgroundColorOdd(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: '#0D1012',
        light: variables_1.default.backgroundColor(props)
      },
      prisma: variables_1.default.backgroundColorSidebar(props)
    })(props);
  },
  textColor: function textColor(props) {
    return (0, pick_1.default)({
      enterprise: variables_1.default.textColor(props),
      prisma: variables_1.default.contentColorDefault(props)
    })(props);
  },
  inverseTextColor: function inverseTextColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: variables_1.default.contentColorInverted(props),
        light: variables_1.default.white(props) // equal to textColor in enterpriseDark

      },
      prisma: variables_1.default.contentColorInverted(props)
    })(props);
  }
};
var backgroundColorPaletteSet = new Set([].concat(_toConsumableArray(colorConstants_1.COLOR_EDITOR_PALETTE), _toConsumableArray((0, lodash_1.map)(themes, function (t) {
  return (0, lodash_1.get)(t, 'defaultBackgroundColor');
}))));
var EDITOR_LABEL_WIDTH = 100;
var editorConfig = [{
  label: (0, i18n_1._)('Data display'),
  layout: [[{
    label: (0, i18n_1._)('Rows displayed'),
    option: 'count',
    editor: 'editor.number',
    editorProps: {
      min: 0,
      labelWidth: EDITOR_LABEL_WIDTH
    }
  }], [{
    label: (0, i18n_1._)('Row numbers'),
    option: 'showRowNumbers',
    editor: 'editor.checkbox',
    editorProps: {
      labelWidth: EDITOR_LABEL_WIDTH
    }
  }], [{
    label: (0, i18n_1._)('Internal fields'),
    option: 'showInternalFields',
    editor: 'editor.checkbox',
    editorProps: {
      labelWidth: EDITOR_LABEL_WIDTH
    }
  }], [{
    label: (0, i18n_1._)('Header row'),
    option: 'headerVisibility',
    editor: 'editor.select',
    editorProps: {
      values: [{
        label: (0, i18n_1._)('Inline'),
        value: 'inline'
      }, {
        label: (0, i18n_1._)('Fixed'),
        value: 'fixed'
      }, {
        label: (0, i18n_1._)('Hidden'),
        value: 'none'
      }],
      labelWidth: EDITOR_LABEL_WIDTH
    }
  }]]
}, {
  label: (0, i18n_1._)('Color and style'),
  layout: [[{
    key: 'backgroundColor',
    editor: 'editor.tableBackgroundColor',
    editorProps: {
      themes: themes,
      labelPosition: 'top',
      labelWidth: EDITOR_LABEL_WIDTH,
      palette: _toConsumableArray(backgroundColorPaletteSet)
    }
  }], [{
    option: 'font',
    label: (0, i18n_1._)('Font'),
    editor: 'editor.select',
    editorProps: {
      values: [{
        label: (0, i18n_1._)('Proportional (Default)'),
        value: 'proportional'
      }, {
        label: (0, i18n_1._)('Monospace'),
        value: 'monospace'
      }],
      labelPosition: 'top',
      labelWidth: EDITOR_LABEL_WIDTH
    }
  }], [{
    option: 'fontSize',
    label: (0, i18n_1._)('Font size'),
    editor: 'editor.select',
    editorProps: {
      values: [{
        label: (0, i18n_1._)('Extra Small (font 10px, row 24px)'),
        value: 'extraSmall'
      }, {
        label: (0, i18n_1._)('Small (font 12px, row 24px)'),
        value: 'small'
      }, {
        label: (0, i18n_1._)('Default (font 14px, row 32px)'),
        value: 'default'
      }, {
        label: (0, i18n_1._)('Large (font 16px, row 36px)'),
        value: 'large'
      }],
      labelPosition: 'top',
      labelWidth: EDITOR_LABEL_WIDTH
    }
  }], [Object.assign({}, headerAlignConfigTable)], [Object.assign({}, textAlignConfigTable)], [{
    label: (0, i18n_1._)('Column-specific formatting'),
    editor: 'editor.tableColumnFormatter',
    editorProps: {
      // popover: {sections: [textFormatConfig, formatByTypeConfig, columnColoringConfig]}
      // Table column coloring does not adhere to same DSL structure as other dynamically colored options
      // we use the FormatterEditor directly and not the DynamicColorEditor's provided DSL builders
      columnColoringConfig: {
        coloringTypes: [{
          label: (0, i18n_1._)('Text'),
          value: 'rowColors'
        }, {
          label: (0, i18n_1._)('Background'),
          value: 'rowBackgroundColors'
        }],
        formatters: [{
          label: (0, i18n_1._)('Ranges'),
          value: 'rangeValue',
          defaults: {
            rowBackgroundColors: sequentialColorConfig,
            rowColors: sequentialColorConfig
          }
        }, {
          label: (0, i18n_1._)('Matches'),
          value: 'matchValue',
          defaults: {
            rowBackgroundColors: matchColorConfig,
            rowColors: matchColorConfig
          }
        }],
        themes: themes
      },
      defaultOptionsByType: {
        number: {
          thousandSeparated: false,
          unitPosition: 'after'
        },
        string: {
          unitPosition: 'after'
        },
        text: {
          align: 'auto',
          headerAlign: 'auto',
          textOverflow: 'break-word'
        }
      },
      textFormatConfig: [[Object.assign({}, headerAlignConfigColumn)], [Object.assign({}, textAlignConfigColumn)], [Object.assign({}, textOverflowConfigColumn)]],
      flyoutConfig: {
        number: [[Object.assign({}, unitPositionConfig), Object.assign({}, unitLabelConfig)], [{
          label: (0, i18n_1._)('Precision'),
          option: 'precision',
          editor: 'editor.select',
          editorProps: {
            values: (0, configUtils_1.generatePrecisionValues)(20)
          }
        }, {
          label: (0, i18n_1._)('Thousand separators'),
          option: 'thousandSeparated',
          editor: 'editor.radioBar',
          editorProps: {
            values: [{
              label: (0, i18n_1._)('Off'),
              value: false
            }, {
              label: (0, i18n_1._)('On'),
              value: true
            }]
          }
        }]],
        // TODO(fkurniawan): fill in with proper editor components
        sparkline: [],
        string: [[Object.assign({}, unitPositionConfig), Object.assign({}, unitLabelConfig)]],
        time: [[Object.assign({}, timeFormattingConfig)]]
      },
      value: function value(_ref) {
        var context = _ref.context,
            options = _ref.options;
        return {
          context: context,
          columnFormat: options.columnFormat,
          tableFormat: options.tableFormat
        };
      }
    },
    key: 'TableColumnFormatterEditor'
  }]]
}];
/**
 * visualization configuration
 */

var config = {
  /**
   * unique viz key
   */
  key: 'splunk.table',

  /**
   * viz name
   */
  name: (0, i18n_1._)('Table'),
  category: VizCategory_1.VizCategory.TABLE,

  /**
   * viz icon
   */
  icon: visualization_icons_1.Table,
  placeholderIcon: placeholders_1.Table,
  dataContract: dataContract,
  size: size,
  defaultContext: defaultContext,
  optionsSchema: optionsSchema,
  editorConfig: editorConfig,
  events: {
    'cell.click': {
      description: 'triggered when user clicks a table cell'
    }
  },
  supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PAGE_AND_SORT, VizBehavior_1.VizBehavior.PLACEHOLDER],
  themes: themes
};
exports.default = (0, configUtils_1.enhanceConfig)(config);

/***/ }),

/***/ 83:
/***/ (function(module, exports) {

module.exports = require("@splunk/react-icons/TextAlignCenter");

/***/ }),

/***/ 84:
/***/ (function(module, exports) {

module.exports = require("@splunk/react-icons/TextAlignLeft");

/***/ }),

/***/ 85:
/***/ (function(module, exports) {

module.exports = require("@splunk/react-icons/TextAlignRight");

/***/ }),

/***/ 86:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.validFontSizes = exports.validTextOverflows = exports.validAlignments = exports.validHeaderVisibilities = exports.validSparklineTypes = exports.validCellRenderers = void 0;
exports.validCellRenderers = ['TextCell', 'ArrayCell', 'SparklineCell'];
exports.validSparklineTypes = ['line', 'area'];
exports.validHeaderVisibilities = ['none', 'fixed', 'inline'];
exports.validAlignments = ['left', 'center', 'right'];
exports.validTextOverflows = ['anywhere', 'break-word', 'ellipsis'];
exports.validFontSizes = ['extraSmall', 'small', 'default', 'large'];

/***/ }),

/***/ 9:
/***/ (function(module, exports) {

module.exports = require("@splunk/themes/pick");

/***/ })

/******/ });
//# sourceMappingURL=Table.config.js.map