/*!
 * 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 = 47);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {

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

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

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

/***/ }),
/* 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 = {}));

/***/ }),
/* 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;

/***/ }),
/* 5 */
/***/ (function(module, exports) {

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

/***/ }),
/* 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 = {}));

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

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

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

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

/***/ }),
/* 11 */,
/* 12 */,
/* 13 */,
/* 14 */,
/* 15 */
/***/ (function(module, exports) {

module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");

/***/ }),
/* 16 */,
/* 17 */,
/* 18 */,
/* 19 */,
/* 20 */,
/* 21 */,
/* 22 */,
/* 23 */,
/* 24 */,
/* 25 */,
/* 26 */,
/* 27 */,
/* 28 */,
/* 29 */,
/* 30 */,
/* 31 */,
/* 32 */,
/* 33 */,
/* 34 */,
/* 35 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


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

var i18n_1 = __webpack_require__(0);

var configUtils_1 = __webpack_require__(5);

var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
  var defaultContext = _ref.defaultContext,
      defaultPalettesConfig = _ref.defaultPalettesConfig;
  return {
    label: (0, i18n_1._)('Fill'),
    option: 'fillColor',
    context: 'fillColorEditorConfig',
    editor: 'editor.dynamicColor',
    showEditor: function showEditor(_ref2) {
      var options = _ref2.options;
      return (0, configUtils_1.isDynamicOption)(options.fillColor);
    },
    editorProps: {
      labelPosition: 'top',
      flyoutTitle: (0, i18n_1._)('Dynamic coloring: fill'),
      formatters: [{
        label: (0, i18n_1._)('Ranges'),
        value: 'rangeValue',
        defaults: {
          fillDataValue: defaultContext.fillColorConfig
        }
      }, {
        label: (0, i18n_1._)('Matches'),
        value: 'matchValue',
        defaults: {
          fillDataValue: defaultContext.fillColorMatchConfig
        }
      }],
      dataSelectors: [{
        label: (0, i18n_1._)('Fill'),
        value: 'fillDataValue'
      }],
      defaultPalettesConfig: defaultPalettesConfig
    }
  };
};

exports.getDynamicFillColorEditor = getDynamicFillColorEditor;

/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


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

var i18n_1 = __webpack_require__(0);

var configUtils_1 = __webpack_require__(5);

var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
  var defaultContext = _ref.defaultContext,
      defaultPalettesConfig = _ref.defaultPalettesConfig;
  return {
    label: (0, i18n_1._)('Stroke'),
    option: 'strokeColor',
    context: 'strokeColorEditorConfig',
    editor: 'editor.dynamicColor',
    showEditor: function showEditor(_ref2) {
      var options = _ref2.options;
      return (0, configUtils_1.isDynamicOption)(options.strokeColor);
    },
    editorProps: {
      labelPosition: 'top',
      flyoutTitle: (0, i18n_1._)('Dynamic coloring: stroke'),
      formatters: [{
        label: (0, i18n_1._)('Ranges'),
        value: 'rangeValue',
        defaults: {
          strokeDataValue: defaultContext.strokeColorConfig
        }
      }, {
        label: (0, i18n_1._)('Matches'),
        value: 'matchValue',
        defaults: {
          strokeDataValue: defaultContext.strokeColorMatchConfig
        }
      }],
      dataSelectors: [{
        label: (0, i18n_1._)('Stroke'),
        value: 'strokeDataValue'
      }],
      defaultPalettesConfig: defaultPalettesConfig
    }
  };
};

exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;

/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


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

var i18n_1 = __webpack_require__(0);

var configUtils_1 = __webpack_require__(5);

var StaticFillColorEditor = {
  label: (0, i18n_1._)('Fill'),
  option: 'fillColor',
  editor: 'editor.color',
  showEditor: function showEditor(_ref) {
    var options = _ref.options;
    return !(0, configUtils_1.isDynamicOption)(options.fillColor);
  }
};
exports.default = StaticFillColorEditor;

/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


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

var i18n_1 = __webpack_require__(0);

var configUtils_1 = __webpack_require__(5);

var StaticStrokeColorEditor = {
  label: (0, i18n_1._)('Stroke'),
  option: 'strokeColor',
  editor: 'editor.color',
  showEditor: function showEditor(_ref) {
    var options = _ref.options;
    return !(0, configUtils_1.isDynamicOption)(options.strokeColor);
  }
};
exports.default = StaticStrokeColorEditor;

/***/ }),
/* 39 */,
/* 40 */,
/* 41 */,
/* 42 */,
/* 43 */,
/* 44 */,
/* 45 */,
/* 46 */,
/* 47 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


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

var i18n_1 = __webpack_require__(0);

var PresetPalettes_1 = __webpack_require__(15);

var pick_1 = __webpack_require__(9);

var variables_1 = __webpack_require__(10);

var VizBehavior_1 = __webpack_require__(2);

var VizCategory_1 = __webpack_require__(8);

var configUtils_1 = __webpack_require__(4);

var DynamicFillColorEditor_1 = __webpack_require__(35);

var DynamicStrokeColorEditor_1 = __webpack_require__(36);

var StaticFillColorEditor_1 = __webpack_require__(37);

var StaticStrokeColorEditor_1 = __webpack_require__(38);

var dataContract = {
  requiredDataSources: [],
  optionalDataSources: [{
    name: 'primary',
    description: 'DataSource that powers the visualization'
  }],
  initialRequestParams: {
    primary: {
      offset: 0,
      count: 10000
    }
  }
};
var size = {
  initialWidth: 300,
  initialHeight: 300
};
var defaultContext = {
  fillColorConfig: [{
    from: 100,
    value: '#118832'
  }, {
    from: 80,
    to: 100,
    value: '#669922'
  }, {
    from: 60,
    to: 80,
    value: '#9D9F0D'
  }, {
    from: 40,
    to: 60,
    value: '#CBA700'
  }, {
    from: 20,
    to: 40,
    value: '#D97A0D'
  }, {
    from: 0,
    to: 20,
    value: '#D94E17'
  }, {
    to: 0,
    value: '#D41F1F'
  }],
  strokeColorConfig: [{
    from: 100,
    value: '#118832'
  }, {
    from: 80,
    to: 100,
    value: '#669922'
  }, {
    from: 60,
    to: 80,
    value: '#9D9F0D'
  }, {
    from: 40,
    to: 60,
    value: '#CBA700'
  }, {
    from: 20,
    to: 40,
    value: '#D97A0D'
  }, {
    from: 0,
    to: 20,
    value: '#D94E17'
  }, {
    to: 0,
    value: '#D41F1F'
  }],
  fillColorMatchConfig: [{
    match: '',
    value: '#5C33FF'
  }],
  strokeColorMatchConfig: [{
    match: '',
    value: '#5C33FF'
  }]
};
var optionsSchema = {
  fillColor: {
    default: '> themes.defaultFillColor',
    description: 'Specify the fill color. You may use a dataSource to apply the color. The hex value format should be "#FFFFFF". The default for enterprise light is "#C3CBD4". The default for enterprise dark is "#31373E". The default for prisma dark is "#0B0C0E".',
    type: 'string'
  },
  fillOpacity: {
    default: 1,
    description: 'Specify the opacity of the fill. Choose a number in the range of 0 - 1 (inclusive). You can also express the value as a percentage. For example, "0.80" in source or "80%" in UI.',
    type: 'number'
  },
  strokeColor: {
    default: '> themes.defaultStrokeColor',
    description: 'Specify the stroke color. You may use a dataSource to apply the color. The hex value format should be "#FFFFFF". The default for enterprise light is "#3C444D". The default for enterprise dark is "#C3CBD4". The default for prisma dark is "#ACACAD".',
    type: 'string'
  },
  strokeDashStyle: {
    default: 0,
    description: 'Specify the size, in pixels, of dashes and spaces used to create a custom stitched outline. The value you specify applies to both the dashes and the spaces between them.',
    type: 'number'
  },
  strokeOpacity: {
    default: 1,
    description: 'Specify the opacity of the stroke. Choose a number in the range of 0 - 1 (inclusive). You can also express the value as a percentage. For example, "0.80" in source or "80%" in UI.',
    type: 'number'
  },
  strokeWidth: {
    default: 1,
    description: 'Specify the width of the stroke, in pixels, in the range of 1 - 25 (inclusive).',
    type: 'number'
  }
};
var themes = {
  defaultFillColor: function defaultFillColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: variables_1.default.gray25(props),
        light: variables_1.default.gray80(props)
      },
      prisma: variables_1.default.backgroundColorSidebar(props)
    })(props);
  },
  defaultStrokeColor: function defaultStrokeColor(props) {
    return (0, pick_1.default)({
      enterprise: {
        dark: variables_1.default.gray80(props),
        light: variables_1.default.gray30(props)
      },
      prisma: variables_1.default.neutral500(props)
    })(props);
  }
};
var basePresetContext = {
  fillColorEditorConfig: undefined,
  strokeColorEditorConfig: undefined
};
var basePresetOptions = {
  fillColor: undefined,
  strokeColor: undefined
};
var presets = [{
  // dummy context variables to allow for resetting of unused context states
  label: (0, i18n_1._)('None'),
  name: 'ellipse.none',
  value: {
    context: Object.assign({}, basePresetContext),
    options: Object.assign({}, basePresetOptions)
  }
}, {
  label: (0, i18n_1._)('Fill'),
  name: 'ellipse.fill',
  value: {
    context: Object.assign(Object.assign({}, basePresetContext), {
      fillDataValue: '> primary | seriesByType("number") | lastPoint()',
      fillColorEditorConfig: defaultContext.fillColorConfig
    }),
    options: Object.assign(Object.assign({}, basePresetOptions), {
      fillColor: '> fillDataValue | rangeValue(fillColorEditorConfig)'
    })
  }
}, {
  label: (0, i18n_1._)('Stroke'),
  name: 'ellipse.stroke',
  value: {
    context: Object.assign(Object.assign({}, basePresetContext), {
      strokeDataValue: '> primary | seriesByType("number") | lastPoint()',
      strokeColorEditorConfig: defaultContext.strokeColorConfig
    }),
    options: Object.assign(Object.assign({}, basePresetOptions), {
      strokeColor: '> strokeDataValue | rangeValue(strokeColorEditorConfig)'
    })
  }
}, {
  label: (0, i18n_1._)('Fill and Stroke'),
  name: 'ellipse.fillAndStroke',
  value: {
    context: Object.assign(Object.assign({}, basePresetContext), {
      fillDataValue: '> primary | seriesByType("number") | lastPoint()',
      strokeDataValue: '> primary | seriesByType("number") | lastPoint()',
      fillColorEditorConfig: defaultContext.fillColorConfig,
      strokeColorEditorConfig: defaultContext.strokeColorConfig
    }),
    options: Object.assign(Object.assign({}, basePresetOptions), {
      fillColor: '> fillDataValue | rangeValue(fillColorEditorConfig)',
      strokeColor: '> strokeDataValue | rangeValue(strokeColorEditorConfig)'
    })
  }
}];
var editorConfig = [{
  label: (0, i18n_1._)('Color and style'),
  layout: [[{
    label: (0, i18n_1._)('Dynamic elements'),
    key: 'presetSelector',
    editor: 'editor.presetSelector',
    editorProps: {
      presets: presets,
      value: function value(_ref) {
        var context = _ref.context,
            options = _ref.options;
        var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
        return initialPreset && initialPreset.label || null;
      }
    }
  }], [Object.assign(Object.assign({}, StaticFillColorEditor_1.default), {
    editorProps: {
      themes: themes
    }
  })], [(0, DynamicFillColorEditor_1.getDynamicFillColorEditor)({
    defaultContext: defaultContext,
    defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
  })], [Object.assign(Object.assign({}, StaticStrokeColorEditor_1.default), {
    editorProps: {
      themes: themes
    }
  })], [(0, DynamicStrokeColorEditor_1.getDynamicStrokeColorEditor)({
    defaultContext: defaultContext,
    defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
  })], [{
    label: (0, i18n_1._)('Fill opacity (%)'),
    option: 'fillOpacity',
    editor: 'editor.percent',
    editorProps: {
      min: 0
    }
  }, {
    label: (0, i18n_1._)('Stroke opacity (%)'),
    option: 'strokeOpacity',
    editor: 'editor.percent',
    editorProps: {
      min: 0
    }
  }], [{
    label: (0, i18n_1._)('Stroke width'),
    option: 'strokeWidth',
    editor: 'editor.number',
    editorProps: {
      min: 0
    }
  }, {
    label: (0, i18n_1._)('Stroke dash style'),
    option: 'strokeDashStyle',
    editor: 'editor.number',
    editorProps: {
      min: 0
    }
  }]]
}];
/**
 * visualization configuration
 */

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

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

  /**
   * viz icon
   */
  icon: null,
  dataContract: dataContract,
  size: size,
  defaultContext: defaultContext,
  optionsSchema: optionsSchema,
  editorConfig: editorConfig,
  events: {
    'ellipse.click': {
      description: 'triggered when user clicks ellipse',
      payloadKeys: ['strokeColor', 'fillColor']
    }
  },
  supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS],
  themes: themes
};
exports.default = (0, configUtils_1.enhanceConfig)(config);

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